534 Part V . Advanced Performance Note Be sure to use a different value for each server-id. The value for every host s server-id must be unique! Multiple master replication To achieve additional peace of mind that comes from redundancy, you can configure multiple masters in a single replication set. In the background, you are really still using one master but enabling the logging of updates on one or more slaves. Should the master server fail, any of the slave(s) can act as master. To enable multiple masters in a replication set, edit the MySQL configuration file on one of the slave servers. Add the following lines to the [mysqld]section: log-bin log-slave-updates The previous lines should be in addition to the others for slave replication, including (but not necessarily limiting yourselfto) these settings: master-host= master-user= master-password=
server-id= Stop and restart the MySQL server on the slave. It should remember its position within the slave replication and also add the files you specified so it can act as a master (including the binary update log and the index log). Also, add users and privileges for the replication user on the candidate master server. For example, I m going to grant access for a user named replicate with a password of fgbpr2 to access from 192.168.1.1. GRANT FILE ON *.* TO replicate@192.168.1.1 IDENTIFIED BY fgbpr2 ; The current status of replication on the slave 192.168.1.1is shown in Figure 18-7. Note that it is using master 192.168.1.71. Assume that, for whatever reason, I have to change the master server to the candidate master. I simply issue the following statement on the slave: CHANGE MASTER TO MASTER_HOST= 192.168.1.136 ; Alter the host from 192.168.1.136for your implementation. It is important to note that when you change master servers, you may need to issue privileges so that the slave server has permission to connect to the new master. Also, you may need to make firewall or other connectivity changes to reflect the new replication master.
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.
This entry was posted
on Wednesday, May 28th, 2008 at 9:18 pm and is filed under Domain.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.