標籤:
使用mysql-mmm和mysql主從同步部署mysql高可用叢集
- 配置主主結構
A、B主機設定
mysql> grant replication slave on *.* to [email protected]"%" 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;
?
- 在所有機器安裝mysql-mmm軟體
tar xf mysql-mmm-2.2.1.tar.gz
cd mysql-mmm-2.2.1
make install
?
- 配置mysql-mmm實現mysql高可用叢集
mmm_common.conf——所有伺服器都需配置,都一樣
作用:指定叢集中伺服器的角色和使用的虛擬IP地址
?
資料庫伺服器都設定資料庫授權
mysql> grant replication client on *.* to [email protected]"%" identified by "monitor";
mysql> grant replication client,process,super on *.* to [email protected]"%" identified by "agent";
?
所有的資料庫伺服器都要配置
vim /etc/mysql-mmm/mmm_agent.conf????????
include mmm_common.conf????????//載入mmm_common.conf
this 主機名稱????????//指定自己的主機名稱
?
監控配置
day9-mysql叢集