How to start the first node of the mariadb galera Cluster
After setting up the mariadb galera cluster, how can I start the whole cluster after it is stopped? Which node should we start first? Today I try to stop all the cluster machines and then start a node at will, the following error is reported:
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.
This node is not the last node that leaves the cluster (the node that stops at last) and may not contain all updated data. It is forced to start from the node and needs to be edited manually. in the dat file, set safe_to_bootstrap = 1. Of course, we do not need to force the node to start. We will troubleshoot the grastate under each node one by one. dat file (the file is in the data directory), find the node safe_to_bootstrap = 1, and then start it on the node.
For example, node 3 is found here.
[Root @ hxl03 data] # more grastate. dat
# GALERA saved state
Version: 2.1
Uuid: 43caaa91-54bf-11e7-9321-c60bd8969b24
Seqno: 2919
Safe_to_bootstrap: 1
Start the node first, and then start other nodes one by one.
[Root @ hxl03 bin] #./mysqld_safe -- defaults-file =/opt/mariadb-galera/mariadb-galera-10031/conf/my. cnf -- wsrep-new-cluster -- user = maria &
-- The End --