Master-slave Hot Standby (automatic synchronization) configuration of MySQL in Linux

Source: Internet
Author: User
Individuals configured successfully on 5.5

 

Environment Description: MASTER: 192.168.1.200slave: 192.168.1.132

 

MySQL master configuration: Configure My. CNF:

 

# Vi/etc/My. CNF

 

[Mysqld] datadir =/var/lib/mysqlsocket =/var/lib/MySQL. sockuser = MySQL # disabling symbolic-links is recommended to prevent assorted security groups-links = 0server-id = 200log-bin = mysql-binrelay-log = relay-binrelay-log-Index = relay-bin- index

 

* After configuration, restart the MySQL Service of the master !!!

 

Service mysqld restart

 

// -------------------------------------------------- MySQL slave configuration: Configure My. CNF:

 

# Vi/etc/My. CNF

 

[Mysqld] datadir =/var/lib/mysqlsocket =/var/lib/MySQL. sockuser = MySQL # disabling symbolic-links is recommended to prevent assorted Security riskssymbolic-links = 0server-id = 132log-bin = mysql-binreplicate-do-DB = testlog-slave-Updates =

 

* After configuration, restart the MySQL service of slave !!!

 

Service mysqld restart

 

// -------------------------------------------------- Log on to the slave and run the following command:

 

Mysql> stop slave; mysql> change master to master_host = '2017. 168.1.200 ', master_user = 'root', master_password = '000000'; mysql> Start slave; mysql> show slave status \ G;

 

Check whether the two items are yes and yes is normal. Slave_io_running: yesslave_ SQL _running: Yes

 

 

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.