diff --git a/docs/ansible/roles/mysql/index.md b/docs/ansible/roles/mysql/index.md index 24402d52cf949092bf51685b462205b467d01d3b..637f2b0b9e1a2a7a434f01e10f077a7444536bff 100644 --- a/docs/ansible/roles/mysql/index.md +++ b/docs/ansible/roles/mysql/index.md @@ -94,3 +94,18 @@ mysql < dbdump.db START REPLICA; SHOW REPLICA STATUS\G ``` + +## Resetting Replication + +Sometimes, e.g. when connection between hosts was interrupted for too long, then a reset is required. Here are the steps +on the replica host. + +```mysql +SHOW REPLICA STATUS\G +# Get the master log file and position. +STOP REPLICA; +RESET REPLICA; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='repl', MASTER_PASSWORD='repl', MASTER_LOG_FILE='mysql-bin.[FILEID]', MASTER_LOG_POS=[POSID]; +START REPLICA; +SHOW REPLICA STATUS\G +```