Skip to content

Commit 9d6c31d

Browse files
refat75ArnobKumarSaha
authored andcommitted
Change replication channel password each time upon restart (#68)
Signed-off-by: Rabbani Islam Refat <[email protected]>
1 parent 63e88c0 commit 9d6c31d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ function create_replication_user() {
224224
retry 120 ${mysql} -N -e "RESET REPLICA;"
225225
else
226226
log "INFO" "Replication user exists. Skipping creating new one......."
227+
# Update replication channel password if it has been changed via RotateAuth
228+
retry 120 ${mysql} -N -e "STOP group_replication;"
229+
retry 120 ${mysql} -N -e "CHANGE REPLICATION SOURCE TO SOURCE_USER='repl', SOURCE_PASSWORD='$MYSQL_ROOT_PASSWORD' FOR CHANNEL 'group_replication_recovery';"
230+
retry 120 ${mysql} -N -e "START group_replication;"
227231
fi
228232
touch /scripts/ready.txt
229233
}

0 commit comments

Comments
 (0)