Follow us on Social Media:

MySQL Database Administrator

Boost Your Quick Knowledge in MySQL DBA Work, Concepts, Tips and Trick

Friday, 2 February 2018

How to Configure Master-Slave Replication without Any Downtime

Configure master-Slave Replication without Any Downtime/between Production Server

We can configure replication Master-slave in production .No need to stop MySQL service in Master Server during production. Kindly follow the below Steps.

First of all you can achieve this task only when mysql-bin.log is already enabled on Master server.

  • Configure all required replication parameter on slave server.
  • Install fresh MySQL Data Directory on Slave Server.
  • Normally Start MySQL service on Slave Server.
  • On slave server, using mysqldump and take complete backup and restore on slave server in single instance.refer below command... 
mysqldump.exe --single-transaction  --host=[MasterIP] --port=3306  -u root --password=pwd --all-database --master-data=1 | mysql.exe --host=[SlaveIP] --port=3308 -u root --password=pwd

  • After complete above restoration , now your master data has been cloned to Slave.
  • Now run replication configurations command on slave server.

Troubleshooting>> Once you run Show slave status \G; , then you may get some error like (Duplicate entry, data already exist,etc) so you can normally ignore this error/ resolve this issue.

Note:- Before start this configuration on production Server , please test on your testing server first.

For any Clarification, you can ask me on Click Here

No comments:

Please Like and Subscribe us ....

Please visit the website on daily basis , Your New articles will publish at any moment. Please Subscribe us for getting Latest Updates...