Requirements:
1, the main library on-line, the main library does not stop the service under the premise of the Master from replication
2. Add a new Bundle library
Operation:
1, export the data in the main library (the main library is running normally);
2. Upload the SQL file of the main library to Concou;
3, Concou Recovery database;
4, on the primary server, create a copy account, assign permissions
Mysql > GRANT REPLICATION SLAVE on * * to ' repluser ' @ ' 3.9.8.% ' identified by ' replpass ';
Mysql > Flush Privileges;
5, configure the firewall from the server, allow the firewall through the 3306 port
# Vim/etc/sysconfig/iptables
Add to
-A input-m state–state new-m tcp-p tcp–dport 3306-j ACCEPT (Allow 3306 ports through the firewall)
Restart the Firewall service to make it effective
#service iptables Restart
6, Concou Modify the configuration file
# VIM/ETC/MY.CNF
Add to
7. Log in and copy from the server using the account password created on master MySQL
mysql> Change Master to master_host= ' 3.9.8.13 ', master_user= ' repluser ', master_password= ' Replpass ', master_auto_ Position=1;
8, Concou start master-slave replication (may be error, refer to 10. Problem set 1))
mysql> start slave;
9, the detection of master-slave replication
Mysql> Show Slave Status\g
10. Problem Set
1) Start master-slave copy, error 1872:slave failed to initialize relay log info structure from the repository.
mysql> Reset Slave;
mysql> Change Master to master_host= ' 3.9.8.13 ', master_user= ' repluser ', master_password= ' Replpass ', master_auto_ Position=1;
mysql> start slave;
MySQL Gtid master-slave replication (main library online, add new Concou)