Difference between revisions of "Configuring the CTDB recovery lock"

From SambaWiki
(Created page with "= Goal = Configure CTDB to use a recovery lock to avoid a "split-brain" situation. = Prerequisites = * Setting up a cluster filesystem (by default - see below) = CTDB...")
 
(→‎CTDB configuration: Drop section for Samba <= 4.8 - no longer supported)
 
(4 intermediate revisions by 2 users not shown)
Line 9: Line 9:
 
= CTDB configuration =
 
= CTDB configuration =
   
The recovery lock, configured via <code>CTDB_RECOVERY_LOCK</code> 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 [http://ctdb.samba.org/manpages/ctdb.7.html ctdb(7)] for more details.
+
The recovery lock, configured via the <code>recovery lock</code> option in the <code>cluster</code> 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 [http://ctdb.samba.org/manpages/ctdb.7.html ctdb(7)] for more details.
   
 
For example:
 
For example:
   
  +
[cluster]
CTDB_RECOVERY_LOCK=/clusterfs/.ctdb/reclock
+
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 (or alternative operation) will output "0" (holding lock), the other nodes will output "1" (contended). See the RECOVERY LOCK section in [http://ctdb.samba.org/manpages/ctdb.7.html ctdb(7)] for more info about this mechanism. In the utils directory in the [https://github.com/samba-team/samba/tree/master/ctdb/utils Samba Github] repository additional examples can be found.

Latest revision as of 03:12, 27 September 2020

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 (or alternative operation) will output "0" (holding lock), the other nodes will output "1" (contended). 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.