1. Install MySQL on the server hosting the main library manager (192.168.1.101) and from the dependent library (192.168.1.103).
2. Perform the following configuration in the wizard:
Server-ID = 1 # идентификатор узла, убедитесь, что уникальный
# log config
log-bin = mysql-bin #open mysql
log-bin-index = mysql-bin.index
3. Create an account and grant permissions
create user repl IDENTIFIED BY 'yourpassword';
grant replication slave on *.* to 'repl'@'192.168.1.103' identified by 'yourpassword';
FLUSH PRIVILEGES;
4. Reload the database and execute the main view state; As follows
5. Perform the following configuration and restart from the library
server-id = 2
relay-log-index=slave-relay-bin.index
relay-log=slave-relay-bin
6. Install the library
CHANGE MASTER TO MASTER_HOST = '192.168.1.101', MASTER_USER = 'repl', MASTER_PASSWORD = 'yourpassword', MASTER_PORT = 3306, MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=569, MASTER_RETRY_COUNT = 60, MASTER_HEARTBEAT_PERIOD = 10000;
7. Begin the process of submission, and start the slaves.
8. Check whether the master library file and position match the slave library, and then prove that the master and slave are synchronized