1CTDBD(1)                                                              CTDBD(1)
2
3
4

NAME

6       ctdbd - The CTDB cluster daemon
7

SYNOPSIS

9       ctdbd
10
11       ctdbd [-? --help] [-d --debug=<INTEGER>] {--dbdir=<directory>}
12             {--dbdir-persistent=<directory>} [--event-script-dir=<directory>]
13             [-i --interactive] [--listen=<address>] [--logfile=<filename>]
14             [--lvs] {--nlist=<filename>} [--no-lmaster] [--no-recmaster]
15             [--nosetsched] {--notification-script=<filename>}
16             [--public-addresses=<filename>] [--public-interface=<interface>]
17             {--reclock=<filename>} [--single-public-ip=<address>]
18             [--socket=<filename>] [--start-as-disabled] [--start-as-stopped]
19             [--syslog] [--torture] [--transport=<STRING>] [--usage]
20

DESCRIPTION

22       ctdbd is the main ctdb daemon.
23
24       ctdbd provides a clustered version of the TDB database with automatic
25       rebuild/recovery of the databases upon nodefailures.
26
27       Combined with a cluster filesystem ctdbd provides a full HA environment
28       for services such as clustered Samba and NFS as well as other services.
29
30       ctdbd provides monitoring of all nodes in the cluster and automatically
31       reconfigures the cluster and recovers upon node failures.
32
33       ctdbd is the main component in clustered Samba that provides a
34       high-availability load-sharing CIFS server cluster.
35

OPTIONS

