I have a MariaDB Galera cluster with two nodes. I have got it up and running fine, however the first node in the cluster needs to be started with: sudo service mysql start --wsrep-new-cluster

I am using Debian 7 and MariaDB will auto start, however this now fails because it's the first node in the cluster (and unless I tell it, it will look for the other nodes).

How can I make it auto start with the --wsrep-new-cluster option?


I've struggled with this on Debian 8 and have found that the init.d script ignores the --wsrep-new-cluster option.

I was able to start the first cluster node manually with /usr/bin/mysqld_safe --wsrep-new-cluster. The second can then be started with the normal init script `service mysql start'. Once a second node is up, the mysqld_safe process can be stopped and the first node can be started normally.

  • In a server I cannot upgrade this has saved me. – Carlos Ferreyra Sep 25 '17 at 14:56

I would say that you can't, since you have no idea which of the two nodes should be the master, i.e., the one you should bootstrap the cluster with.

My point is that if one node fails and that one reboots, the ordinary daemon start procedure should suffice -- you don't need the --wsrep-new-cluster option at this point, just getting the crashed node up and running is enough.

Now, imagine that both nodes have crashed. In order to salvage the cluster you should check the grastate.dat file for the one with the highest seqno and a uuid that is not all zeros (see https://stackoverflow.com/questions/23356623/mysql-galera-autostart-from-boot-wsrep-new-cluster). This is the one to bootstrap from.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.