Mysql Semi-synchronous replication

Source: Internet
Author: User

Mysql Semi-synchronous replication

background:

The reason to learn the semi-synchronous replication of MySQL is to solve the master-slave replication, master-slave inconsistency too much, the gap is too large, a master server can have multiple from the server, when the primary server down or failure requires a synchronization of the best from the server to replace the work, The slave server with semi-synchronous replication is undoubtedly the best choice.

Introduction:

Semi-synchronous replication 7 The following version is not supported, there is no plug-in function, here with Centos7.3 to do this experiment, 7 in the/usr/lib64/mysql/plugin/directory has two IO files: semisync_ Master.so and semisync_slave.so; one is the primary node installation use, and one is used from the node installation.

steps to use:

Step 1, realize the master-slave replication of the two hosts, the configuration file is/etc/my.cnf.d/server.cnf

1) master server operation

650) this.width=650; "src=" Https://s5.51cto.com/oss/201711/14/555b3fbfbed9c8873439c9a9f85f5140.png "style=" float: none; "title=" 1.png "alt=" 555b3fbfbed9c8873439c9a9f85f5140.png "/>

650) this.width=650; "src=" Https://s4.51cto.com/oss/201711/14/1c0d7dcf69b087ab9c01d7c134d87fb2.png "title=" 2.png " alt= "1c0d7dcf69b087ab9c01d7c134d87fb2.png"/>

2) operation from server

650) this.width=650; "src=" Https://s5.51cto.com/oss/201711/14/a5576cdfc15f3dc889abf10273a487cf.png "style=" float: none; "title=" 3.png "alt=" A5576cdfc15f3dc889abf10273a487cf.png "/>

650) this.width=650; "src=" Https://s5.51cto.com/oss/201711/14/ec1022186451bcce8c0125846dc9aaf0.png "style=" float: none; "title=" 4.png "alt=" Ec1022186451bcce8c0125846dc9aaf0.png "/>


Step 2, install the plug-in on the master node

Command format (operation in database):

mysql> INSTALL PLUGIN rpl_semi_sync_master SONAME ' semisync_master.so ';

650) this.width=650; "src=" Https://s4.51cto.com/oss/201711/14/f4be4952f5d12b585af482caa9bf15d4.png "title=" 5.png " alt= "F4be4952f5d12b585af482caa9bf15d4.png"/>

Step 3, install the plug-in from the node

Commands (operating in MySQL):

INSTALL PLUGIN rpl_semi_sync_slave SONAME ' semisync_slave.so ';

650) this.width=650; "src=" Https://s4.51cto.com/oss/201711/14/a0325ddc5ec33057ca83b7426b9fa943.png "title=" 6.png " alt= "A0325ddc5ec33057ca83b7426b9fa943.png"/>


650) this.width=650; "src=" Https://s2.51cto.com/oss/201711/14/68724ba6bf6327e792eb8379a23feff5.png "title=" 7.png " alt= "68724ba6bf6327e792eb8379a23feff5.png"/>


Mysql Semi-synchronous replication

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.