MySQL Master master/slave + original MySQL master architecture

Source: Internet
Author: User
Tags db2 mysql backup

pick up http://wsw26.blog.51cto.com/1442148/1749125 I've done this a has to add a D virtual machine on the main architecture of BC (the same environment), my purpose is D and a master master, BC continue to do a from, This is both D<-->A-->BC (cascade-like)


650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M02/7E/6E/wKiom1b-vunTUbfJAAAQQD0Y3M4340.jpg "title=" figure. jpg " alt= "Wkiom1b-vuntubfjaaaqqd0y3m4340.jpg"/>

preparatory work:
(1) The IP of D is 192.168.0.190,a IP is 192.168.0.8,b IP is 192.168.0.140,c IP is 192.168.0.141
(2) The MySQL backup of A's SQL through the SCP to D there and then from D there to create a corresponding database name after importing the SQL library just passed through the SCP, BC two from the library basically do not have to move it

first, in the D and a my.cnf do the following configuration (red circle of the representative is to configure the correct)

650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M01/7E/6A/wKioL1b-wBjjYQ7zAAIjy5k3ylc233.jpg "title=" d1.jpg "alt=" Wkiol1b-wbjjyq7zaaijy5k3ylc233.jpg "/>



650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/7E/6E/wKiom1b-vy_g7aaIAAHGO7-MD_g313.jpg "style=" float: none; "title=" a1.jpg "alt=" wkiom1b-vy_g7aaiaahgo7-md_g313.jpg "/>650" this.width=650; "src=" http://s2.51cto.com/ Wyfs02/m02/7e/6e/wkiom1b-v4odyyooaahgo7-md_g283.jpg "title=" a1.jpg "alt=" wkiom1b-v4odyyooaahgo7-md_g283.jpg "/ >

Read-only = 0/1 0: Allows the subordinate server to execute the SQL command independently (default setting); 1: The secondary server can only execute SQL commands from the master server.


Configure the value of the Auto-increment-increment&auto-increment-offset


values for Sync_binlog:
http://blog.csdn.net/wulantian/article/details/9965905,http://my.oschina.net/erichd/blog/499606?p=1

second, in the MySQL of D and a will be synchronized with the Library lock table: Flush tables With read lock, after the show Master Status\g, check the master information, and then perform change master to The Master command comes from, and only D and a are executed first:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/7E/6E/wKiom1b-v6WxKitXAADX-4OF7Wk031.jpg "style=" float: none; "title=" d3.jpg "alt=" Wkiom1b-v6wxkitxaadx-4of7wk031.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/7E/6E/wKiom1b-v6bBe_SUAADxob7fA0g245.jpg "style=" float: none; "title=" a2.jpg "alt=" Wkiom1b-v6bbe_suaadxob7fa0g245.jpg "/>


if show slave status\g, prompt for error, each stop slave;reset slave first, and then do the following:
d:mysql> Grant Replication Slave on * * to ' repl ' @ ' 192.168.0.8 ' identified by ' 123456 ';
A:mysql> Grant Replication Slave on * * to ' repl ' @ ' 192.168.0.190 ' identified by ' 123456 ';
D:mysql>flush tables with read lock;
A:mysql>flush tables with read lock;
d:mysql> Change Master to master_host= ' 192.168.0.8 ', master_user= ' repl ', master_password= ' 123456 ', Master_log_ File= ' mysql-bin.000010 ', master_log_pos=357;
a:mysql> Change Master to master_host= ' 192.168.0.190 ', master_user= ' repl ', master_password= ' 123456 ', master_  Log_file= ' mysql-bin.000013 ', master_log_pos=440;
respectively flush Privileges;start slave;unlock tables;show slave status\g;

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M01/7E/6A/wKioL1b-wKGiLf0PAADq7TM3Y6Q006.jpg "style=" float: none; "title=" a.jpg "alt=" Wkiol1b-wkgilf0paadq7tm3y6q006.jpg "/>

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M02/7E/6E/wKiom1b-wDaBZzM7AAEns7DwDFM587.jpg "title=" d2.jpg "alt=" Wkiom1b-wdabzzm7aaens7dwdfm587.jpg "/>


Three, you can test, D and a respectively to the DB2 library operation, use DB2 (my MySQL library back up the library file name) to delete the library inside the table can be deleted successfully (can synchronize the data, Mysql_binlog will change)


650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M02/7E/6A/wKioL1b-wRygXQSzAABarfep4Yg861.jpg "style=" float: none; "title=" a3.jpg "alt=" Wkiol1b-wrygxqszaabarfep4yg861.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/7E/6E/wKiom1b-wJ_SmEVXAABbI-w6lZo680.jpg "title=" d4.jpg "alt=" Wkiom1b-wj_smevxaabbi-w6lzo680.jpg "/>

650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M01/7E/6A/wKioL1b-wVOzt21iAABvFnsg1RE236.jpg "title=" b1.jpg "alt=" Wkiol1b-wvozt21iaabvfnsg1re236.jpg "/>

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M00/7E/6A/wKioL1b-wV7hzkDFAABf0tlez_8905.jpg "title=" c1.jpg "alt=" Wkiol1b-wv7hzkdfaabf0tlez_8905.jpg "/>


This will basically be done, data synchronization, master (DA) Interoperability +mysql A primary two from (A,BC) architecture

This article is from the "Steven Never give Up" blog, please be sure to keep this source http://wsw26.blog.51cto.com/1442148/1759460

MySQL Master master/slave + original MySQL master architecture

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.