37       -? --help
38           Print some help text to the screen.
39
40       -d --debug=<DEBUGLEVEL>
41           This option sets the debuglevel on the ctdbd daemon which controls
42           what will be written to the logfile. The default is 0 which will
43           only log important events and errors. A larger number will provide
44           additional logging.
45
46       --dbdir=<directory>
47           This is the directory on local storage where ctdbd keeps the local
48           copy of the TDB databases. This directory is local for each node
49           and should not be stored on the shared cluster filesystem.
50
51           This directory would usually be /var/ctdb .
52
53       --dbdir-persistent=<directory>
54           This is the directory on local storage where ctdbd keeps the local
55           copy of the persistent TDB databases. This directory is local for
56           each node and should not be stored on the shared cluster
57           filesystem.
58
59           This directory would usually be /etc/ctdb/persistent .
60
61       --event-script-dir=<directory>
62           This option is used to specify the directory where the CTDB event
63           scripts are stored.
64
65           This will normally be /etc/ctdb/events.d which is part of the ctdb
66           distribution.
67
68       -i --interactive
69           By default ctdbd will detach itself from the shell and run in the
70           background as a daemon. This option makes ctdbd to start in
71           interactive mode.
72
73       --listen=<address>
74           This specifies which ip address ctdb will bind to. By default ctdbd
75           will bind to the first address it finds in the /etc/ctdb/nodes file
76           and which is also present on the local system in which case you do
77           not need to provide this option.
78
79           This option is only required when you want to run multiple ctdbd
80           daemons/nodes on the same physical host in which case there would
81           be multiple entries in /etc/ctdb/nodes what would match a local
82           interface.
83
84       --logfile=<filename>
85           This is the file where ctdbd will write its log. This is usually
86           /var/log/log.ctdb .
87
88       --lvs
89           This option is used to activate the LVS capability on a CTDB node.
90           Please see the LVS section.
91
92       --nlist=<filename>
93           This file contains a list of the private ip addresses of every node
94           in the cluster. There is one line/ip address for each node. This
95           file must be the same for all nodes in the cluster.
96
97           This file is usually /etc/ctdb/nodes .
98
99       --no-lmaster
100           This argument specifies that this node can NOT become an lmaster
101           for records in the database. This means that it will never show up
102           in the vnnmap. This feature is primarily used for making a cluster
103           span across a WAN link and use CTDB as a WAN-accelerator.
104
105           Please see the "remote cluster nodes" section for more information.
106
107       --no-recmaster
108           This argument specifies that this node can NOT become a recmaster
109           for the database. This feature is primarily used for making a
110           cluster span across a WAN link and use CTDB as a WAN-accelerator.
111
112           Please see the "remote cluster nodes" section for more information.
113
114       --nosetsched
115           This is a ctdbd debugging option. this option is only used when
116           debugging ctdbd.
117
118           Normally ctdb will change its scheduler to run as a real-time
119           process. This is the default mode for a normal ctdbd operation to
120           gurarantee that ctdbd always gets the cpu cycles that it needs.
121
122           This option is used to tell ctdbd to NOT run as a real-time process
123           and instead run ctdbd as a normal userspace process. This is useful
124           for debugging and when you want to run ctdbd under valgrind or gdb.
125           (You dont want to attach valgrind or gdb to a real-time process.)
126
127       --notification-script=<filename>
128           This specifies a script which will be invoked by ctdb when certain
129           state changes occur in ctdbd and when you may want to trigger this
130           to run certain scripts.
131
132           This file is usually /etc/ctdb/notify.sh .
133
134           See the NOTIFICATION SCRIPT section below for more information.
135
136       --public_addresses=<filename>
137           When used with IP takeover this specifies a file containing the
138           public ip addresses to use on the cluster. This file contains a
139           list of ip addresses netmasks and interfaces. When ctdb is
140           operational it will distribute these public ip addresses evenly
141           across the available nodes.
142
143           This is usually the file /etc/ctdb/public_addresses
144
145       --public-interface=<interface>
146           This option tells ctdb which interface to attach public-addresses
147           to and also where to attach the single-public-ip when used.
148
149           This is only required when using public ip addresses and only when
150           you dont specify the interface explicitly in
151           /etc/ctdb/public_addresses or when you are using
152           --single-public-ip.
153
154           If you omit this argument when using public addresses or single
155           public ip, ctdb will not be able to send out Gratious ARPs
156           correctly or be able to kill tcp connections correctly which will
157           lead to application failures.
158
159       --reclock=<filename>
160           This is the name of the lock file stored of the shared cluster
161           filesystem that ctdbd uses to prevent split brains from occuring.
162           This file must be stored on shared storage.
163
164           It is possible to run CTDB without a reclock file, but then there
165           will be no protection against split brain if the network becomes
166           partitioned. Using CTDB without a reclock file is strongly
167           discouraged.
168
169       --socket=<filename>
170           This specifies the name of the domain socket that ctdbd will
171           create. This socket is used for local clients to attach to and
172           communicate with the ctdbd daemon.
173
174           The default is /tmp/ctdb.socket . You only need to use this option
175           if you plan to run multiple ctdbd daemons on the same physical
176           host.
177
178       --start-as-disabled
179           This makes the ctdb daemon to be DISABLED when it starts up.
180
181           As it is DISABLED it will not get any of the public ip addresses
182           allocated to it, and thus this allow you to start ctdb on a node
183           without causing any ip address to failover from other nodes onto
184           the new node.
185
186           When used, the administrator must keep track of when nodes start
187           and manually enable them again using the "ctdb enable" command, or
188           else the node will not host any services.
189
190           A node that is DISABLED will not host any services and will not be
191           reachable/used by any clients.
192
193       --start-as-stopped
194           This makes the ctdb daemon to be STOPPED when it starts up.
195
196           A node that is STOPPED does not host any public addresses. It is
197           not part of the VNNMAP so it does act as an LMASTER. It also has
198           all databases locked in recovery mode until restarted.
199
200           To restart and activate a STOPPED node, the command "ctdb continue"
201           is used.
202
203           A node that is STOPPED will not host any services and will not be
204           reachable/used by any clients.
205
206       --syslog
207           Send all log messages to syslog instead of to the ctdb logfile.
208
209       --torture
210           This option is only used for development and testing of ctdbd. It
211           adds artificial errors and failures to the common codepaths in
212           ctdbd to verify that ctdbd can recover correctly for failures.
213
214           You do NOT want to use this option unless you are developing and
215           testing new functionality in ctdbd.
216
217       --transport=<STRING>
218           This option specifies which transport to use for ctdbd internode
219           communications. The default is "tcp".
220
221           Currently only "tcp" is supported but "infiniband" might be
222           implemented in the future.
223
224       --usage
225           Print useage information to the screen.
226

