premise: In two machines first confirm SELinux,iptables shut down, do a good yum source
First, build
Do the following on the 143:
Yum install-y MySQL Mysql-server
then modify /etc/my.cnf to add two lines in the mysqld module.
Log-bin=mysql-bin
Server-id = 1
then start the Msyql/etc/init.d/mysql start
Do the following on the 144:
Yum install–y MySQL Mysql-server
then modify the/etc/my.cnf to add in the mysqld module.
Server-id = 2
then restart Mysql/etc/init.d/mysql start
Ii. Delegation of authority
to operate on 143:
MySQL # into MySQL
Grant Replication Slave on * * [email protected] ' 192.168.223.144 ' identified by ' 123456 ';
to 144 server authorization, account number is Tongbu, password is 123456
Flush privileges; # Refresh Permissions
Show master status; # View synchronized filenames and points
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/9F/wKiom1XVLNnDqbDoAAD_CtO-JtE568.jpg "title=" 123. PNG "alt=" wkiom1xvlnndqbdoaad_cto-jte568.jpg "/>
to operate on 144:
MySQL # into MySQL
C hange Master to
Master_host= ' 192.168.223.143 ', master_user= ' Tongbu ', master_password= ' 123456 ', master_log_file= ' mysql-bin.000003 ' , master_log_pos=345;
Flush privileges; # Refresh Permissions
Slave start; # Open from
show slave status\g; Check the master and slave status, if you see the following two yes indicates that master and slave is OK
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/9C/wKioL1XVLx3i9ZcEAAMJYVYqzgY409.jpg "title=" 12.png "alt=" Wkiol1xvlx3i9zceaamjyvyqzgy409.jpg "/>
This article is from the "PC personal blog" blog, make sure to keep this source http://pc1990.blog.51cto.com/10541224/1686284
MySQL master-Slave Build-yum Chapter