MySQL Gtid master-slave replication (main library online, add new Concou)

Source: Internet
Author: User

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.