1. 程式人生 > >mariadb galera啟動問題

mariadb galera啟動問題

ont man 意思 this more date edit 上啟 set

搭建了mariadb galera集群後,整個集群停掉後如何啟動呢,我們要先啟動那個節點呢,今天我嘗試把集群機器全部停掉,然後任意啟動一個節點,發現報如下的錯誤:

170620 21:32:55 [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 .

意思該節點不是最後一個離開集群的節點(最後停掉的節點),可能沒有包含所有更新的數據,強制從該節點啟動,需要手工編輯grastate.dat文件,設置safe_to_bootstrap=1,當然了,我們不需需要強制從該節點啟動,我們逐一排查每個節點下的grastate.dat文件(該文件在data目錄下),找到safe_to_bootstrap=1的節點,然後在該節點上啟動即可.

比如我這裏找到節點的是節點3
[root@hxl03 data]# more grastate.dat
# GALERA saved state
version: 2.1
uuid: 43caaa91-54bf-11e7-9321-c60bd8969b24

seqno: 2919
safe_to_bootstrap: 1

集群中第一臺mariadb啟動方法:

/etc/init.d/mysql start --wsrep-new-cluster

集群中其它數據啟動方法:

/etc/init.d/mysql start

mariadb galera啟動問題