MySQL Dual master fault resolution example.

Source: Internet
Author: User

According to the error, the obtained main library file format is wrong.

First, lock the master-slave Normal Library

Mysql> flush tables with read lock; Lock table

Unlock tables; Unlock

SHOW MASTER STATUS;

Main MySQL add user to connect from server: GRANT REPLICATION SLAVE on * * to ' rep ' @ '% ' identified by ' logzgh ';

Second, close the master-slave from the library: slave stop;

mysql> change MASTER to master_host= ' qa-sandbox-1′, IP Address

Master_user= ' rep ', user name
Master_password= ' Logzgh ', password
Master_log_file= ' mysql-bin.000007′, location name

master_log_pos=471632;Offset Amount

Re-open slave from library: slave start;

Unlock Main library: Unlock tables; Unlock

show slave status\g;

SHOW MASTER STATUS;

The following six items need to be set on slave: replicate_do_db: Set the database to be replicated, multiple DB separated by commas replicate_ignore_db: Set the database that can be ignored. Replicate_do_table: Set the tablereplicate_ignore_table to be copied: Set the Table that can be ignoredreplicate_wild_do_table: Functions with replicate_do_table, but can be set with wildcard characters. Replicate_wild_ignore_table: function with replicate_do_table, function with replicate_ignore_table, can carry wildcard characters. The advantage is that the replication filtering mechanism is set at the slave end, which guarantees that there will be no inconsistency or replication error between the slave and master data due to the default database problem. The disadvantage is that the performance is worse than the master side. The reason: whether or not you need to replicate, Events are read by the IO thread to the slave side, which not only increases the amount of network Io, but also increases the write volume of relay log for the IO thread on the slave side.

MySQL Dual master fault resolution example.

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.