标签:分享图片 master host 2.3 str 系统版本 keepalive slave pre
主机名
|
系统版本
|
MySQL版本
|
主机IP
|
Master01
|
CentOS 6.8
|
MySQL 5.6
|
172.24.8.10
|
Master02
|
CentOS 6.8
|
MySQL 5.6
|
172.24.8.11
|
VIP
|
172.24.8.12
|
||
Slave01
|
CentOS 6.8
|
MySQL 5.6
|
172.24.8.12
|
Slave02
|
CentOS 6.8
|
MySQL 5.6
|
172.24.8.13
|
1 [root@Master01 ~]# scp /etc/my.cnf root@172.24.8.12:/etc/ 2 [root@Master01 ~]# scp /etc/my.cnf root@172.24.8.13:/etc/ 3 [root@Slave01 ~]# vi /etc/my.cnf 4 [mysqld] 5 …… 6 server-id=3 #设置主服务器Slave01的id 7 [root@Slave02 ~]# vi /etc/my.cnf 8 [mysqld] 9 …… 10 server-id=4 #设置主服务器Slave02的id
1 [root@Slave01 ~]# service mysqld start 2 [root@Slave01 ~]# mysql -uroot -px120952576 3 mysql> grant replication slave on *.* to ‘repl_user‘@‘172.24.8.%‘ identified by ‘x12345678‘; #创建用于复制的账号 4 mysql> grant all privileges on *.* to ‘root‘@‘172.24.8.%‘ identified by ‘x120952576‘ with grant option; 5 mysql> flush privileges;
1 [root@Slave01 ~]# service mysqld restart 2 [root@Slave01 ~]# mysql -uroot -px120952576 3 mysql> change master to master_host=‘172.24.8.10‘, 4 -> master_user=‘repl_user‘, 5 -> master_password=‘x12345678‘, 6 -> master_log_file=‘mysql-bin.000001‘, 7 -> master_log_pos=120; 8 mysql> start slave; 9 mysql> show slave status\G
标签:分享图片 master host 2.3 str 系统版本 keepalive slave pre
原文地址:https://www.cnblogs.com/drizzle-xu/p/10276278.html