PRIVATE VS PUBLIC ADDRESSES

228       When used for ip takeover in a HA environment, each node in a ctdb
229       cluster has multiple ip addresses assigned to it. One private and one
230       or more public.
231
232   Private address
233       This is the physical ip address of the node which is configured in
234       linux and attached to a physical interface. This address uniquely
235       identifies a physical node in the cluster and is the ip addresses that
236       ctdbd will use to communicate with the ctdbd daemons on the other nodes
237       in the cluster.
238
239       The private addresses are configured in /etc/ctdb/nodes (unless the
240       --nlist option is used) and contain one line for each node in the
241       cluster. Each line contains the private ip address for one node in the
242       cluster. This file must be the same on all nodes in the cluster.
243
244       Since the private addresses are only available to the network when the
245       corresponding node is up and running you should not use these addresses
246       for clients to connect to services provided by the cluster. Instead
247       client applications should only attach to the public addresses since
248       these are guaranteed to always be available.
249
250       When using ip takeover, it is strongly recommended that the private
251       addresses are configured on a private network physically separated from
252       the rest of the network and that this private network is dedicated to
253       CTDB traffic.
254
255             Example /etc/ctdb/nodes for a four node cluster:
256
257
258                   10.1.1.1
259                   10.1.1.2
260                   10.1.1.3
261                   10.1.1.4
262
263
264   Public address
265       A public address on the other hand is not attached to an interface.
266       This address is managed by ctdbd itself and is attached/detached to a
267       physical node at runtime.
268
269       The ctdb cluster will assign/reassign these public addresses across the
270       available healthy nodes in the cluster. When one node fails, its public
271       address will be migrated to and taken over by a different node in the
272       cluster to ensure that all public addresses are always available to
273       clients as long as there are still nodes available capable of hosting
274       this address.
275
276       These addresses are not physically attached to a specific node. The
277       ´ctdb ip´ command can be used to view the current assignment of public
278       addresses and which physical node is currently serving it.
279
280       On each node this file contains a list of the public addresses that
281       this node is capable of hosting. The list also contain the netmask and
282       the interface where this address should be attached for the case where
283       you may want to serve data out through multiple different interfaces.
284
285             Example /etc/ctdb/public_addresses for a node that can host 4
286       public addresses:
287
288
289                   11.1.1.1/24 eth0
290                   11.1.1.2/24 eth0
291                   11.1.2.1/24 eth1
292                   11.1.2.2/24 eth1
293
294
295       In most cases this file would be the same on all nodes in a cluster but
296       there are exceptions when one may want to use different files on
297       different nodes.
298
299            Example: 4 nodes partitioned into two subgroups :
300
301                Node 0:/etc/ctdb/public_addresses
302                     10.1.1.1/24 eth0
303                     10.1.1.2/24 eth0
304
305                Node 1:/etc/ctdb/public_addresses
306                     10.1.1.1/24 eth0
307                     10.1.1.2/24 eth0
308
309                Node 2:/etc/ctdb/public_addresses
310                     10.2.1.1/24 eth0
311                     10.2.1.2/24 eth0
312
313                Node 3:/etc/ctdb/public_addresses
314                     10.2.1.1/24 eth0
315                     10.2.1.2/24 eth0
316
317
318       In this example nodes 0 and 1 host two public addresses on the 10.1.1.x
319       network while nodes 2 and 3 host two public addresses for the 10.2.1.x
320       network.
321
322       Ip address 10.1.1.1 can be hosted by either of nodes 0 or 1 and will be
323       available to clients as long as at least one of these two nodes are
324       available. If both nodes 0 and node 1 become unavailable 10.1.1.1 also
325       becomes unavailable. 10.1.1.1 can not be failed over to node 2 or node
326       3 since these nodes do not have this ip address listed in their public
327       addresses file.
328

