User Tools

Site Tools


mysql:changemasters

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mysql:changemasters [2015/06/24 18:59] rlunaromysql:changemasters [2022/12/02 22:02] (current) – external edit 127.0.0.1
Line 111: Line 111:
 grant replication slave, replication client on *.* to YOUR-REPLICATION-USERNAME identified by 'YOUR-REPLICATION-PASSWORD'; grant replication slave, replication client on *.* to YOUR-REPLICATION-USERNAME identified by 'YOUR-REPLICATION-PASSWORD';
 </code> </code>
 +
 +==== Check master status an take note of the master log file and master log position ====
 +
 +We have to issue a ''show master status'' command to get the file and log position of our new master: 
 +
 +<code>
 +mysql> show master status\G
 +*************************** 1. row ***************************
 +             File: YOUR-MASTER-LOG-FILE
 +         Position: YOUR-MASTER-LOG-POS
 +     Binlog_Do_DB:
 + Binlog_Ignore_DB:
 +Executed_Gtid_Set:
 +1 row in set (0.00 sec)
 +</code>
 +
 +With this two values, YOUR-MASTER-LOG-FILE and YOUR-MASTER-LOG-POS, we can move to the 
 +slave and issue a change master to command.
  
 ==== Issue a change master command ==== ==== Issue a change master command ====
Line 122: Line 140:
 master_port=3306, master_port=3306,
 master_user='YOUR-REPLICATION-USERNAME', master_user='YOUR-REPLICATION-USERNAME',
-master_password='YOUR-REPLICATION-PASSWORD';+master_password='YOUR-REPLICATION-PASSWORD'
 +master_log_file = 'YOUR-MASTER-LOG-FILE', 
 +master_log_pos = YOUR-MASTER-LOG-POSITION; 
 + 
 +start slave;
 </code> </code>
  
 And I've stopped and started the slave.  And I've stopped and started the slave. 
 +
 +===== Final check =====
 +
 +You can double check that your slave is working with the new configuration just by the method of looking 
 +one change made in the new master. 
  
  
mysql/changemasters.1435165167.txt.gz · Last modified: 2022/12/02 22:02 (external edit)