MySQL Forums
Forum List  »  Replication

Re: How server id is communicated?
Posted by: Rick James
Date: April 06, 2012 08:01PM

Each machine (Master(s) and Slave(s)) must have distinct values for server_id.

The Slave, when it connects to the Master, by whatever means, announces its (the Slave's) server_id.

The Master uses that to keep track of "where the replication stream left off".

Switches, hubs, internet backbone, etc, should not matter.

If you have two Slaves, each with the same server_id, but normally talking to different Masters -- ok, a misconfig could cause trouble. Fix it by making sure ALL machine have different ids. Any 32-bit number will do. A handy default (unless you have VMs) is to use inet_aton of the IPv4 address.

I don't know what it would take to change the server_id on a slave. A guess:
1. STOP SLAVE IO_THREAD; -- to freeze the info for step 2
2. SHOW SLAVE STATUS; -- get info for step 6
3. Stop the slave -- need to bounce it to get server_id to take effect
4. Change server_id in my.cnf (my.ini)
5. start the slave with --skip-slave-start -- don't want it to confuse the master (I guess)
6. CHANGE MASTER ...
7. SLAVE START;

Options: ReplyQuote


Subject
Views
Written By
Posted
2358
April 05, 2012 12:34PM
Re: How server id is communicated?
1419
April 06, 2012 08:01PM
971
April 10, 2012 06:34AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.