MySQL bidirectional replication Technology detailed

Source: Internet
Author: User
Tags mysql version

Set MySQL data synchronization (one-way & bidirectional) as a result of the company's business needs, Netcom and telecom data synchronization, to do a two-way synchronization of MySQL, write down the process, later used to turn it out, also posted for your reference.

First, prepare the server

Because the Binlog format of the (binary log) between different versions of MySQL may vary, the best combination is the same or lower version of Master's MySQL version and Slave, and master's version must not be higher than the slave version.

More.. | Less.. | In this article, we assume that the primary server (hereafter, master) and the version from the server (hereinafter referred to as slave) are 5.0.27, and the operating system is Redhat Linux 9.

Suppose the host name for Sync Master is: A (ip:192.168.0.1), slave host name is: B (ip:192.168.0.2), and all 2 MySQL basedir directories are/usr/local/mysql,datadir:/ Var/lib/mysql.

Second, set up synchronization server

1. Set Sync Master

Modify the My.cnf file to

# Replication Master Server (default)

# binary logging is required for replication

Add the following:

log-bin=/var/log/mysql/updatelog

server-id = 1

binlog-do-db=test

binlog-ignore-db=mysql

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.