Redhat linux MySQL DRBD synchronization configuration

Source: Internet
Author: User

For the database, everyone should know its importance, the information in the database can not have any problems, such as e-commerce site Server backend, security products, data backstage, and so on.

Now I configure MySQL dual-machine synchronization, that is, when a master MySQL server changes data, after writing the data slave MySQL server will always synchronize, to ensure the same data, so that when a database is down, Use the shortest time to switch the database.


    1. First, install the MySQL service on both servers.

      Installation can be either compiled or installed, yum installed, or RPM installed

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6E/ED/wKiom1WLwzWjWm7CAAA2OBHBvbg476.jpg "title=" installation. png "alt=" Wkiom1wlwzwjwm7caaa2obhbvbg476.jpg "/>


2. Modify the MySQL configuration file for master server.

Where the server ID is a unique value, that is, master cannot be the same as slave

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/EE/wKiom1WLw5CAHewEAAAvyUMsAxQ738.jpg "style=" float: none; "title=" Change the configuration file. png "alt=" wkiom1wlw5caheweaaavyumsaxq738.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/EA/wKioL1WLxUzS4CIMAADSvYz9jjw696.jpg "style=" float: none; "title=" config file master.png "alt=" Wkiol1wlxuzs4cimaadsvyz9jjw696.jpg "/>


3. Start the service

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/EA/wKioL1WLxZPis1F5AAAt0zeue8c412.jpg "style=" float: none; "title=" boot. png "alt=" wkiol1wlxzpis1f5aaat0zeue8c412.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/EE/wKiom1WLw9fBTJaOAAArpBW2L8w423.jpg "style=" float: none; "Title=" starts the service. png "alt=" wkiom1wlw9fbtjaoaaarpbw2l8w423.jpg "/>


4. Create a user and query binary file.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/EA/wKioL1WLxeKTnfqwAAEbNU3MuVg473.jpg "title=" Create a synchronized user , view binaries. png "alt=" wkiol1wlxektnfqwaaebnu3muvg473.jpg "/>


Configuration of the 5.slave.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/EA/wKioL1WLxhigC2u9AACXSfuOr0k860.jpg "style=" float: none; "title=" 2 Change the configuration file. png "alt=" wkiol1wlxhigc2u9aacxsfuor0k860.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/EE/wKiom1WLxF3SByxBAACLN-89AeQ879.jpg "style=" float: none; "title=" slave operation. png "alt=" wkiom1wlxf3sbyxbaacln-89aeq879.jpg "/>


6. Configure as Slave mode

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/EE/wKiom1WLxKbh5zb8AABa913xWC0822.jpg "title=" 9.png " alt= "Wkiom1wlxkbh5zb8aaba913xwc0822.jpg"/>


7. Establish the DB1 library to see the effect.


Create the DB1 library in master and view

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/EA/wKioL1WLxoegOKhGAACmLdpq2hM625.jpg "style=" float: none; "title=" 10.png "alt=" Wkiol1wlxoegokhgaacmldpq2hm625.jpg "/>


View all libraries in slave

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/EE/wKiom1WLxMzi1EWlAABt-3hrG70019.jpg "style=" float: none; "title=" 11.png "alt=" Wkiom1wlxmzi1ewlaabt-3hrg70019.jpg "/>


Redhat linux MySQL DRBD synchronization configuration

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.