day9-mysql叢集

來源:互聯網
上載者:User

標籤:

使用mysql-mmm和mysql主從同步部署mysql高可用叢集

  1. 配置主主結構

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;

?

  1. 配置一主多從結構

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;

?

  1. 在所有機器安裝mysql-mmm軟體

tar xf mysql-mmm-2.2.1.tar.gz

cd mysql-mmm-2.2.1

make install

?

  1. 配置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叢集

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.