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 This file specifies a list of public ip addresses which the cluster will
87 serve. This file must be the same on all nodes.<p>
90 These are the addresses that the SMBD daemons and other services will
91 bind to and which clients will use to connect to the cluster. This
92 file must contain one address for each node, i.e. it must have the
93 same number of entries as the nodes file. This file must also be the
94 same for all nodes in the cluster.<p>
96 Example 4 node cluster:
98 CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
100 Content of /etc/ctdb/public_addresses:
108 These are the IP addresses that you should configure in DNS for the
109 name of the clustered samba server and are the addresses that CIFS
110 clients will connect to.<p>
112 Configure it as one DNS A record (==name) with multiple IP addresses
113 and let round-robin DNS distribute the clients across the nodes of the
116 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>
118 This means that if one physical node fails, the public addresses that
119 node was serving will be taken over by a different node in the cluster. This
120 provides a guarantee that all ip addresses exposed to clients will
121 always be reachable by clients even if a node has been powered off or
124 Do not assign these addresses to any of the interfaces on the
125 host. CTDB will add and remove these addresses automatically at
128 This parameter is used when CTDB operated in takeover ip mode.<p>
130 The usual location for this file is /etc/ctdb/public_addresses.
132 <h2>Event scripts</h2>
134 CTDB comes with a number of application specific event scripts that
135 are used to do service specific tasks when the cluster has been
136 reconfigured. These scripts are stored in /etc/ctdb/events.d/<p>
138 You do not need to modify these scripts if you just want to use
139 clustered Samba or NFS but they serve as examples in case you want to
140 add clustering support for other application servers we do not yet
141 proivide event scripts for.<p>
143 Please see the service scripts that installed by ctdb in
144 /etc/ctdb/events.d for examples of how to configure other services to
145 be aware of the HA features of CTDB.
147 <h2>TCP port to use for CTDB</h2>
149 CTDB defaults to use TCP port 4379 for its traffic.<p>
151 Configuring a different port to use for CTDB traffic is done by adding
152 a ctdb entry to the /etc/services file.<p>
154 Example: for change CTDB to use port 9999 add the following line to /etc/services
159 Note: all nodes in the cluster MUST use the same port or else CTDB
160 will not start correctly.
162 <h2>Name resolution</h2>
164 You need to setup some method for your Windows and NFS clients to find
165 the nodes of the cluster, and automatically balance the load between
168 We recommend that you use public ip addresses using
169 CTDB_PUBLIC_INTERFACE/CTDB_PUBLIC_ADDRESSES and that you setup a
170 round-robin DNS entry for your cluster, listing all the public IP
171 addresses that CTDB will be managing as a single DNS A record.<p>
173 You may also wish to setup a static WINS server entry listing all of
174 your cluster nodes IP addresses.
176 <!--#include virtual="footer.html" -->