NODE STATUS

330       The current status of each node in the cluster can be viewed by the
331       ´ctdb status´ command.
332
333       There are five possible states for a node.
334
335       OK - This node is fully functional.
336
337       DISCONNECTED - This node could not be connected through the network and
338       is currently not particpating in the cluster. If there is a public IP
339       address associated with this node it should have been taken over by a
340       different node. No services are running on this node.
341
342       DISABLED - This node has been administratively disabled. This node is
343       still functional and participates in the CTDB cluster but its IP
344       addresses have been taken over by a different node and no services are
345       currently being hosted.
346
347       UNHEALTHY - A service provided by this node is malfunctioning and
348       should be investigated. The CTDB daemon itself is operational and
349       participates in the cluster. Its public IP address has been taken over
350       by a different node and no services are currently being hosted. All
351       unhealthy nodes should be investigated and require an administrative
352       action to rectify.
353
354       BANNED - This node failed too many recovery attempts and has been
355       banned from participating in the cluster for a period of
356       RecoveryBanPeriod seconds. Any public IP address has been taken over by
357       other nodes. This node does not provide any services. All banned nodes
358       should be investigated and require an administrative action to rectify.
359       This node does not perticipate in the CTDB cluster but can still be
360       communicated with. I.e. ctdb commands can be sent to it.
361
362       STOPPED - A node that is stopped does not host any public ip addresses,
363       nor is it part of the VNNMAP. A stopped node can not become LVSMASTER,
364       RECMASTER or NATGW. This node does not perticipate in the CTDB cluster
365       but can still be communicated with. I.e. ctdb commands can be sent to
366       it.
367

PUBLIC TUNABLES

369       These are the public tuneables that can be used to control how ctdb
370       behaves.
371
372   KeepaliveInterval
373       Default: 1
374
375       How often should the nodes send keepalives to eachother.
376
377   KeepaliveLimit
378       Default: 5
379
380       After how many keepalive intervals without any traffic should a node
381       wait until marking the peer as DISCONNECTED.
382
383   MonitorInterval
384       Default: 15
385
386       How often should ctdb run the event scripts to check for a nodes
387       health.
388
389   TickleUpdateInterval
390       Default: 20
391
392       How often will ctdb record and store the "tickle" information used to
393       kickstart stalled tcp connections after a recovery.
394
395   EventScriptTimeout
396       Default: 20
397
398       How long should ctdb let an event script run before aborting it and
399       marking the node unhealthy.
400
401   RecoveryBanPeriod
402       Default: 300
403
404       If a node becomes banned causing repetitive recovery failures. The node
405       will eventually become banned from the cluster. This controls how long
406       the culprit node will be banned from the cluster before it is allowed
407       to try to join the cluster again. Dont set to small. A node gets banned
408       for a reason and it is usually due to real problems with the node.
409
410   DatabaseHashSize
411       Default: 100000
412
413       Size of the hash chains for the local store of the tdbs that ctdb
414       manages.
415
416   RerecoveryTimeout
417       Default: 10
418
419       Once a recovery has completed, no additional recoveries are permitted
420       until this timeout has expired.
421
422   EnableBans
423       Default: 1
424
425       When set to 0, this disables BANNING completely in the cluster and thus
426       nodes can not get banned, even it they break. Dont set to 0.
427
428   DeterministicIPs
429       Default: 1
430
431       When enabled, this tunable makes ctdb try to keep public IP addresses
432       locked to specific nodes as far as possible. This makes it easier for
433       debugging since you can know that as long as all nodes are healthy
434       public IP X will always be hosted by node Y.
435
436       The cost of using deterministic IP address assignment is that it
437       disables part of the logic where ctdb tries to reduce the number of
438       public IP assignment changes in the cluster. This tunable may increase
439       the number of IP failover/failbacks that are performed on the cluster
440       by a small margin.
441
442   DisableWhenUnhealthy
443       Default: 0
444
445       When set, As soon as a node becomes unhealthy, that node will also
446       automatically become permanently DISABLED. Once a node is DISABLED, the
447       only way to make it participate in the cluster again and host services
448       is by manually enabling the node again using ´ctdb enable´.
449
450       This disables parts of the resilience and robustness of the cluster and
451       should ONLY be used when the system administrator is actively
452       monitoring the cluster, so that nodes can be enabled again.
453
454   NoIPFailback
455       Default: 0
456
457       When set to 1, ctdb will not perform failback of IP addresses when a
458       node becomes healthy. Ctdb WILL perform failover of public IP addresses
459       when a node becomes UNHEALTHY, but when the node becomes HEALTHY again,
460       ctdb will not fail the addresses back.
461
462       Use with caution! Normally when a node becomes available to the cluster
463       ctdb will try to reassign public IP addresses onto the new node as a
464       way to distribute the workload evenly across the clusternode. Ctdb
465       tries to make sure that all running nodes have approximately the same
466       number of public addresses it hosts.
467
468       When you enable this tunable, CTDB will no longer attempt to rebalance
469       the cluster by failing IP addresses back to the new nodes. An
470       unbalanced cluster will therefore remain unbalanced until there is
471       manual intervention from the administrator. When this parameter is set,
472       you can manually fail public IP addresses over to the new node(s) using
473       the ´ctdb moveip´ command.
474

