12.4. CTDB Configuration
The CTDB configuration file is located at
/etc/sysconfig/ctdb. The mandatory fields that must be configured for CTDB operation are as follows:
CTDB_NODESCTDB_PUBLIC_ADDRESSESCTDB_RECOVERY_LOCKCTDB_MANAGES_SAMBA(must be enabled)CTDB_MANAGES_WINBIND(must be enabled if running on a member server)
The following example shows a configuration file with the mandatory fields for CTDB operation set with example parameters:
The meaning of these parameters is as follows.
CTDB_NODES- Specifies the location of the file which contains the cluster node list.The
/etc/ctdb/nodesfile thatCTDB_NODESreferences simply lists the IP addresses of the cluster nodes, as in the following example:192.168.1.151 192.168.1.152 192.168.1.153
192.168.1.151 192.168.1.152 192.168.1.153Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this example, there is only one interface/IP on each node that is used for both cluster/CTDB communication and serving clients. However, it is highly recommended that each cluster node have two network interfaces so that one set of interfaces can be dedicated to cluster/CTDB communication and another set of interfaces can be dedicated to public client access. Use the appropriate IP addresses of the cluster network here and make sure the hostnames/IP addresses used in thecluster.conffile are the same. Similarly, use the appropriate interfaces of the public network for client access in thepublic_addressesfile.It is critical that the/etc/ctdb/nodesfile is identical on all nodes because the ordering is important and CTDB will fail if it finds different information on different nodes. CTDB_PUBLIC_ADDRESSES- Specifies the location of the file that lists the IP addresses that can be used to access the Samba shares exported by this cluster. These are the IP addresses that you should configure in DNS for the name of the clustered Samba server and are the addresses that CIFS clients will connect to. Configure the name of the clustered Samba server as one DNS type A record with multiple IP addresses and let round-robin DNS distribute the clients across the nodes of the cluster.For this example, we have configured a round-robin DNS entry
csmb-serverwith all the addresses listed in the/etc/ctdb/public_addressesfile. DNS will distribute the clients that use this entry across the cluster in a round-robin fashion.The contents of the/etc/ctdb/public_addressesfile on each node are as follows:192.168.1.201/0 eth0 192.168.1.202/0 eth0 192.168.1.203/0 eth0
192.168.1.201/0 eth0 192.168.1.202/0 eth0 192.168.1.203/0 eth0Copy to Clipboard Copied! Toggle word wrap Toggle overflow This example uses three addresses that are currently unused on the network. In your own configuration, choose addresses that can be accessed by the intended clients.Alternately, this example shows the contents of the/etc/ctdb/public_addressesfiles in a cluster in which there are three nodes but a total of four public addresses. In this example, IP address 198.162.2.1 can be hosted by either node 0 or node 1 and will be available to clients as long as at least one of these nodes is available. Only if both nodes 0 and 1 fail does this public address become unavailable to clients. All other public addresses can only be served by one single node respectively and will therefore only be available if the respective node is also available.The/etc/ctdb/public_addressesfile on node 0 includes the following contents:198.162.1.1/24 eth0 198.162.2.1/24 eth1
198.162.1.1/24 eth0 198.162.2.1/24 eth1Copy to Clipboard Copied! Toggle word wrap Toggle overflow The/etc/ctdb/public_addressesfile on node 1 includes the following contents:198.162.2.1/24 eth1 198.162.3.1/24 eth2
198.162.2.1/24 eth1 198.162.3.1/24 eth2Copy to Clipboard Copied! Toggle word wrap Toggle overflow The/etc/ctdb/public_addressesfile on node 2 includes the following contents:198.162.3.2/24 eth2
198.162.3.2/24 eth2Copy to Clipboard Copied! Toggle word wrap Toggle overflow CTDB_RECOVERY_LOCK- Specifies a lock file that CTDB uses internally for recovery. This file must reside on shared storage such that all the cluster nodes have access to it. The example in this section uses the GFS2 file system that will be mounted at
/mnt/ctdbon all nodes. This is different from the GFS2 file system that will host the Samba share that will be exported. This recovery lock file is used to prevent split-brain scenarios. With newer versions of CTDB (1.0.112 and later), specifying this file is optional as long as it is substituted with another split-brain prevention mechanism. CTDB_MANAGES_SAMBA- When enabling by setting it to
yes, specifies that CTDB is allowed to start and stop the Samba service as it deems necessary to provide service migration/failover.WhenCTDB_MANAGES_SAMBAis enabled, you should disable automaticinitstartup of thesmbandnmbdaemons by executing the following commands:chkconfig snb off chkconfig nmb off
[root@clusmb-01 ~]# chkconfig snb off [root@clusmb-01 ~]# chkconfig nmb offCopy to Clipboard Copied! Toggle word wrap Toggle overflow CTDB_MANAGES_WINBIND- When enabling by setting it to
yes, specifies that CTDB is allowed to start and stop thewinbinddaemon as required. This should be enabled when you are using CTDB in a Windows domain or in active directory security mode.WhenCTDB_MANAGES_WINBINDis enabled, you should disable automaticinitstartup of thewinbinddaemon by executing the following command:chkconfig windinbd off
[root@clusmb-01 ~]# chkconfig windinbd offCopy to Clipboard Copied! Toggle word wrap Toggle overflow