Advanced CTDB configuration: Difference between revisions

From SambaWiki
(Created page with "= Introduction = This section describes advanced CTDB configuration topics that do not fit anywhere else. = CTDB port = CTDB uses Basic CTDB configuration#nodes file|priv...")
 
(Add section about event scripts)
Line 15: Line 15:


'''Note:''' All nodes in the cluster '''must''' use the same port.
'''Note:''' All nodes in the cluster '''must''' use the same port.

= Event scripts =

CTDB runs event scripts when certain events occur. These event scripts usually reside in the <code>events.d/</code> subdirectory of the [[Basic CTDB configuration#CTDB configuration directory|CTDB configuration directory]]. This is often <code>/etc/ctdb/events.d</code>.

The <code>CTDB_EVENT_SCRIPT_DIR</code> configuration variable can be set in the [[Basic CTDB configuration#ctdbd configuration file|ctdbd configuration file]] to change the location of CTDB's event scripts.

Event scripts support health monitoring, service management, IP failover, internal CTDB operations and features. They handle events such as <code>startup</code>, <code>shutdown</code>, <code>monitor</code>, <code>releaseip</code> and <code>takeip</code>.

Please see the event scripts that installed by CTDB for examples of how to configure other services to be aware of the HA features of CTDB.

Also see <code>ctdb/config/events.d/README</code> in the Samba source tree for additional documentation on how to write and modify event scripts.

Revision as of 05:32, 29 January 2017

Introduction

This section describes advanced CTDB configuration topics that do not fit anywhere else.

CTDB port

CTDB uses private IP addresses to communicate between nodes. Connections are made to IANA assigned TCP port 4379 on each node.


Although not recommended, it is possible to configure a different port to be used for CTDB traffic. This is done by adding a ctdb entry to the /etc/services file.

For example, add the following line to /etc/services to change CTDB to use port 9999:

 ctdb  9999/tcp

Note: All nodes in the cluster must use the same port.

Event scripts

CTDB runs event scripts when certain events occur. These event scripts usually reside in the events.d/ subdirectory of the CTDB configuration directory. This is often /etc/ctdb/events.d.

The CTDB_EVENT_SCRIPT_DIR configuration variable can be set in the ctdbd configuration file to change the location of CTDB's event scripts.

Event scripts support health monitoring, service management, IP failover, internal CTDB operations and features. They handle events such as startup, shutdown, monitor, releaseip and takeip.

Please see the event scripts that installed by CTDB for examples of how to configure other services to be aware of the HA features of CTDB.

Also see ctdb/config/events.d/README in the Samba source tree for additional documentation on how to write and modify event scripts.