LVS

476       LVS is a mode where CTDB presents one single IP address for the entire
477       cluster. This is an alternative to using public IP addresses and
478       round-robin DNS to loadbalance clients across the cluster.
479
480       This is similar to using a layer-4 loadbalancing switch but with some
481       restrictions.
482
483       In this mode the cluster select a set of nodes in the cluster and
484       loadbalance all client access to the LVS address across this set of
485       nodes. This set of nodes are all LVS capable nodes that are HEALTHY, or
486       if no HEALTHY nodes exists all LVS capable nodes regardless of health
487       status. LVS will however never loadbalance traffic to nodes that are
488       BANNED, STOPPED, DISABLED or DISCONNECTED. The "ctdb lvs" command is
489       used to show which nodes are currently load-balanced across.
490
491       One of the these nodes are elected as the LVSMASTER. This node receives
492       all traffic from clients coming in to the LVS address and multiplexes
493       it across the internal network to one of the nodes that LVS is using.
494       When responding to the client, that node will send the data back
495       directly to the client, bypassing the LVSMASTER node. The command "ctdb
496       lvsmaster" will show which node is the current LVSMASTER.
497
498       The path used for a client i/o is thus :
499
500                (1) Client sends request packet to LVSMASTER
501                (2) LVSMASTER passes the request on to one node across the internal network.
502                (3) Selected node processes the request.
503                (4) Node responds back to client.
504
505
506       This means that all incoming traffic to the cluster will pass through
507       one physical node, which limits scalability. You can send more data to
508       the LVS address that one physical node can multiplex. This means that
509       you should not use LVS if your I/O pattern is write-intensive since you
510       will be limited in the available network bandwidth that node can
511       handle. LVS does work wery well for read-intensive workloads where only
512       smallish READ requests are going through the LVSMASTER bottleneck and
513       the majority of the traffic volume (the data in the read replies) goes
514       straight from the processing node back to the clients. For
515       read-intensive i/o patterns you can acheive very high throughput rates
516       in this mode.
517
518       Note: you can use LVS and public addresses at the same time.
519
520   Configuration
521       To activate LVS on a CTDB node you must specify CTDB_PUBLIC_INTERFACE
522       and CTDB_LVS_PUBLIC_ADDRESS in /etc/sysconfig/ctdb.
523
524       You must also specify the "--lvs" command line argument to ctdbd to
525       activete LVS as a capability of the node. This should be done
526       automatically for you by the /etc/init.d/ctdb script.
527
528       Example:
529
530                CTDB_PUBLIC_INTERFACE=eth0
531                CTDB_LVS_PUBLIC_IP=10.0.0.237
532
533
534       If you use LVS, you must still have a real/permanent address configured
535       for the public interface on each node. This address must be routable
536       and the cluster nodes must be configured so that all traffic back to
537       client hosts are routed through this interface. This is also required
538       in order to allow samba/winbind on the node to talk to the domain
539       controller. (we can not use the lvs IP address to initiate outgoing
540       traffic)
541
542       I.e. make sure that you can "ping" both the domain controller and also
543       all of the clients from the node BEFORE you enable LVS. Also make sure
544       that when you ping these hosts that the traffic is routed out through
545       the eth0 interface.
546

