1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <refentry id="ctdbd.1">
6 <refentrytitle>ctdbd</refentrytitle>
7 <manvolnum>1</manvolnum>
12 <refname>ctdbd</refname>
13 <refpurpose>The CTDB cluster daemon</refpurpose>
18 <command>ctdbd</command>
22 <command>ctdbd</command>
23 <arg choice="req">--reclock=<filename></arg>
24 <arg choice="req">--nlist=<filename></arg>
25 <arg choice="req">--dbdir=<directory></arg>
26 <arg choice="opt">-? --help</arg>
27 <arg choice="opt">--usage</arg>
28 <arg choice="opt">-i --interactive</arg>
29 <arg choice="opt">--public-addresses=<filename></arg>
30 <arg choice="opt">--public-interface=<interface></arg>
31 <arg choice="opt">--event-script=<filename></arg>
32 <arg choice="opt">--logfile=<filename></arg>
33 <arg choice="opt">--listen=<address></arg>
34 <arg choice="opt">--transport=<STRING></arg>
35 <arg choice="opt">--socket=<filename></arg>
36 <arg choice="opt">-d --debug=<INTEGER></arg>
37 <arg choice="opt">--torture</arg>
42 <refsect1><title>DESCRIPTION</title>
44 ctdbd is the main ctdb daemon.
47 ctdbd provides a clustered version of the TDB database with automatic rebuild/recovery of the databases upon nodefailures.
50 Combined with a cluster filesystem ctdbd provides a full HA environment for services such as clustered Samba and NFS as well as other services.
53 ctdbd provides monitoring of all nodes in the cluster and automatically reconfigures the cluster and recovers upon node failures.
56 ctdbd is the main component in clustered Samba that provides a high-awailability load-sharing CIFS server cluster.
62 <title>OPTIONS</title>
65 <varlistentry><term>-? --help</term>
68 Print some help text to the screen.
73 <varlistentry><term>--usage</term>
76 Print useage information to the screen.
81 <varlistentry><term>--reclock=<filename></term>
84 This is the name of the lock file stored of the shared cluster filesystem that ctdbd uses to arbitrate which node has the role of recovery-master.
85 This file must be stored on shared storage.
90 <varlistentry><term>--nlist=<filename></term>
93 This file contains a list of the private ip addresses of every node in the cluster. There is one line/ip address for each node. This file must be the same for all nodes in the cluster.
96 This file is usually /etc/ctdb/nodes .
101 <varlistentry><term>--dbdir=<directory></term>
104 This is the directory on local storage where ctdbd keeps the local
105 copy of the TDB databases. This directory is local for each node and should not be stored on the shared cluster filesystem.
108 This directory would usually be /var/ctdb .
113 <varlistentry><term>-i --interactive</term>
116 By default ctdbd will detach itself from the shell and run in
117 the background as a daemon. This option makes ctdbd to start in interactive mode.
122 <varlistentry><term>--public_addresses=<filename></term>
125 When used with IP takeover this specifies a file containing the public ip addresses to use on the cluster. This file contains one entry for each node in the cluster.
128 This is usually the file /etc/ctdb/public_addresses
133 <varlistentry><term>--public-interface=<interface></term>
136 When used with IP takeover this option specifies which physical interface should be used to attach the public addresses to.
141 <varlistentry><term>--event-script=<filename></term>
144 This option is used to specify which events script that ctdbd will
145 use to manage services when the cluster configuration changes.
148 This will normally be /etc/ctdb/events which is part of the ctdb distribution.
153 <varlistentry><term>--logfile=<filename></term>
156 This is the file where ctdbd will write its log. This is usually /var/log/log.ctdb .
161 <varlistentry><term>--listen=<address></term>
164 This specifies which ip address ctdb will bind to. By default ctdbd will bind to the first address it finds in the /etc/ctdb/nodes file and which is also present on the local system in which case you do not need to provide this option.
167 This option is only required when you want to run multiple ctdbd daemons/nodes on the same physical host in which case there would be multiple entries in /etc/ctdb/nodes what would match a local interface.
172 <varlistentry><term>--transport=<STRING></term>
175 This option specifies which transport to use for ctdbd internode communications. The default is "tcp".
178 Suported transports are "tcp" and "infiniband".
183 <varlistentry><term>--socket=<filename></term>
186 This specifies the name of the domain socket that ctdbd will create. This socket is used for local clients to attach to and communicate with the ctdbd daemon.
189 The default is /tmp/ctdb.socket . You only need to use this option if you plan to run multiple ctdbd daemons on the same physical host.
194 <varlistentry><term>-d --debug=<DEBUGLEVEL></term>
197 This option sets the debuglevel on the ctdbd daemon which controls what will be written to the logfile. The default is 0 which will only log important events and errors. A larger number will provide additional logging.
202 <varlistentry><term>--torture</term>
205 This option is only used for development and testing of ctdbd. It adds artificial errors and failures to the common codepaths in ctdbd to verify that ctdbd can recover correctly for failures.
208 You do NOT want to use this option unless you are developing and testing new functionality in ctdbd.
216 <refsect1><title>Private vs Public addresses</title>
218 When used for ip takeover in a HA environment, each node in a ctdb
219 cluster has two ip addresses assigned to it. One private and one public.
222 <refsect2><title>Private address</title>
224 This is the physical ip address of the node which is configured in
225 linux and attached to a physical interface. This address uniquely
226 identifies a physical node in the cluster and is the ip addresses
227 that ctdbd will use to communicate with the ctdbd daemons on the
228 other nodes in the cluster.
231 The private addresses are configured in /etc/ctdb/nodes
232 (unless the --nlist option is used) and contain one line for each
233 node in the cluster. Each line contains the private ip address for one
237 Each node is assigned an internal node number which corresponds to
238 which line in the nodes file that has the local private address
242 Since the private addresses are only available to the network when the
243 corresponding node is up and running you should not use these addresses
244 for clients to connect to services provided by the cluster. Instead
245 client applications should only attach to the public addresses since
246 these are guaranteed to always be available.
248 Example /etc/ctdb/nodes for a four node cluster:
249 <screen format="linespecific">
256 <refsect2><title>Public address</title>
258 A public address on the other hand is not attached to an interface.
259 This address is managed by ctdbd itself and is attached/detached to
260 a physical node at runtime. You should NOT have this address configured
261 to an interface in linux. Let ctdbd manage these addresses.
264 The ctdb cluster will assign/reassign these public addresses across the
265 available nodes in the cluster. When one node fails, its public address
266 will be migrated to and taken over by a different node in the cluster
267 to ensure that all public addresses are always available to clients.
270 These addresses are not physically attached to a specific node.
271 The 'ctdb ip' command can be used to view the current assignment of
272 public addresses and which physical node is currently serving it.
275 By default, each node will when operational always serve its primary
276 public address which is the corresponding line for that node number
277 in the public addresses file. I.e. as long as node X is available and
278 fully oprational it will always be the node that serves the
279 corresponding public address.
282 The list of public addresses also contain the netmask for that address.
283 the reason for this is because ctdbd needs to know which mask to use
284 when it adds/removes the address from a physical node. This netmask
285 is also used by ctdbd when making decisions on which node should take
286 over a public ip address for a failed node.
287 A node will only be allowed to take over a public address from a
288 different node IFF that public address resides in the same subnet
289 as the primary public address for that node.
291 Example /etc/ctdb/public_addresses for a four node cluster:
292 <screen format="linespecific">
299 In this example, if node 3 fails, its public address can be taken over
300 by node 2 since node 2 is on the same subnet as 3 but not by node 0 or
301 node 1 since node 0 and 1 are both on a different subnet from node 3.
307 <refsect1><title>Node status</title>
309 The current status of each node in the cluster can be viewed by the
310 'ctdb status' command.
313 There are five possible for a node.
317 OK - This node is fully functional.
321 DISCONNECTED - This node could not be connected through the network
322 and is currently not parcipitating in the cluster. If there is a
323 public IP address associated with this node it should have been taken
324 over by a different node. No services are running on this node.
328 DISABLED - This node has been administratively disabled. This node is
329 still functional and participates in the CTDB cluster but its IP
330 addresses have been taken over by a different node and no services are
331 currently being hosted.
335 UNHEALTHY - A service provided by this node is malfunctioning and should
336 be investigated. The CTDB daemon itself is operational and participates
337 in the cluster. Its public IP address has been taken over by a different
338 node and no services are currently being hosted. All unhealthy nodes
339 should be investigated and require an administrative action to rectify.
343 BANNED - This node failed too many recovery attempts and has been banned
344 from participating in the cluster for a period of RecoveryBanPeriod
345 seconds. Any public IP address has been taken over by other nodes. This
346 node does not provide any services. All banned nodes should be
347 investigated and require an administrative action to rectify. This node
348 does not perticipate in the CTDB cluster but can still be communicated
349 with. I.e. ctdb commands can be sent to it.
354 <refsect1><title>SEE ALSO</title>
357 <ulink url="http://ctdb.samba.org/"/>
360 <refsect1><title>COPYRIGHT/LICENSE</title>
362 Copyright (C) Andrew Tridgell 2007
363 Copyright (C) Ronnie sahlberg 2007
365 This program is free software; you can redistribute it and/or modify
366 it under the terms of the GNU General Public License as published by
367 the Free Software Foundation; either version 2 of the License, or (at
368 your option) any later version.
370 This program is distributed in the hope that it will be useful, but
371 WITHOUT ANY WARRANTY; without even the implied warranty of
372 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
373 General Public License for more details.
375 You should have received a copy of the GNU General Public License
376 along with this program; if not, write to the Free Software
377 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.