source: vendor/current/ctdb/web/configuring.html

Last change on this file was 988, checked in by Silvan Scherrer, 9 years ago

Samba Server: update vendor to version 4.4.3

File size: 6.7 KB
Line 
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
8The setup instructions on this page are modelled on setting up a cluster of N
9nodes that function in nearly all respects as a single multi-homed node.
10So the cluster will export N IP interfaces, each of which is equivalent
11(same shares) and which offers coherent CIFS file access across all
12nodes.<p>
13
14The clustering model utilizes IP takeover techniques to ensure that
15the full set of public IP addresses assigned to services on the
16cluster will always be available to the clients even when some nodes
17have failed and become unavailable.
18
19<h2>CTDB Cluster Configuration</h2>
20
21These are the primary configuration files for CTDB.<p>
22
23When CTDB is installed, it will install template versions of these
24files which you need to edit to suit your system.
25
26<h3>/etc/sysconfig/ctdb</h3>
27
28This file contains the startup parameters for ctdb.<p>
29
30When you installed ctdb, a template config file should have been
31installed in /etc/sysconfig/ctdb.<p>
32
33Edit this file, following the instructions in the template.<p>
34
35The most important options are:
36<ul>
37<li>CTDB_NODES
38<li>CTDB_RECOVERY_LOCK
39<li>CTDB_PUBLIC_ADDRESSES
40</ul>
41
42Please verify these parameters carefully.
43
44<h4>CTDB_RECOVERY_LOCK</h4>
45
46This parameter specifies the lock file that the CTDB daemons use to arbitrate
47which node is acting as a recovery master.<br>
48
49This file MUST be held on shared storage so that all CTDB daemons in the cluster will access/lock the same file.<br><br>
50
51You <strong>must</strong> specify this parameter.<br>
52There is no default for this parameter.
53
54<h3>CTDB_NODES</h3>
55
56This file needs to be created and should contain a list of the private
57IP addresses that the CTDB daemons will use in your cluster. One IP
58address for each node in the cluster.<p>
59
60This should be a private non-routable subnet which is only used for
61internal cluster traffic. This file must be the same on all nodes in
62the cluster.<p>
63
64Make sure that these IP addresses are automatically started when the
65cluster node boots and that each node can ping each other node.<p>
66
67Example 4 node cluster:
68<pre>
69 CTDB_NODES=/etc/ctdb/nodes
70</pre>
71Content of /etc/ctdb/nodes:
72<pre>
73 10.1.1.1
74 10.1.1.2
75 10.1.1.3
76 10.1.1.4
77</pre>
78
79The default for this file is /etc/ctdb/nodes.
80
81
82<h3>CTDB_PUBLIC_ADDRESSES</h3>
83
84Each node in a CTDB cluster contains a list of public addresses which that
85particular node can host.<p>
86
87While 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>
88
89These are the addresses that the SMBD daemons and other services will
90bind to and which clients will use to connect to the cluster.<p>
91
92<h3>Example 4 node cluster:</h3>
93<pre>
94 CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
95</pre>
96Content of /etc/ctdb/public_addresses:
97<pre>
98 192.168.1.1/24 eth0
99 192.168.1.2/24 eth0
100 192.168.2.1/24 eth1
101 192.168.2.2/24 eth1
102</pre>
103
104These are the IP addresses that you should configure in DNS for the
105name of the clustered samba server and are the addresses that CIFS
106clients will connect to.<p>
107
108Configure it as one DNS A record (==name) with multiple IP addresses
109and let round-robin DNS distribute the clients across the nodes of the
110cluster.<p>
111
112The 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>
113
114This means that if one physical node fails, the public addresses that
115node was serving will be taken over by a different node in the cluster. This
116provides a guarantee that all ip addresses exposed to clients will
117always 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).
118
119Do not assign these addresses to any of the interfaces on the
120host. CTDB will add and remove these addresses automatically at
121runtime.<p>
122
123This parameter is used when CTDB operated in takeover ip mode.<p>
124
125The usual location for this file is /etc/ctdb/public_addresses.<p><p>
126
127<h3>Example 2:</h3>
128By using different public_addresses files on different nodes it is possible to
129partition the cluster into subsets of nodes.
130
131<pre>
132Node 0 : /etc/ctdb/public_addresses
13310.1.1.1/24 eth0
13410.1.2.1/24 eth1
135</pre>
136
137<pre>
138Node 1 : /etc/ctdb/public_addresses
13910.1.2.1/24 eth1
14010.1.3.1/24 eth2
141</pre>
142
143<pre>
144Node 2 : /etc/ctdb/public_addresses
14510.1.3.2/24 eth2
146</pre>
147
148In this example we have three nodes but a total of 4 public addresses.<p>
149
15010.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>
151
152All 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.
153
154
155<h2>Event scripts</h2>
156
157CTDB comes with a number of application specific event scripts that
158are used to do service specific tasks when the cluster has been
159reconfigured. These scripts are stored in /etc/ctdb/events.d/<p>
160
161You do not need to modify these scripts if you just want to use
162clustered Samba or NFS but they serve as examples in case you want to
163add clustering support for other application servers we do not yet
164proivide event scripts for.<p>
165
166Please see the service scripts that installed by ctdb in
167/etc/ctdb/events.d for examples of how to configure other services to
168be aware of the HA features of CTDB.<p>
169
170Also see /etc/ctdb/events.d/README for additional documentation on how to
171create and manage event scripts.
172
173<h2>TCP port to use for CTDB</h2>
174
175CTDB defaults to use TCP port 4379 for its traffic.<p>
176
177Configuring a different port to use for CTDB traffic is done by adding
178a ctdb entry to the /etc/services file.<p>
179
180Example: for change CTDB to use port 9999 add the following line to /etc/services
181<pre>
182 ctdb 9999/tcp
183</pre>
184
185Note: all nodes in the cluster MUST use the same port or else CTDB
186will not start correctly.
187
188<h2>Name resolution</h2>
189
190You need to setup some method for your Windows and NFS clients to find
191the nodes of the cluster, and automatically balance the load between
192the nodes.<p>
193
194We recommend that you use public ip addresses using
195CTDB_PUBLIC_INTERFACE/CTDB_PUBLIC_ADDRESSES and that you setup a
196round-robin DNS entry for your cluster, listing all the public IP
197addresses that CTDB will be managing as a single DNS A record.<p>
198
199You may also wish to setup a static WINS server entry listing all of
200your cluster nodes IP addresses.
201
202<!--#include virtual="footer.html" -->
Note: See TracBrowser for help on using the repository browser.