MariaDB Galera Cluster set up problems

本小妞迷上赌 提交于 2019-12-05 15:14:00

The cluster must start by this command on primary node:

galera_new_cluster

after starting first node you can start other nodes in cluster successfully.

I believe you need to list all the IPs in the wsrep_cluster_address parameter.

wsrep_cluster_address=gcomm://192.168.211.132,192.168.211.133

This should be done on both hosts. BTW you likely want three nodes not two as to avoid split brain scenarios.

Here is how I fixed my similar issue.

CentOS 7 w/ MariaDB Galera 10.1.

Node2 I saw this:

016-12-27 15:40:38 140703512762624 [Warning] WSREP: no nodes coming from prim view, prim not possible

After doing some reading, I tried running this on node1.

service mysql start --wsrep-new-cluster

But this failed, and in the logs, I found this...

2016-12-27 15:44:08 140438853814528 [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 .

So I edited the file /var/lib/mysql/grastate.dat, changing safe_to_bootstrap to 1.

I was then able to start the Primary node using:

service mysql start --wsrep-new-cluster

Then on the others, I just used

service mysql start

Note: This was in a demo pre-production environment. I promptly broke it after getting everything to work by rebooting all servers at the same time :P, but I knew there were no writes, and that the DB's were in sync. If you are in produciton and this happens, you can use the following to figure out which node to run "new-cluster" on, which is akin to saying, make me primary.

mysqld_safe --wsrep-recover

If this is a production issue, I highly reccomend reading this article and making a backup w/ CloneZilla before throwing commands at the broken clients!

https://www.percona.com/blog/2014/09/01/galera-replication-how-to-recover-a-pxc-cluster/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!