...
Code Block |
---|
GRANT REPLICATION SLAVE ON *.* TO 'replicator'@'SLAVE_IP' IDENTIFIED BY 'PASSWORD'; |
Configure DB replication on slave server
Create the replication configuration file in Maria DB slave server:
...
Code Block |
---|
mysql < dump.sql |
Once imported, tell configure Maria DB slave server to start replicating the from the status we got on previous step, using the user and pasword we created for replication. Execute the command below on slave server mysql prompt, replacing master settings as required from previous steps. Notice we set as MASTER_USER the user we grant permission with correspondent password, and also we are using as replication. Replace MASTER_HOST, MASTER_USER, MASTER_PASSWORD, MASTER_LOG_FILE and MASTER_LOG_POS the data we got previouslyaccordingly to previous steps in command below and execute it in slave server mysql prompt:
Code Block |
---|
CHANGE MASTER TO MASTER_HOST='MASTER_IP', MASTER_USER='replicator', MASTER_PASSWORD='PASSWORD', MASTER_PORT=3306, MASTER_LOG_FILE='localhost-bin.000002', MASTER_LOG_POS=3712878, MASTER_CONNECT_RETRY=10; |
Start slave replication from slave mysql prompt with the this command below:
Code Block |
---|
START SLAVE; |
You can check replication status by executing on the slave:
...