1 <!--#set var="TITLE" value="Configuring CTDB" -->
2 <!--#include virtual="header.html" -->
4 <H2 align="center">Configuring CTDB</H2>
6 <h2>Clustering Model</h2>
8 The setup instructions on this page are modelled on setting up a cluster of N
9 nodes that function in nearly all respects as a single multi-homed node.
10 So the cluster will export N IP interfaces, each of which is equivalent
11 (same shares) and which offers coherent CIFS file access across all
14 The clustering model utilizes IP takeover techniques to ensure that
15 the full set of public IP addresses assigned to services on the
16 cluster will always be available to the clients even when some nodes
17 have failed and become unavailable.
19 <h2>CTDB Cluster Configuration</h2>
21 These are the primary configuration files for CTDB.<p>
23 When CTDB is installed, it will install template versions of these
24 files which you need to edit to suit your system. The current set of
25 config files for CTDB are also available from
26 <a href="http://samba.org/~tridge/ctdb/config">http://samba.org/~tridge/ctdb/config</a>
28 <h3>/etc/sysconfig/ctdb</h3>
30 This file contains the startup parameters for ctdb.<p>
32 When you installed ctdb, a template config file should have been
33 installed in /etc/sysconfig/ctdb.<p>
35 Edit this file, following the instructions in the template.<p>
37 The most important options are:
40 <li>CTDB_RECOVERY_LOCK
41 <li>CTDB_PUBLIC_ADDRESSES
44 Please verify these parameters carefully.
46 <h4>CTDB_RECOVERY_LOCK</h4>
48 This parameter specifies the lock file that the CTDB daemons use to arbitrate
49 which node is acting as a recovery master.<br>
51 This file MUST be held on shared storage so that all CTDB daemons in the cluster will access/lock the same file.<br><br>
53 You <strong>must</strong> specify this parameter.<br>
54 There is no default for this parameter.
58 This file needs to be created and should contain a list of the private
59 IP addresses that the CTDB daemons will use in your cluster. One IP
60 address for each node in the cluster.<p>
62 This should be a private non-routable subnet which is only used for
63 internal cluster traffic. This file must be the same on all nodes in
66 Make sure that these IP addresses are automatically started when the
67 cluster node boots and that each node can ping each other node.<p>
69 Example 4 node cluster:
71 CTDB_NODES=/etc/ctdb/nodes
73 Content of /etc/ctdb/nodes:
81 The default for this file is /etc/ctdb/nodes.
84 <h3>CTDB_PUBLIC_ADDRESSES</h3>
86 Each node in a CTDB cluster contains a list of public addresses which that
87 particular node can host.<p>
89 While running the CTDB cluster will assign each public address that exists in the entire cluster to one node that will host that public address.<p>
91 These are the addresses that the SMBD daemons and other services will
92 bind to and which clients will use to connect to the cluster.<p>
94 <h3>Example 4 node cluster:</h3>
96 CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
98 Content of /etc/ctdb/public_addresses:
106 These are the IP addresses that you should configure in DNS for the
107 name of the clustered samba server and are the addresses that CIFS
108 clients will connect to.<p>
110 Configure it as one DNS A record (==name) with multiple IP addresses
111 and let round-robin DNS distribute the clients across the nodes of the
114 The CTDB cluster utilizes IP takeover techniques to ensure that as long as at least one node in the cluster is available, all the public IP addresses will always be available to clients.<p>
116 This means that if one physical node fails, the public addresses that
117 node was serving will be taken over by a different node in the cluster. This
118 provides a guarantee that all ip addresses exposed to clients will
119 always be reachable by clients as long as at least one node still remains available in the cluster with the capability to host that public address (i.e. the public address exists in that nodes public_addresses file).
121 Do not assign these addresses to any of the interfaces on the
122 host. CTDB will add and remove these addresses automatically at
125 This parameter is used when CTDB operated in takeover ip mode.<p>
127 The usual location for this file is /etc/ctdb/public_addresses.<p><p>
130 By using different public_addresses files on different nodes it is possible to
131 partition the cluster into subsets of nodes.
134 Node 0 : /etc/ctdb/public_addresses
140 Node 1 : /etc/ctdb/public_addresses
146 Node 2 : /etc/ctdb/public_addresses
150 In this example we have three nodes but a total of 4 public addresses.<p>
152 10.1.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 are available. Only if both nodes 0 and 1 fails will this public address become unavailable to clients.<p>
154 All other public addresses can only be served by one single node respectively and will therefore only be avialable if the respective node is also available.
157 <h2>Event scripts</h2>
159 CTDB comes with a number of application specific event scripts that
160 are used to do service specific tasks when the cluster has been
161 reconfigured. These scripts are stored in /etc/ctdb/events.d/<p>
163 You do not need to modify these scripts if you just want to use
164 clustered Samba or NFS but they serve as examples in case you want to
165 add clustering support for other application servers we do not yet
166 proivide event scripts for.<p>
168 Please see the service scripts that installed by ctdb in
169 /etc/ctdb/events.d for examples of how to configure other services to
170 be aware of the HA features of CTDB.<p>
172 Also see /etc/ctdb/events.d/README for additional documentation on how to
173 create and manage event scripts.
175 <h2>TCP port to use for CTDB</h2>
177 CTDB defaults to use TCP port 4379 for its traffic.<p>
179 Configuring a different port to use for CTDB traffic is done by adding
180 a ctdb entry to the /etc/services file.<p>
182 Example: for change CTDB to use port 9999 add the following line to /etc/services
187 Note: all nodes in the cluster MUST use the same port or else CTDB
188 will not start correctly.
190 <h2>Name resolution</h2>
192 You need to setup some method for your Windows and NFS clients to find
193 the nodes of the cluster, and automatically balance the load between
196 We recommend that you use public ip addresses using
197 CTDB_PUBLIC_INTERFACE/CTDB_PUBLIC_ADDRESSES and that you setup a
198 round-robin DNS entry for your cluster, listing all the public IP
199 addresses that CTDB will be managing as a single DNS A record.<p>
201 You may also wish to setup a static WINS server entry listing all of
202 your cluster nodes IP addresses.
204 <!--#include virtual="footer.html" -->