MySQL standby Creation (Master - Slave Replication). 2
Environment Details: 2
Configuration Steps on Master Node. 2
Step 1: Mandatory parameters (/etc/my.cnf). 2
Step 2: User Creation. 2
Step 3: Master Status. 3
Configuration Steps on Slave Node. 3
Step 4: Mandatory Parameters (/etc/my.cnf). 3
Step 5: Connection Testing (Slave to Master). 3
Step 6: Configuration of Slave process. 3
Step 7: Start Slave. 4
Step 8: Slave Status. 4
Step 9: Test the Replication. 6
Switchover (Slave to Master). 6
Master Node. 6
Slave Node. 6
Master Node Hostname
Slave Node Hostname
Below Listed parameters are mandatory for Master node. Make sure to set the unique server-id
Connect to Mysql and create dedicated user for replication. Grant the required privileges to connect from slave node.
Check the master status
Below Listed parameters are mandatory for Slave node. Make sure to set the unique server-id
Test the connection from slave node to Master node by using the below command.
This will configure slave and server will remember settings, so this replaces my.cnf settings in latest versions of MySQL server.
Note: Set the values appropriate with respect to the Master Node. Master_log_file and position values should be from master status on master node.
Start the slave process with the below command.
If you are receiving “ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository” error. please reset the slave and proceed with step 6.
Make sure to check the below parameter status should be "YES" and the remaining values are appropriate.
Perform the transactions on master node and slave node will automatically be in sync.
FLUSH LOGS closes and reopens all log files. If binary logging is enabled, the sequence number of the binary log file is incremented by one relative to the previous file.
Stop the slave process and reset the master. This will configure the master and it act according to my.cnf configuration settings.