github:
https://github.com/github/orchestrator/tree/master/docs
Orchestrator介绍
https://www.percona.com/blog/2016/03/08/orchestrator-mysql-replication-topology-manager/
mysql多实例
1、初始化mysql到新的数据目录
cd /usr/local/mysql-5.5.45;./scripts/mysql_install_db --user=mysql --datadir=/var/lib/mysql_3307
2、复制当前配置文件,修改下列参数
cp /etc/my.cnf /etc/my2.cnf
vim /etc/my2.cnf
[mysqld]
datadir=/var/lib/mysql_3307 //数据存放目录
3、复制/etc/init.d/mysqld
cp /etc/init.d/mysqld /etc/init.d/mysqld_3307
修改 /etc/init.d/mysqld_3307 中默认配置文件位置 Defaults_file="/etc/my2.cnf"
(1)mysql主从
主
grant replication slave on *.* to 'vera'@'192.168.3.146' identified by '123456';
show master status;
从
stop slave;
change master to master_host='192.168.3.87',master_port=3307,master_user='vera', master_password='123456', master_log_file='mysql-bin.000008', master_log_pos=107;
start slave;
show slave status\G;
change master to master_host='192.168.3.146',master_port=3307,master_user='vera', master_password='123456', master_log_file='mysql-bin.000010', master_log_pos=107;
注意开放防火墙,否则连接不到3306端口
-A INPUT -m state --state NEW -m tcp