merge from ronnie
[sahlberg/ctdb.git] / web / configuring.html
1 <!--#set var="TITLE" value="Configuring CTDB" -->
2 <!--#include virtual="header.html" -->
3
4 <H2 align="center">Configuring CTDB</H2>
5
6 <h2>Clustering Model</h2>
7
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 
12 nodes.<p>
13
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.
18
19 <h2>CTDB Cluster Configuration</h2>
20
21 These are the primary configuration files for CTDB.<p>
22
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>
27
28 <h3>/etc/sysconfig/ctdb</h3>
29
30 This file contains the startup parameters for ctdb.<p>
31
32 When you installed ctdb, a template config file should have been
33 installed in /etc/sysconfig/ctdb.<p>
34
35 Edit this file, following the instructions in the template.<p>
36
37 The most important options are:
38 <ul>
39 <li>CTDB_NODES
40 <li>CTDB_RECOVERY_LOCK
41 <li>CTDB_PUBLIC_ADDRESSES
42 </ul>
43
44 Please verify these parameters carefully.
45
46 <h4>CTDB_RECOVERY_LOCK</h4>
47
48 This parameter specifies the lock file that the CTDB daemons use to arbitrate 
49 which node is acting as a recovery master.<br>
50
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>
52
53 You <strong>must</strong> specify this parameter.<br>
54 There is no default for this parameter.
55
56 <h3>CTDB_NODES</h3>
57
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>
61
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
64 the cluster.<p>
65
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>
68
69 Example 4 node cluster:
70 <pre>
71   CTDB_NODES=/etc/ctdb/nodes
72 </pre>
73 Content of /etc/ctdb/nodes:
74 <pre>
75  10.1.1.1
76  10.1.1.2
77  10.1.1.3
78  10.1.1.4
79 </pre>
80
81 The default for this file is /etc/ctdb/nodes.
82
83
84 <h3>CTDB_PUBLIC_ADDRESSES</h3>
85
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>
88
89
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>
95
96 Example 4 node cluster:
97 <pre>
98   CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
99 </pre>
100 Content of /etc/ctdb/public_addresses:
101 <pre>
102  192.168.1.1/24 eth0
103  192.168.1.2/24 eth0
104  192.168.2.1/24 eth1
105  192.168.2.2/24 eth1
106 </pre>
107
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>
111
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
114 cluster.<p>
115
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>
117
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
122 has crashed.<p>
123
124 Do not assign these addresses to any of the interfaces on the
125 host. CTDB will add and remove these addresses automatically at
126 runtime.<p>
127
128 This parameter is used when CTDB operated in takeover ip mode.<p>
129
130 The usual location for this file is /etc/ctdb/public_addresses.
131
132 <h2>Event scripts</h2>
133
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>
137
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>
142
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.
146
147 <h2>TCP port to use for CTDB</h2>
148
149 CTDB defaults to use TCP port 4379 for its traffic.<p>
150
151 Configuring a different port to use for CTDB traffic is done by adding
152 a ctdb entry to the /etc/services file.<p>
153
154 Example: for change CTDB to use port 9999 add the following line to /etc/services
155 <pre>
156  ctdb  9999/tcp
157 </pre>
158
159 Note: all nodes in the cluster MUST use the same port or else CTDB
160 will not start correctly.
161
162 <h2>Name resolution</h2>
163
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
166 the nodes.<p>
167
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>
172
173 You may also wish to setup a static WINS server entry listing all of
174 your cluster nodes IP addresses.
175
176 <!--#include virtual="footer.html" -->