Configuring the CTDB recovery lock

From SambaWiki
Revision as of 08:40, 28 November 2018 by Sspetebr (talk | contribs) (Add the idea to use custom binary for file locking, if clustered filesystem would not support it.)

Goal

Configure CTDB to use a recovery lock to avoid a "split-brain" situation.

Prerequisites

CTDB configuration

The recovery lock, configured via the recovery lock option in the cluster section, provides important split-brain prevention and is usually configured to point to a lock file in the cluster filesystem. See the RECOVERY LOCK section in ctdb(7) for more details.

For example:

 [cluster]
   recovery lock = /clusterfs/.ctdb/reclock

If the clustered filesystem does not support locking on default, CTDB allows to replace this mechanism with a binary that would interact with the clustered filesystem directly. This binary will be launched on each node and the node that can lock the file will output "0", the other nodes will output "1". See the RECOVERY LOCK section in ctdb(7) for more info about this mechanism. In the utils directory in the Samba Github repository additional examples can be found.

Samba ≤ 4.8

The equivalent ctdbd.conf option is CTDB_RECOVERY_LOCK. For example:

 CTDB_RECOVERY_LOCK=/clusterfs/.ctdb/reclock