REMOTE CLUSTER NODES

548       It is possible to have a CTDB cluster that spans across a WAN link. For
549       example where you have a CTDB cluster in your datacentre but you also
550       want to have one additional CTDB node located at a remote branch site.
551       This is similar to how a WAN accelerator works but with the difference
552       that while a WAN-accelerator often acts as a Proxy or a MitM, in the
553       ctdb remote cluster node configuration the Samba instance at the remote
554       site IS the genuine server, not a proxy and not a MitM, and thus
555       provides 100% correct CIFS semantics to clients.
556
557       See the cluster as one single multihomed samba server where one of the
558       NICs (the remote node) is very far away.
559
560       NOTE: This does require that the cluster filesystem you use can cope
561       with WAN-link latencies. Not all cluster filesystems can handle
562       WAN-link latencies! Whether this will provide very good WAN-accelerator
563       performance or it will perform very poorly depends entirely on how
564       optimized your cluster filesystem is in handling high latency for data
565       and metadata operations.
566
567       To activate a node as being a remote cluster node you need to set the
568       following two parameters in /etc/sysconfig/ctdb for the remote node:
569
570           CTDB_CAPABILITY_LMASTER=no
571           CTDB_CAPABILITY_RECMASTER=no
572
573
574       Verify with the command "ctdb getcapabilities" that that node no longer
575       has the recmaster or the lmaster capabilities.
576

NAT-GW

