Mariadb Cluster修復 / 強迫特定節點開始新叢集

【前言】

架設成為Cluster Mariadb的架構下,經常會因為不明原因而停止Cluster(例如網路  中斷,傳輸品質不佳等等)

 

 

 

 

 

 

0、先停掉三台Mariadb

1、更新/etc/my.cnf.d/server.cnf

原本的設定檔案被改為server.cnf.rpmsave,因此再次改名為server.cnf

2、galera_new_cluster

[ERROR] WSREP: It may not be safe to bootstrap the cluster from this node. It was not the last one to leave the cluster and may not contain all the updates. To force cluster bootstrap with this node, edit the grastate.dat file manually and set safe_to_bootstrap to 1 .

vi /var/lib/mysql/grastate.dat

已正常啟動

 

3、啟動172.18.50.235 與  172.18.50.236 節點

啟動前直接

rm -rf /var/lib/mysql/*

觀察重點: 是否有在群組內

如果最後狀態是這樣,表示要再重啟一次