Skip to content

Commit ff896ff

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

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
@@ -222,6 +222,10 @@ function create_replication_user() {
222222
retry 120 ${mysql} -N -e "RESET REPLICA;"
223223
else
224224
log "INFO" "Replication user exists. Skipping creating new one......."
225+
# Update replication channel password if it has been changed via RotateAuth
226+
retry 120 ${mysql} -N -e "STOP group_replication;"
227+
retry 120 ${mysql} -N -e "CHANGE REPLICATION SOURCE TO SOURCE_USER='repl', SOURCE_PASSWORD='$MYSQL_ROOT_PASSWORD' FOR CHANNEL 'group_replication_recovery';"
228+
retry 120 ${mysql} -N -e "START group_replication;"
225229
fi
226230
touch /scripts/ready.txt
227231
}

0 commit comments

Comments
 (0)