578       Sometimes it is desireable to run services on the CTDB node which will
579       need to originate outgoing traffic to external servers. This might be
580       contacting NIS servers, LDAP servers etc. etc.
581
582       This can sometimes be problematic since there are situations when a
583       node does not have any public ip addresses assigned. This could be due
584       to the nobe just being started up and no addresses have been assigned
585       yet or it could be that the node is UNHEALTHY in which case all public
586       addresses have been migrated off.
587
588       If then the service status of CTDB depends on such services being able
589       to always being able to originate traffic to external resources this
590       becomes extra troublesome. The node might be UNHEALTHY because the
591       service can not be reached, and the service can not be reached because
592       the node is UNHEALTHY.
593
594       There are two ways to solve this problem. The first is by assigning a
595       static ip address for one public interface on every node which will
596       allow every node to be able to route traffic to the public network even
597       if there are no public addresses assigned to the node. This is the
598       simplest way but it uses up a lot of ip addresses since you have to
599       assign both static and also public addresses to each node.
600
601   NAT-GW
602       A second way is to use the built in NAT-GW feature in CTDB. With NAT-GW
603       you assign one public NATGW address for each natgw group. Each NATGW
604       group is a set of nodes in the cluster that shares the same NATGW
605       address to talk to the outside world. Normally there would only be one
606       NATGW group spanning the entire cluster, but in situations where one
607       ctdb cluster spans multiple physical sites it is useful to have one
608       NATGW group for each of the two sites.
609
610       There can be multiple NATGW groups in one cluster but each node can
611       only be member of one NATGW group.
612
613       In each NATGW group, one of the nodes is designated the NAT Gateway
614       through which all traffic that is originated by nodes in this group
615       will be routed through if a public addresses are not available.
616
617   Configuration
618       NAT-GW is configured in /etc/sysconfigctdb by setting the following
619       variables:
620
621           # NAT-GW configuration
622           # Some services running on nthe CTDB node may need to originate traffic to
623           # remote servers before the node is assigned any IP addresses,
624           # This is problematic since before the node has public addresses the node might
625           # not be able to route traffic to the public networks.
626           # One solution is to have static public addresses assigned with routing
627           # in addition to the public address interfaces, thus guaranteeing that
628           # a node always can route traffic to the external network.
629           # This is the most simple solution but it uses up a large number of
630           # additional ip addresses.
631           #
632           # A more complex solution is NAT-GW.
633           # In this mode we only need one additional ip address for the cluster from
634           # the exsternal public network.
635           # One of the nodes in the cluster is elected to be hosting this ip address
636           # so it can reach the external services. This node is also configured
637           # to use NAT MASQUERADING for all traffic from the internal private network
638           # to the external network. This node is the NAT-GW node.
639           #
640           # All other nodes are set up with a default rote with a metric of 10 to point
641           # to the nat-gw node.
642           #
643           # The effect of this is that only when a node does not have a public address
644           # and thus no proper routes to the external world it will instead
645           # route all packets through the nat-gw node.
646           #
647           # CTDB_NATGW_NODES is the list of nodes that belong to this natgw group.
648           # You can have multiple natgw groups in one cluster but each node
649           # can only belong to one single natgw group.
650           #
651           # CTDB_NATGW_PUBLIC_IP=10.0.0.227/24
652           # CTDB_NATGW_PUBLIC_IFACE=eth0
653           # CTDB_NATGW_DEFAULT_GATEWAY=10.0.0.1
654           # CTDB_NATGW_PRIVATE_NETWORK=10.1.1.0/24
655           # CTDB_NATGW_NODES=/etc/ctdb/natgw_nodes
656
657
658   CTDB_NATGW_PUBLIC_IP
659       This is an ip address in the public network that is used for all
660       outgoing traffic when the public addresses are not assigned. This
661       address will be assigned to one of the nodes in the cluster which will
662       masquerade all traffic for the other nodes.
663
664       Format of this parameter is IPADDRESS/NETMASK
665
666   CTDB_NATGW_PUBLIC_IFACE
667       This is the physical interface where the CTDB_NATGW_PUBLIC_IP will be
668       assigned to. This should be an interface connected to the public
669       network.
670
671       Format of this parameter is INTERFACE
672
673   CTDB_NATGW_DEFAULT_GATEWAY
674       This is the default gateway to use on the node that is elected to host
675       the CTDB_NATGW_PUBLIC_IP. This is the default gateway on the public
676       network.
677
678       Format of this parameter is IPADDRESS
679
680   CTDB_NATGW_PRIVATE_NETWORK
681       This is the network/netmask used for the interal private network.
682
683       Format of this parameter is IPADDRESS/NETMASK
684
685   CTDB_NATGW_NODES
686       This is the list of all nodes that belong to the same NATGW group as
687       this node. The default is /etc/ctdb/natgw_nodes.
688
689   Operation
690       When the NAT-GW functionality is used, one of the nodes is elected to
691       act as a NAT router for all the other nodes in the group when they need
692       to originate traffic to the external public network.
693
694       The NAT-GW node is assigned the CTDB_NATGW_PUBLIC_IP to the designated
695       interface and the provided default route. The NAT-GW is configured to
696       act as a router and to masquerade all traffic it receives from the
697       internal private network and which is destined to the external
698       network(s).
699
700       All other nodes in the group are configured with a default route of
701       metric 10 pointing to the designated NAT GW node.
702
703       This is implemented in the 11.natgw eventscript. Please see the
704       eventscript for further information.
705
706   Removing/Changing NATGW at runtime
707       The following are the procedures to change/remove a NATGW configuration
708       at runtime, without having to restart ctdbd.
709
710       If you want to remove NATGW completely from a node, use these steps:
711
712           1, Run ´CTDB_BASE=/etc/ctdb /etc/ctdb/events.d/11.natgw removenatgw´
713           2, Then remove the configuration from /etc/sysconfig/ctdb
714
715
716       If you want to change the NATGW configuration on a node :
717
718           1, Run ´CTDB_BASE=/etc/ctdb /etc/ctdb/events.d/11.natgw removenatgw´
719           2, Then change the configuration in /etc/sysconfig/ctdb
720           3, Run ´CTDB_BASE=/etc/ctdb /etc/ctdb/events.d/11.natgw updatenatgw´
721
722

