Restarting MYSQL Instances and Servers
Environment:-
MySQL Database Instances running in two separate Windows Servers namely PROD (172.21.50.162) and DR (10.218.86.8). They have been setup as Source (PROD) and Replica (DR) using the MySQL native replication configuration which are in-sync.
Restarting the MYSQL Databases (DR Server).
- Login to the DR (10.218.86.8) environment.
- Start the MYSQL workbench
- Connect to the server using the root user and password.
- In the SQL Tab run the following command:-
Use this command to check the status of the slave server at the moment and verify the following screenshots having the same value.
- Show slave status;
Using the following command you will stop the replication of the database which will act as a pre-req.
- stop slave;
Enter the shutdown command to stop the MYSQL services.
- Shutdown
Once the command is completed successfully verify the services are stopped from ‘services.msc’
Also please confirm that ‘Startup Type’ is set to manual.
- Now restart the Windows server for security updates.
Note:-
Do NOT start the DR MYSQL services at this stage.
Restarting the MYSQL Databases (Production Server).
- Login to the Production (172.21.50.162) environment.
- Start the MYSQL workbench
- Connect to the server using the root user and password.
- In the SQL Tab run the following commands:-
Use this command to check the status of the master server at the moment and also please note down the master status within a notepad.
- Show master status;
Enter the shutdown command to stop the MYSQL services.
- Shutdown
Once the command get’s completed successfully verify the services are stopped from ‘services.msc’
Also please confirm that ‘Startup Type’ is set to manual.
- Now restart the Windows server for security updates.
- Start the MYSQL services using ‘services.msc’.
- Once started take again the master status using the following command and note down the output again.
- Show master status.
Starting the DR server services back online.
- Login to the DR (10.218.86.8) environment.
- Navigate to ‘services.msc’ and start the slave database manually.
- Start the MYSQL workbench
- Connect to the server using the root user and password.
- In the SQL Tab run the following command:-
Use this command to check the status of the slave server at the moment and verify the following screenshots having the same value.
- Show slave status;