Skip to content

Commit b39dd10

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

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

0 commit comments

Comments
 (0)