NOTIFICATION SCRIPT

724       Notification scripts are used with ctdb to have a call-out from ctdb to
725       a user-specified script when certain state changes occur in ctdb. This
726       is commonly to set up either sending SNMP traps or emails when a node
727       becomes unhealthy and similar.
728
729       This is activated by setting CTDB_NOTIFY_SCRIPT=<your script> in the
730       sysconfig file, or by adding --notification-script=<your script>.
731
732       See /etc/ctdb/notify.sh for an example script.
733
734       CTDB currently generates notifications on these state changes:
735
736   unhealthy
737       This call-out is triggered when the node changes to UNHEALTHY state.
738
739   healthy
740       This call-out is triggered when the node changes to HEALTHY state.
741
742   startup
743       This call-out is triggered when ctdb has started up and all managed
744       services are up and running.
745

CLAMAV DAEMON

747       CTDB has support to manage the popular anti-virus daemon ClamAV. This
748       support is implemented through the eventscript :
749       /etc/ctdb/events.d/31.clamd.
750
751   Configuration
752       Start by configuring CLAMAV normally and test that it works. Once this
753       is done, copy the configuration files over to all the nodes so that all
754       nodes share identical CLAMAV configurations. Once this is done you can
755       proceed with the intructions below to activate CTDB support for CLAMAV.
756
757       First, to activate CLAMAV support in CTDB, edit /etc/sysconfig/ctdb and
758       add the two lines :
759
760           CTDB_MANAGES_CLAMD=yes
761           CTDB_CLAMD_SOCKET="/path/to/clamd.socket"
762
763       Second, activate the eventscript
764
765           ctdb enablescript 31.clamd
766
767       Third, CTDB will now be starting and stopping this service accordingly,
768       so make sure that the system is not configured to start/stop this
769       service automatically. On RedHat systems you can disable the system
770       starting/stopping CLAMAV automatically by running :
771
772           chkconfig clamd off
773
774       Once you have restarted CTDBD, use
775
776           ctdb scriptstatus
777
778       and verify that the 31.clamd eventscript is listed and that it was
779       executed successfully.
780

SEE ALSO

782       ctdb(1), onnode(1) http://ctdb.samba.org/
783

COPYRIGHT/LICENSE

785           Copyright (C) Andrew Tridgell 2007
786           Copyright (C) Ronnie sahlberg 2007
787
788           This program is free software; you can redistribute it and/or modify
789           it under the terms of the GNU General Public License as published by
790           the Free Software Foundation; either version 3 of the License, or (at
791           your option) any later version.
792
793           This program is distributed in the hope that it will be useful, but
794           WITHOUT ANY WARRANTY; without even the implied warranty of
795           MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
796           General Public License for more details.
797
798           You should have received a copy of the GNU General Public License
799           along with this program; if not, see http://www.gnu.org/licenses/.
800
801
802
803                                  12/04/2009                          CTDBD(1)
Impressum