Skip to content

Commit e721fb9

Browse files
authored
Change replication channel password each time upon restart (#69)
Signed-off-by: Rabbani Islam Refat <[email protected]>
1 parent e9d46a0 commit e721fb9

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 MASTER;"
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 MASTER TO MASTER_USER='repl', MASTER_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)