I have bootstrapped a node as the first node in a new galera cluster. then when I joined another node to it. the node joind as bootstrap but there are no grastat.dat file in that joind node because I made sure to delete that file so it can not join as bootstrap. here is the log on the joind node

Server version: 10.4.22-MariaDB-log MariaDB Server
2022-04-24  0:02:05 0 [Warning] WSREP: Could not open state file for reading: '/var/lib/mysql//grastate.dat'
2022-04-24  0:02:05 0 [Note] WSREP: Found saved state: 00000000-0000-0000-0000-000000000000:-1, safe_to_bootstrap: 1

my question is from where that node find that saved state in the logs that tells it that it is safe to bootstrap ?

and how to prevent the node from bootstrapping ever ?

  • crash recover is a good document. bootstrapping is a manual process so I'm not sure what preventions you intend to be there.
    – danblack
    Apr 28 at 2:03

1 Answer 1


The grastate.dat file is where the host finds the information about its current state. This includes the UUID, the seqno, and the safe to bootstrap parameter.

When the grastate.dat file does not exist in the data directory, then the host will bootstrap with the default state, which is safe_to_bootstrap = 1. You can see that in the Galera code here. That is also why you see the information that the UUID is 00000000-0000-0000-0000-000000000000 and the seqno is -1

After the host has joined into the cluster, you can check the grastate.dat file. It should now have a valid UUID, a seqno of -1 (which indicates that the host is working), and the safe to bootstrap parameter is set to 0.

As danblack already commented, bootstrapping is a manual process, to recover the cluster after a crash, so you cannot explicitly prevent that a node bootstraps. You can read more about the safe to bootstrap protection in these Galera docs. But to sum it up, Galera will only set safe_to_bootstrap to 1 when it can determine which host had the highest state before the shutdown. This is an info to you, that this is the host that you should bootstrap from and you will still need to manually intervene to repair the cluster.

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.