标签:
使用mysql-mmm和mysql主从同步部署mysql高可用集群
A、B主机设置
mysql> grant replication slave on *.* to user@"%" identified by "1";
A主机
mysql> change master to master_host="192.168.100.101",master_user="user",master_password="1",master_log_file="master2.000001",master_log_pos=106;
mysql> slave start;
B主机
mysql> change master to master_host="192.168.100.100",master_user="user",master_password="1",master_log_file="master1.000001",master_log_pos=106;
mysql> slave start;
?
C主机
mysql> change master to master_host="192.168.100.101",master_user="user",master_password="1",master_log_file="master2.000001",master_log_pos=106;
D主机
mysql> change master to master_host="192.168.100.101",master_user="user",master_password="1",master_log_file="master2.000001",master_log_pos=106;
?
tar xf mysql-mmm-2.2.1.tar.gz
cd mysql-mmm-2.2.1
make install
?
mmm_common.conf——所有服务器都需配置,都一样
作用:指定集群中服务器的角色和使用的虚拟IP地址
?
数据库服务器都设置数据库授权
mysql> grant replication client on *.* to monitor@"%" identified by "monitor";
mysql> grant replication client,process,super on *.* to agent@"%" identified by "agent";
?
所有的数据库服务器都要配置
vim /etc/mysql-mmm/mmm_agent.conf????????
include mmm_common.conf????????//加载mmm_common.conf
this 主机名????????//指定自己的主机名
?
监控配置
标签:
原文地址:http://www.cnblogs.com/fina/p/5863246.html