ctdb-tools: Add -x option to specify delimiter for machine readable output
[Samba.git] / ctdb / doc / ctdb.1.xml
blobb57e595c5c3dad224efc0f2c942abd7cefc42279
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry
3         PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
4         "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
5 <refentry id="ctdb.1">
7   <refentryinfo>
8     <author>
9       <contrib>
10         This documentation was written by
11         Ronnie Sahlberg,
12         Amitay Isaacs,
13         Martin Schwenke
14       </contrib>
15     </author>
17     <copyright>
18       <year>2007</year>
19       <holder>Andrew Tridgell</holder>
20       <holder>Ronnie Sahlberg</holder>
21     </copyright>
22     <legalnotice>
23       <para>
24         This program is free software; you can redistribute it and/or
25         modify it under the terms of the GNU General Public License as
26         published by the Free Software Foundation; either version 3 of
27         the License, or (at your option) any later version.
28       </para>
29       <para>
30         This program is distributed in the hope that it will be
31         useful, but WITHOUT ANY WARRANTY; without even the implied
32         warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
33         PURPOSE.  See the GNU General Public License for more details.
34       </para>
35       <para>
36         You should have received a copy of the GNU General Public
37         License along with this program; if not, see
38         <ulink url="http://www.gnu.org/licenses"/>.
39       </para>
40     </legalnotice>
41   </refentryinfo>
43   <refmeta>
44     <refentrytitle>ctdb</refentrytitle>
45     <manvolnum>1</manvolnum>
46     <refmiscinfo class="source">ctdb</refmiscinfo>
47     <refmiscinfo class="manual">CTDB - clustered TDB database</refmiscinfo>
48   </refmeta>
50   <refnamediv>
51     <refname>ctdb</refname>
52     <refpurpose>CTDB management utility</refpurpose>
53   </refnamediv>
55   <refsynopsisdiv>
56     <cmdsynopsis>
57       <command>ctdb</command>
58       <arg rep="repeat"><replaceable>OPTION</replaceable></arg>
59       <arg choice="req"><replaceable>COMMAND</replaceable></arg>
60       <arg choice="opt"><replaceable>COMMAND-ARGS</replaceable></arg>
61     </cmdsynopsis>
62   </refsynopsisdiv>
64   <refsect1>
65     <title>DESCRIPTION</title>
66     <para>
67       ctdb is a utility to view and manage a CTDB cluster.
68     </para>
70     <para>
71       The following terms are used when referring to nodes in a
72       cluster:
73       <variablelist>
74         <varlistentry>
75           <term>PNN</term>
76           <listitem>
77             <para>
78               Physical Node Number.  The physical node number is an
79               integer that describes the node in the cluster. The
80               first node has physical node number 0.  in a cluster.
81             </para>
82           </listitem>
83         </varlistentry>
84         <varlistentry>
85           <term>PNN-LIST</term>
86           <listitem>
87             <para>
88               This is either a single PNN, a comma-separate list of PNNs
89               or "all".
90             </para>
91           </listitem>
92         </varlistentry>
93       </variablelist>
94     </para>
96     <para>
97       Commands that reference a database use the following terms:
98       <variablelist>
99         <varlistentry>
100           <term>DB</term>
101           <listitem>
102             <para>
103               This is either a database name, such as
104               <filename>locking.tdb</filename> or a database ID such
105               as "0x42fe72c5".
106             </para>
107           </listitem>
108         </varlistentry>
109         <varlistentry>
110           <term>DB-LIST</term>
111           <listitem>
112             <para>
113               A space separated list of at least one
114               <parameter>DB</parameter>.
115             </para>
116           </listitem>
117         </varlistentry>
118       </variablelist>
119     </para>
120   </refsect1>
122   <refsect1>
123     <title>OPTIONS</title>
125     <variablelist>
126       <varlistentry><term>-n <parameter>PNN-LIST</parameter></term>
127       <listitem>
128         <para>
129           The nodes specified by PNN-LIST should be queried for the
130           requested information.  Default is to query the daemon
131           running on the local host.
132         </para>
133       </listitem>
134       </varlistentry>
136       <varlistentry><term>-Y</term>
137       <listitem>
138         <para>
139           Produce output in machine readable form for easier parsing
140           by scripts. This uses a field delimiter of ':'.  Not all
141           commands support this option.
142         </para>
143       </listitem>
144       </varlistentry>
146       <varlistentry><term>-x <parameter>SEPARATOR</parameter></term>
147       <listitem>
148         <para>
149           Use SEPARATOR to delimit fields in machine readable output.
150           This implies -Y.
151         </para>
152       </listitem>
153       </varlistentry>
155       <varlistentry><term>-t <parameter>TIMEOUT</parameter></term>
156       <listitem>
157         <para>
158           Indicates that ctdb should wait up to TIMEOUT seconds for
159           a response to most commands sent to the CTDB daemon.  The
160           default is 10 seconds.
161         </para>
162       </listitem>
163       </varlistentry>
165       <varlistentry><term>-T <parameter>TIMELIMIT</parameter></term>
166       <listitem>
167         <para>
168           Indicates that TIMELIMIT is the maximum run time (in
169           seconds) for the ctdb command.  When TIMELIMIT is exceeded
170           the ctdb command will terminate with an error.  The default
171           is 120 seconds.
172         </para>
173       </listitem>
174       </varlistentry>
176       <varlistentry><term>-? --help</term>
177       <listitem>
178         <para>
179           Print some help text to the screen.
180         </para>
181       </listitem>
182       </varlistentry>
184       <varlistentry><term>--usage</term>
185       <listitem>
186         <para>
187           Print useage information to the screen.
188         </para>
189       </listitem>
190       </varlistentry>
192       <varlistentry><term>-d --debug=<parameter>DEBUGLEVEL</parameter></term>
193       <listitem>
194         <para>
195           Change the debug level for the command. Default is ERR (0).
196         </para>
197       </listitem>
198       </varlistentry>
200       <varlistentry><term>--socket=<parameter>FILENAME</parameter></term>
201       <listitem>
202         <para>
203           Specify that FILENAME is the name of the Unix domain
204           socket to use when connecting to the local CTDB
205           daemon. The default is
206           <filename>/tmp/ctdb.socket</filename>.
207         </para>
208       </listitem>
209       </varlistentry>
210     </variablelist>
211   </refsect1>
214   <refsect1>
215     <title>ADMINISTRATIVE COMMANDS</title>
216     <para>
217       These are commands used to monitor and administer a CTDB cluster.
218     </para>
220     <refsect2>
221       <title>pnn</title>
222       <para>
223         This command displays the PNN of the current node.
224       </para>
225     </refsect2>
227     <refsect2>
228       <title>xpnn</title>
229       <para>
230         This command displays the PNN of the current node without
231         contacting the CTDB daemon.  It parses the nodes file
232         directly, so can produce unexpected output if the nodes file
233         has been edited but has not been reloaded.
234       </para>
235     </refsect2>
237     <refsect2>
238       <title>status</title>
239       <para>
240         This command shows the current status of all CTDB nodes based
241         on information from the queried node.
242       </para>
244       <para>
245         Note: If the the queried node is INACTIVE then the status
246         might not be current.
247       </para>
249       <refsect3>
250         <title>Node status</title>
251         <para>
252           This includes the number of physical nodes and the status of
253           each node.  See <citerefentry><refentrytitle>ctdb</refentrytitle>
254           <manvolnum>7</manvolnum></citerefentry> for information
255           about node states.
256         </para>
257       </refsect3>
259       <refsect3>
260         <title>Generation</title>
261         <para>
262           The generation id is a number that indicates the current generation 
263           of a cluster instance. Each time a cluster goes through a 
264           reconfiguration or a recovery its generation id will be changed.
265         </para>
266         <para>
267           This number does not have any particular meaning other than
268           to keep track of when a cluster has gone through a
269           recovery. It is a random number that represents the current
270           instance of a ctdb cluster and its databases.  The CTDB
271           daemon uses this number internally to be able to tell when
272           commands to operate on the cluster and the databases was
273           issued in a different generation of the cluster, to ensure
274           that commands that operate on the databases will not survive
275           across a cluster database recovery.  After a recovery, all
276           old outstanding commands will automatically become invalid.
277         </para>
278         <para>
279           Sometimes this number will be shown as "INVALID". This only means that
280           the ctdbd daemon has started but it has not yet merged with the cluster through a recovery.
281           All nodes start with generation "INVALID" and are not assigned a real
282           generation id until they have successfully been merged with a cluster
283           through a recovery.
284         </para>
285       </refsect3>
287       <refsect3>
288         <title>Virtual Node Number (VNN) map</title>
289         <para>
290           Consists of the number of virtual nodes and mapping from
291           virtual node numbers to physical node numbers.  Virtual
292           nodes host CTDB databases.  Only nodes that are
293           participating in the VNN map can become lmaster or dmaster
294           for database records.
295         </para>
296       </refsect3>
298       <refsect3>
299         <title>Recovery mode</title>
300         <para>
301           This is the current recovery mode of the cluster. There are two possible modes:
302         </para>
303         <para>
304           NORMAL - The cluster is fully operational.
305         </para>
306         <para>
307           RECOVERY - The cluster databases have all been frozen, pausing all services while the cluster awaits a recovery process to complete. A recovery process should finish within seconds. If a cluster is stuck in the RECOVERY state this would indicate a cluster malfunction which needs to be investigated.
308         </para>
309         <para>
310           Once the recovery master detects an inconsistency, for example a node 
311           becomes disconnected/connected, the recovery daemon will trigger a 
312           cluster recovery process, where all databases are remerged across the
313           cluster. When this process starts, the recovery master will first
314           "freeze" all databases to prevent applications such as samba from 
315           accessing the databases and it will also mark the recovery mode as
316           RECOVERY.
317         </para>
318         <para>
319           When the CTDB daemon starts up, it will start in RECOVERY
320           mode.  Once the node has been merged into a cluster and all
321           databases have been recovered, the node mode will change into
322           NORMAL mode and the databases will be "thawed", allowing samba
323           to access the databases again.
324         </para>
325       </refsect3>
326       <refsect3>
327         <title>Recovery master</title>
328         <para>
329           This is the cluster node that is currently designated as the recovery master. This node is responsible of monitoring the consistency of the cluster and to perform the actual recovery process when reqired.
330         </para>
331         <para>
332           Only one node at a time can be the designated recovery master. Which
333           node is designated the recovery master is decided by an election
334           process in the recovery daemons running on each node.
335         </para>
336       </refsect3>
338       <refsect3>
339         <title>Example</title>
340         <screen>
341 # ctdb status
342 Number of nodes:4
343 pnn:0 192.168.2.200       OK (THIS NODE)
344 pnn:1 192.168.2.201       OK
345 pnn:2 192.168.2.202       OK
346 pnn:3 192.168.2.203       OK
347 Generation:1362079228
348 Size:4
349 hash:0 lmaster:0
350 hash:1 lmaster:1
351 hash:2 lmaster:2
352 hash:3 lmaster:3
353 Recovery mode:NORMAL (0)
354 Recovery master:0
355         </screen>
356       </refsect3>
357     </refsect2>
359     <refsect2>
360       <title>nodestatus <optional><parameter>PNN-LIST</parameter></optional></title>
361       <para>
362         This command is similar to the <command>status</command>
363         command.  It displays the "node status" subset of output.  The
364         main differences are:
365       </para>
367       <itemizedlist>
368         <listitem>
369           <para>
370             The exit code is the bitwise-OR of the flags for each
371             specified node, while <command>ctdb status</command> exits
372             with 0 if it was able to retrieve status for all nodes.
373           </para>
374         </listitem>
376         <listitem>
377           <para>
378             <command>ctdb status</command> provides status information
379             for all nodes.  <command>ctdb nodestatus</command>
380             defaults to providing status for only the current node.
381             If PNN-LIST is provided then status is given for
382             the indicated node(s).
383           </para>
385           <para>
386             By default, <command>ctdb nodestatus</command> gathers
387             status from the local node.  However, if invoked with "-n
388             all" (or similar) then status is gathered from the given
389             node(s).  In particular <command>ctdb nodestatus
390             all</command> and <command>ctdb nodestatus -n
391             all</command> will produce different output.  It is
392             possible to provide 2 different nodespecs (with and
393             without "-n") but the output is usually confusing!
394           </para>
395         </listitem>
396       </itemizedlist>
398       <para>
399         A common invocation in scripts is <command>ctdb nodestatus
400         all</command> to check whether all nodes in a cluster are
401         healthy.
402       </para>
404       <refsect3>
405         <title>Example</title>
406         <screen>
407 # ctdb nodestatus
408 pnn:0 10.0.0.30        OK (THIS NODE)
410 # ctdb nodestatus all
411 Number of nodes:2
412 pnn:0 10.0.0.30        OK (THIS NODE)
413 pnn:1 10.0.0.31        OK
414         </screen>
415       </refsect3>
416     </refsect2>
418     <refsect2>
419       <title>recmaster</title>
420       <para>
421         This command shows the pnn of the node which is currently the recmaster.
422       </para>
424       <para>
425         Note: If the the queried node is INACTIVE then the status
426         might not be current.
427       </para>
428     </refsect2>
430     <refsect2>
431       <title>uptime</title>
432       <para>
433         This command shows the uptime for the ctdb daemon. When the last recovery or ip-failover completed and how long it took. If the "duration" is shown as a negative number, this indicates that there is a recovery/failover in progress and it started that many seconds ago.
434       </para>
436       <refsect3>
437         <title>Example</title>
438         <screen>
439 # ctdb uptime
440 Current time of node          :                Thu Oct 29 10:38:54 2009
441 Ctdbd start time              : (000 16:54:28) Wed Oct 28 17:44:26 2009
442 Time of last recovery/failover: (000 16:53:31) Wed Oct 28 17:45:23 2009
443 Duration of last recovery/failover: 2.248552 seconds
444         </screen>
445       </refsect3>
446     </refsect2>
448     <refsect2>
449       <title>listnodes</title>
450       <para>
451         This command shows lists the ip addresses of all the nodes in the cluster.
452       </para>
454       <refsect3>
455         <title>Example</title>
456         <screen>
457 # ctdb listnodes
458 192.168.2.200
459 192.168.2.201
460 192.168.2.202
461 192.168.2.203
462         </screen>
463       </refsect3>
464     </refsect2>
466     <refsect2>
467       <title>natgwlist</title>
468       <para>
469         Show the current NAT gateway master and the status of all
470         nodes in the current NAT gateway group.  See the
471         <citetitle>NAT GATEWAY</citetitle> section in
472         <citerefentry><refentrytitle>ctdb</refentrytitle>
473         <manvolnum>7</manvolnum></citerefentry> for more details.
474       </para>
476       <refsect3>
477         <title>Example</title>
478         <screen>
479 # ctdb natgwlist
480 0 192.168.2.200
481 Number of nodes:4
482 pnn:0 192.168.2.200       OK (THIS NODE)
483 pnn:1 192.168.2.201       OK
484 pnn:2 192.168.2.202       OK
485 pnn:3 192.168.2.203       OK
486         </screen>
487       </refsect3>
488     </refsect2>
490     <refsect2>
491       <title>ping</title>
492       <para>
493         This command will "ping" specified CTDB nodes in the cluster
494         to verify that they are running.
495       </para>
496       <refsect3>
497         <title>Example</title>
498         <screen>
499 # ctdb ping -n all
500 response from 0 time=0.000054 sec  (3 clients)
501 response from 1 time=0.000144 sec  (2 clients)
502 response from 2 time=0.000105 sec  (2 clients)
503 response from 3 time=0.000114 sec  (2 clients)
504         </screen>
505       </refsect3>
506     </refsect2>
508     <refsect2>
509       <title>ifaces</title>
510       <para>
511         This command will display the list of network interfaces, which could
512         host public addresses, along with their status.
513       </para>
514       <refsect3>
515         <title>Example</title>
516         <screen>
517 # ctdb ifaces
518 Interfaces on node 0
519 name:eth5 link:up references:2
520 name:eth4 link:down references:0
521 name:eth3 link:up references:1
522 name:eth2 link:up references:1
524 # ctdb ifaces -Y
525 :Name:LinkStatus:References:
526 :eth5:1:2
527 :eth4:0:0
528 :eth3:1:1
529 :eth2:1:1
530         </screen>
531       </refsect3>
532     </refsect2>
534     <refsect2>
535       <title>ip</title>
536       <para>
537         This command will display the list of public addresses that are provided by the cluster and which physical node is currently serving this ip. By default this command will ONLY show those public addresses that are known to the node itself. To see the full list of all public ips across the cluster you must use "ctdb ip -n all".
538       </para>
539       <refsect3>
540         <title>Example</title>
541         <screen>
542 # ctdb ip
543 Public IPs on node 0
544 172.31.91.82 node[1] active[] available[eth2,eth3] configured[eth2,eth3]
545 172.31.91.83 node[0] active[eth3] available[eth2,eth3] configured[eth2,eth3]
546 172.31.91.84 node[1] active[] available[eth2,eth3] configured[eth2,eth3]
547 172.31.91.85 node[0] active[eth2] available[eth2,eth3] configured[eth2,eth3]
548 172.31.92.82 node[1] active[] available[eth5] configured[eth4,eth5]
549 172.31.92.83 node[0] active[eth5] available[eth5] configured[eth4,eth5]
550 172.31.92.84 node[1] active[] available[eth5] configured[eth4,eth5]
551 172.31.92.85 node[0] active[eth5] available[eth5] configured[eth4,eth5]
553 # ctdb ip -Y
554 :Public IP:Node:ActiveInterface:AvailableInterfaces:ConfiguredInterfaces:
555 :172.31.91.82:1::eth2,eth3:eth2,eth3:
556 :172.31.91.83:0:eth3:eth2,eth3:eth2,eth3:
557 :172.31.91.84:1::eth2,eth3:eth2,eth3:
558 :172.31.91.85:0:eth2:eth2,eth3:eth2,eth3:
559 :172.31.92.82:1::eth5:eth4,eth5:
560 :172.31.92.83:0:eth5:eth5:eth4,eth5:
561 :172.31.92.84:1::eth5:eth4,eth5:
562 :172.31.92.85:0:eth5:eth5:eth4,eth5:
563         </screen>
564       </refsect3>
565     </refsect2>
567     <refsect2>
568       <title>ipinfo <parameter>IP</parameter></title>
569       <para>
570         This command will display details about the specified public addresses.
571       </para>
572       <refsect3>
573         <title>Example</title>
574         <screen>
575 # ctdb ipinfo 172.31.92.85
576 Public IP[172.31.92.85] info on node 0
577 IP:172.31.92.85
578 CurrentNode:0
579 NumInterfaces:2
580 Interface[1]: Name:eth4 Link:down References:0
581 Interface[2]: Name:eth5 Link:up References:2 (active)
582         </screen>
583       </refsect3>
584     </refsect2>
586     <refsect2>
587       <title>scriptstatus</title>
588       <para>
589         This command displays which scripts where run in the previous monitoring cycle and the result of each script. If a script failed with an error, causing the node to become unhealthy, the output from that script is also shown.
590       </para>
591       <refsect3>
592         <title>Example</title>
593         <screen>
594 # ctdb scriptstatus
595 7 scripts were executed last monitoring cycle
596 00.ctdb              Status:OK    Duration:0.056 Tue Mar 24 18:56:57 2009
597 10.interface         Status:OK    Duration:0.077 Tue Mar 24 18:56:57 2009
598 11.natgw             Status:OK    Duration:0.039 Tue Mar 24 18:56:57 2009
599 20.multipathd        Status:OK    Duration:0.038 Tue Mar 24 18:56:57 2009
600 31.clamd             Status:DISABLED
601 40.vsftpd            Status:OK    Duration:0.045 Tue Mar 24 18:56:57 2009
602 41.httpd             Status:OK    Duration:0.039 Tue Mar 24 18:56:57 2009
603 50.samba             Status:ERROR    Duration:0.082 Tue Mar 24 18:56:57 2009
604 OUTPUT:ERROR: Samba tcp port 445 is not responding
605       </screen>
606       </refsect3>
607     </refsect2>
609     <refsect2>
610       <title>disablescript <parameter>SCRIPT</parameter></title>
611       <para>
612         This command is used to disable an eventscript.
613       </para>
614       <para>
615         This will take effect the next time the eventscripts are being executed so it can take a short while until this is reflected in 'scriptstatus'.
616       </para>
617     </refsect2>
619     <refsect2>
620       <title>enablescript <parameter>SCRIPT</parameter></title>
621       <para>
622         This command is used to enable an eventscript.
623       </para>
624       <para>
625         This will take effect the next time the eventscripts are being executed so it can take a short while until this is reflected in 'scriptstatus'.
626       </para>
627     </refsect2>
629     <refsect2>
630       <title>listvars</title>
631       <para>
632         List all tuneable variables, except the values of the obsolete tunables
633         like VacuumMinInterval. The obsolete tunables can be retrieved only
634         explicitly with the "ctdb getvar" command.
635       </para>
636       <refsect3>
637         <title>Example</title>
638         <screen>
639 # ctdb listvars
640 MaxRedirectCount        = 3
641 SeqnumInterval          = 1000
642 ControlTimeout          = 60
643 TraverseTimeout         = 20
644 KeepaliveInterval       = 5
645 KeepaliveLimit          = 5
646 RecoverTimeout          = 20
647 RecoverInterval         = 1
648 ElectionTimeout         = 3
649 TakeoverTimeout         = 9
650 MonitorInterval         = 15
651 TickleUpdateInterval    = 20
652 EventScriptTimeout      = 30
653 EventScriptTimeoutCount = 1
654 RecoveryGracePeriod     = 120
655 RecoveryBanPeriod       = 300
656 DatabaseHashSize        = 100001
657 DatabaseMaxDead         = 5
658 RerecoveryTimeout       = 10
659 EnableBans              = 1
660 DeterministicIPs        = 0
661 LCP2PublicIPs           = 1
662 ReclockPingPeriod       = 60
663 NoIPFailback            = 0
664 DisableIPFailover       = 0
665 VerboseMemoryNames      = 0
666 RecdPingTimeout         = 60
667 RecdFailCount           = 10
668 LogLatencyMs            = 0
669 RecLockLatencyMs        = 1000
670 RecoveryDropAllIPs      = 120
671 VerifyRecoveryLock      = 1
672 VacuumInterval          = 10
673 VacuumMaxRunTime        = 30
674 RepackLimit             = 10000
675 VacuumLimit             = 5000
676 VacuumFastPathCount     = 60
677 MaxQueueDropMsg         = 1000000
678 UseStatusEvents         = 0
679 AllowUnhealthyDBRead    = 0
680 StatHistoryInterval     = 1
681 DeferredAttachTO        = 120
682 AllowClientDBAttach     = 1
683 RecoverPDBBySeqNum      = 0
684         </screen>
685       </refsect3>
686     </refsect2>
688     <refsect2>
689       <title>getvar <parameter>NAME</parameter></title>
690       <para>
691         Get the runtime value of a tuneable variable.
692       </para>
693       <refsect3>
694         <title>Example</title>
695         <screen>
696 # ctdb getvar MaxRedirectCount
697 MaxRedirectCount    = 3
698         </screen>
699       </refsect3>
700     </refsect2>
702     <refsect2>
703       <title>setvar <parameter>NAME</parameter> <parameter>VALUE</parameter></title>
704       <para>
705         Set the runtime value of a tuneable variable.
706       </para>
707       <para>
708         Example: ctdb setvar MaxRedirectCount 5
709       </para>
710     </refsect2>
712     <refsect2>
713       <title>lvsmaster</title>
714       <para>
715         This command shows which node is currently the LVSMASTER. The
716         LVSMASTER is the node in the cluster which drives the LVS system and
717         which receives all incoming traffic from clients.
718       </para>
719       <para>
720         LVS is the mode where the entire CTDB/Samba cluster uses a single
721         ip address for the entire cluster. In this mode all clients connect to
722         one specific node which will then multiplex/loadbalance the clients
723         evenly onto the other nodes in the cluster. This is an alternative to using
724         public ip addresses. See the manpage for ctdbd for more information
725         about LVS.
726       </para>
727     </refsect2>
729     <refsect2>
730       <title>lvs</title>
731       <para>
732         This command shows which nodes in the cluster are currently active in the
733         LVS configuration. I.e. which nodes we are currently loadbalancing
734         the single ip address across.
735       </para>
737       <para>
738         LVS will by default only loadbalance across those nodes that are both
739         LVS capable and also HEALTHY. Except if all nodes are UNHEALTHY in which
740         case LVS will loadbalance across all UNHEALTHY nodes as well.
741         LVS will never use nodes that are DISCONNECTED, STOPPED, BANNED or
742         DISABLED.
743       </para>
745       <para>
746         Example output:
747       </para>
748       <screen>
749 2:10.0.0.13
750 3:10.0.0.14
751       </screen>
753     </refsect2>
756     <refsect2>
757       <title>getcapabilities</title>
759       <para>
760         This command shows the capabilities of the current node.  See
761         the <citetitle>CAPABILITIES</citetitle> section in
762         <citerefentry><refentrytitle>ctdb</refentrytitle>
763         <manvolnum>7</manvolnum></citerefentry> for more details.
764       </para>
766       <para>
767         Example output:
768       </para>
769       <screen>
770 RECMASTER: YES
771 LMASTER: YES
772 LVS: NO
773 NATGW: YES
774       </screen>
776     </refsect2>
778     <refsect2>
779       <title>statistics</title>
780       <para>
781         Collect statistics from the CTDB daemon about
782         how many calls it has served.  Information about
783         various fields in statistics can be found in
784         <citerefentry><refentrytitle>ctdb-statistics</refentrytitle>
785         <manvolnum>7</manvolnum></citerefentry>.
786       </para>
787       <refsect3>
788         <title>Example</title>
789         <screen>
790 # ctdb statistics
791 CTDB version 1
792 num_clients                        3
793 frozen                             0
794 recovering                         0
795 client_packets_sent           360489
796 client_packets_recv           360466
797 node_packets_sent             480931
798 node_packets_recv             240120
799 keepalive_packets_sent             4
800 keepalive_packets_recv             3
801 node
802 req_call                       2
803 reply_call                     2
804 req_dmaster                    0
805 reply_dmaster                  0
806 reply_error                    0
807 req_message                   42
808 req_control               120408
809 reply_control             360439
810 client
811 req_call                       2
812 req_message                   24
813 req_control               360440
814 timeouts
815 call                           0
816 control                        0
817 traverse                       0
818 total_calls                        2
819 pending_calls                      0
820 lockwait_calls                     0
821 pending_lockwait_calls             0
822 memory_used                     5040
823 max_hop_count                      0
824 max_call_latency                   4.948321 sec
825 max_lockwait_latency               0.000000 sec
826         </screen>
827       </refsect3>
828     </refsect2>
830     <refsect2>
831       <title>statisticsreset</title>
832       <para>
833         This command is used to clear all statistics counters in a node.
834       </para>
835       <para>
836         Example: ctdb statisticsreset
837       </para>
838     </refsect2>
840     <refsect2>
841       <title>dbstatistics <parameter>DB</parameter></title>
842       <para>
843         Display statistics about the database DB.  Information
844         about various fields in dbstatistics can be found in
845         <citerefentry><refentrytitle>ctdb-statistics</refentrytitle>
846         <manvolnum>7</manvolnum></citerefentry>.
847       </para>
848       <refsect3>
849         <title>Example</title>
850         <screen>
851 # ctdb dbstatistics locking.tdb
852 DB Statistics: locking.tdb
853  ro_delegations                     0
854  ro_revokes                         0
855  locks
856      total                      14356
857      failed                         0
858      current                        0
859      pending                        0
860  hop_count_buckets: 28087 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0
861  lock_buckets: 0 14188 38 76 32 19 3 0 0 0 0 0 0 0 0 0
862  locks_latency      MIN/AVG/MAX     0.001066/0.012686/4.202292 sec out of 14356
863  Num Hot Keys:     1
864      Count:8 Key:ff5bd7cb3ee3822edc1f0000000000000000000000000000
865         </screen>
866       </refsect3>
867     </refsect2>
869     <refsect2>
870       <title>getreclock</title>
871       <para>
872         This command is used to show the filename of the reclock file that is used.
873       </para>
875       <para>
876         Example output:
877       </para>
878       <screen>
879         Reclock file:/gpfs/.ctdb/shared
880       </screen>
882     </refsect2>
884     <refsect2>
885       <title>setreclock [filename]</title>
886       <para>
887         This command is used to modify, or clear, the file that is used as the reclock file at runtime. When this command is used, the reclock file checks are disabled. To re-enable the checks the administrator needs to activate the "VerifyRecoveryLock" tunable using "ctdb setvar".
888       </para>
890       <para>
891         If run with no parameter this will remove the reclock file completely. If run with a parameter the parameter specifies the new filename to use for the recovery lock.
892       </para>
894       <para>
895         This command only affects the runtime settings of a ctdb node and will be lost when ctdb is restarted. For persistent changes to the reclock file setting you must edit /etc/sysconfig/ctdb.
896       </para>
897     </refsect2>
901     <refsect2>
902       <title>getdebug</title>
903       <para>
904         Get the current debug level for the node. the debug level controls what information is written to the log file.
905       </para>
906       <para>
907         The debug levels are mapped to the corresponding syslog levels.
908         When a debug level is set, only those messages at that level and higher
909         levels will be printed.
910       </para>
911       <para>
912         The list of debug levels from highest to lowest are :
913       </para>
914       <para>
915         ERR WARNING NOTICE INFO DEBUG
916       </para>
917     </refsect2>
919     <refsect2>
920       <title>setdebug <parameter>DEBUGLEVEL</parameter></title>
921       <para>
922         Set the debug level of a node. This controls what information will be logged.
923       </para>
924       <para>
925         The debuglevel is one of ERR WARNING NOTICE INFO DEBUG
926       </para>
927     </refsect2>
929     <refsect2>
930       <title>getpid</title>
931       <para>
932         This command will return the process id of the ctdb daemon.
933       </para>
934     </refsect2>
936     <refsect2>
937       <title>disable</title>
938       <para>
939         This command is used to administratively disable a node in the cluster.
940         A disabled node will still participate in the cluster and host
941         clustered TDB records but its public ip address has been taken over by
942         a different node and it no longer hosts any services.
943       </para>
944     </refsect2>
946     <refsect2>
947       <title>enable</title>
948       <para>
949         Re-enable a node that has been administratively disabled.
950       </para>
951     </refsect2>
953     <refsect2>
954       <title>stop</title>
955       <para>
956         This command is used to administratively STOP a node in the cluster.
957         A STOPPED node is connected to the cluster but will not host any
958         public ip addresse, nor does it participate in the VNNMAP.
959         The difference between a DISABLED node and a STOPPED node is that
960         a STOPPED node does not host any parts of the database which means
961         that a recovery is required to stop/continue nodes.
962       </para>
963     </refsect2>
965     <refsect2>
966       <title>continue</title>
967       <para>
968         Re-start a node that has been administratively stopped.
969       </para>
970     </refsect2>
972     <refsect2>
973       <title>addip <parameter>IPADDR</parameter>/<parameter>mask</parameter> <parameter>IFACE</parameter></title>
974       <para>
975         This command is used to add a new public ip to a node during runtime.
976         This allows public addresses to be added to a cluster without having
977         to restart the ctdb daemons.
978       </para>
979       <para>
980         Note that this only updates the runtime instance of ctdb. Any changes will be lost next time ctdb is restarted and the public addresses file is re-read.
981         If you want this change to be permanent you must also update the public addresses file manually.
982       </para>
983     </refsect2>
985     <refsect2>
986       <title>delip <parameter>IPADDR</parameter></title>
987       <para>
988         This command is used to remove a public ip from a node during runtime.
989         If this public ip is currently hosted by the node it being removed from, the ip will first be failed over to another node, if possible, before it is removed.
990       </para>
991       <para>
992         Note that this only updates the runtime instance of ctdb. Any changes will be lost next time ctdb is restarted and the public addresses file is re-read.
993         If you want this change to be permanent you must also update the public addresses file manually.
994       </para>
995     </refsect2>
997     <refsect2>
998       <title>moveip <parameter>IPADDR</parameter> <parameter>PNN</parameter></title>
999       <para>
1000         This command can be used to manually fail a public ip address to a
1001         specific node.
1002       </para>
1003       <para>
1004         In order to manually override the "automatic" distribution of public 
1005         ip addresses that ctdb normally provides, this command only works
1006         when you have changed the tunables for the daemon to:
1007       </para>
1008       <para>
1009         DeterministicIPs = 0
1010       </para>
1011       <para>
1012         NoIPFailback = 1
1013       </para>
1014     </refsect2>
1016     <refsect2>
1017       <title>shutdown</title>
1018       <para>
1019         This command will shutdown a specific CTDB daemon.
1020       </para>
1021     </refsect2>
1023     <refsect2>
1024       <title>setlmasterrole on|off</title>
1025       <para>
1026         This command is used ot enable/disable the LMASTER capability for a node at runtime. This capability determines whether or not a node can be used as an LMASTER for records in the database. A node that does not have the LMASTER capability will not show up in the vnnmap.
1027       </para>
1029       <para>
1030         Nodes will by default have this capability, but it can be stripped off nodes by the setting in the sysconfig file or by using this command.
1031       </para>
1032       <para>
1033         Once this setting has been enabled/disabled, you need to perform a recovery for it to take effect.
1034       </para>
1035       <para>
1036         See also "ctdb getcapabilities"
1037       </para>
1038     </refsect2>
1040     <refsect2>
1041       <title>setrecmasterrole on|off</title>
1042       <para>
1043         This command is used ot enable/disable the RECMASTER capability for a node at runtime. This capability determines whether or not a node can be used as an RECMASTER for the cluster. A node that does not have the RECMASTER capability can not win a recmaster election. A node that already is the recmaster for the cluster when the capability is stripped off the node will remain the recmaster until the next cluster election.
1044       </para>
1046       <para>
1047         Nodes will by default have this capability, but it can be stripped off nodes by the setting in the sysconfig file or by using this command.
1048       </para>
1049       <para>
1050         See also "ctdb getcapabilities"
1051       </para>
1052     </refsect2>
1054     <refsect2>
1055       <title>reloadnodes</title>
1056       <para>
1057         This command is used when adding new nodes, or removing existing nodes from an existing cluster.
1058       </para>
1059       <para>
1060         Procedure to add a node:
1061       </para>
1062       <para>
1063         1, To expand an existing cluster, first ensure with 'ctdb status' that
1064         all nodes are up and running and that they are all healthy.
1065         Do not try to expand a cluster unless it is completely healthy!
1066       </para>
1067       <para>
1068         2, On all nodes, edit /etc/ctdb/nodes and add the new node as the last
1069         entry to the file. The new node MUST be added to the end of this file!
1070       </para>
1071       <para>
1072         3, Verify that all the nodes have identical /etc/ctdb/nodes files after you edited them and added the new node!
1073       </para>
1074       <para>
1075         4, Run 'ctdb reloadnodes' to force all nodes to reload the nodesfile.
1076       </para>
1077       <para>
1078         5, Use 'ctdb status' on all nodes and verify that they now show the additional node.
1079       </para>
1080       <para>
1081         6, Install and configure the new node and bring it online.
1082       </para>
1083       <para>
1084         Procedure to remove a node:
1085       </para>
1086       <para>
1087         1, To remove a node from an existing cluster, first ensure with 'ctdb status' that
1088         all nodes, except the node to be deleted, are up and running and that they are all healthy.
1089         Do not try to remove a node from a cluster unless the cluster is completely healthy!
1090       </para>
1091       <para>
1092         2, Shutdown and poweroff the node to be removed.
1093       </para>
1094       <para>
1095         3, On all other nodes, edit the /etc/ctdb/nodes file and comment out the node to be removed. Do not delete the line for that node, just comment it out by adding a '#' at the beginning of the line.
1096       </para>
1097       <para>
1098         4, Run 'ctdb reloadnodes' to force all nodes to reload the nodesfile.
1099       </para>
1100       <para>
1101         5, Use 'ctdb status' on all nodes and verify that the deleted node no longer shows up in the list..
1102       </para>
1103       <para>
1104       </para>
1106     </refsect2>
1108     <refsect2>
1109       <title>
1110         reloadips
1111         <optional><parameter>PNN-LIST</parameter></optional>
1112       </title>
1113       <para>
1114         This command reloads the public addresses configuration file
1115         on the specified nodes.  When it completes addresses will be
1116         reconfigured and reassigned across the cluster as necessary.
1117       </para>
1118     </refsect2>
1120     <refsect2>
1121       <title>getdbmap</title>
1122       <para>
1123         This command lists all clustered TDB databases that the CTDB daemon has attached to. Some databases are flagged as PERSISTENT, this means that the database stores data persistently and the data will remain across reboots. One example of such a database is secrets.tdb where information about how the cluster was joined to the domain is stored.
1124       </para>
1125       <para>
1126         If a PERSISTENT database is not in a healthy state the database is
1127         flagged as UNHEALTHY. If there's at least one completely healthy node running in
1128         the cluster, it's possible that the content is restored by a recovery
1129         run automaticly. Otherwise an administrator needs to analyze the
1130         problem.
1131       </para>
1132       <para>
1133         See also "ctdb getdbstatus", "ctdb backupdb", "ctdb restoredb",
1134         "ctdb dumpbackup", "ctdb wipedb", "ctdb setvar AllowUnhealthyDBRead 1"
1135         and (if samba or tdb-utils are installed) "tdbtool check".
1136       </para>
1137       <para>
1138         Most databases are not persistent and only store the state information that the currently running samba daemons need. These databases are always wiped when ctdb/samba starts and when a node is rebooted.
1139       </para>
1141       <refsect3>
1142         <title>Example</title>
1143         <screen>
1144 # ctdb getdbmap
1145 Number of databases:10
1146 dbid:0x435d3410 name:notify.tdb path:/var/ctdb/notify.tdb.0 
1147 dbid:0x42fe72c5 name:locking.tdb path:/var/ctdb/locking.tdb.0
1148 dbid:0x1421fb78 name:brlock.tdb path:/var/ctdb/brlock.tdb.0 
1149 dbid:0x17055d90 name:connections.tdb path:/var/ctdb/connections.tdb.0 
1150 dbid:0xc0bdde6a name:sessionid.tdb path:/var/ctdb/sessionid.tdb.0 
1151 dbid:0x122224da name:test.tdb path:/var/ctdb/test.tdb.0 
1152 dbid:0x2672a57f name:idmap2.tdb path:/var/ctdb/persistent/idmap2.tdb.0 PERSISTENT
1153 dbid:0xb775fff6 name:secrets.tdb path:/var/ctdb/persistent/secrets.tdb.0 PERSISTENT
1154 dbid:0xe98e08b6 name:group_mapping.tdb path:/var/ctdb/persistent/group_mapping.tdb.0 PERSISTENT
1155 dbid:0x7bbbd26c name:passdb.tdb path:/var/ctdb/persistent/passdb.tdb.0 PERSISTENT
1157 # ctdb getdbmap  # example for unhealthy database
1158 Number of databases:1
1159 dbid:0xb775fff6 name:secrets.tdb path:/var/ctdb/persistent/secrets.tdb.0 PERSISTENT UNHEALTHY
1161 # ctdb -Y getdbmap
1162 :ID:Name:Path:Persistent:Unhealthy:
1163 :0x7bbbd26c:passdb.tdb:/var/ctdb/persistent/passdb.tdb.0:1:0:
1164         </screen>
1165       </refsect3>
1166     </refsect2>
1168     <refsect2>
1169       <title>
1170         backupdb
1171         <parameter>DB</parameter>
1172         <parameter>FILE</parameter>
1173       </title>
1174       <para>
1175         Copy the contents of database DB to FILE.  FILE can later be
1176         read back using <command>restoredb</command>.  This is mainly
1177         useful for backing up persistent databases such as
1178         <filename>secrets.tdb</filename> and similar.
1179       </para>
1180     </refsect2>
1182     <refsect2>
1183       <title>
1184         restoredb
1185         <parameter>FILE</parameter>
1186         <optional><parameter>DB</parameter></optional>
1187       </title>
1188       <para>
1189         This command restores a persistent database that was
1190         previously backed up using backupdb.  By default the data will
1191         be restored back into the same database as it was created
1192         from. By specifying dbname you can restore the data into a
1193         different database.
1194       </para>
1195     </refsect2>
1197     <refsect2>
1198       <title>setdbreadonly <parameter>DB</parameter></title>
1199       <para>
1200         This command will enable the read-only record support for a
1201         database.  This is an experimental feature to improve
1202         performance for contended records primarily in locking.tdb and
1203         brlock.tdb.  When enabling this feature you must set it on all
1204         nodes in the cluster.
1205       </para>
1206     </refsect2>
1208     <refsect2>
1209       <title>setdbsticky <parameter>DB</parameter></title>
1210       <para>
1211         This command will enable the sticky record support for the
1212         specified database.  This is an experimental feature to
1213         improve performance for contended records primarily in
1214         locking.tdb and brlock.tdb.  When enabling this feature you
1215         must set it on all nodes in the cluster.
1216       </para>
1217     </refsect2>
1219   </refsect1>
1221   <refsect1>
1222     <title>INTERNAL COMMANDS</title>
1224     <para>
1225       Internal commands are used by CTDB's scripts and are not
1226       required for managing a CTDB cluster.  Their parameters and
1227       behaviour are subject to change.
1228     </para>
1230     <refsect2>
1231       <title>gettickles <parameter>IPADDR</parameter></title>
1232       <para>
1233         Show TCP connections that are registered with CTDB to be
1234         "tickled" if there is a failover.
1235       </para>
1236     </refsect2>
1238     <refsect2>
1239       <title>gratiousarp <parameter>IPADDR</parameter> <parameter>INTERFACE</parameter></title>
1240       <para>
1241         Send out a gratious ARP for the specified interface through
1242         the specified interface. This command is mainly used by the
1243         ctdb eventscripts.
1244       </para>
1245     </refsect2>
1247     <refsect2>
1248       <title>killtcp</title>
1249       <para>
1250         Read a list of TCP connections, one per line, from standard
1251         input and terminate each connection.  A connection is
1252         specified as:
1253       </para>
1254       <synopsis>
1255         <parameter>SRC-IPADDR</parameter>:<parameter>SRC-PORT</parameter> <parameter>DST-IPADDR</parameter>:<parameter>DST-PORT</parameter>
1256       </synopsis>
1257       <para>
1258         Each connection is terminated by issuing a TCP RST to the
1259         SRC-IPADDR:SRC-PORT endpoint.
1260       </para>
1261       <para>
1262         A single connection can be specified on the command-line
1263         rather than on standard input.
1264       </para>
1265     </refsect2>
1267     <refsect2>
1268       <title>
1269         pdelete <parameter>DB</parameter> <parameter>KEY</parameter>
1270       </title>
1271       <para>
1272         Delete KEY from DB.
1273       </para>
1274     </refsect2>
1276     <refsect2>
1277       <title>
1278         pfetch <parameter>DB</parameter> <parameter>KEY</parameter>
1279       </title>
1280       <para>
1281         Print the value associated with KEY in DB.
1282       </para>
1283     </refsect2>
1285     <refsect2>
1286       <title>
1287         pstore
1288         <parameter>DB</parameter>
1289         <parameter>KEY</parameter>
1290         <parameter>FILE</parameter>
1291       </title>
1292       <para>
1293         Store KEY in DB with contents of FILE as the associated value.
1294       </para>
1295     </refsect2>
1297     <refsect2>
1298       <title>
1299         ptrans
1300         <parameter>DB</parameter>
1301         <optional><parameter>FILE</parameter></optional>
1302       </title>
1303       <para>
1304         Read a list of key-value pairs, one per line from FILE, and
1305         store them in DB using a single transaction.  An empty value
1306         is equivalent to deleting the given key.
1307       </para>
1308       <para>
1309         The key and value should be separated by spaces or tabs. Each
1310         key/value should be a printable string enclosed in
1311         double-quotes.
1312       </para>
1313     </refsect2>
1315     <refsect2>
1316       <title>runstate [setup|first_recovery|startup|running]</title>
1317       <para>
1318         Print the runstate of the specified node.  Runstates are used
1319         to serialise important state transitions in CTDB, particularly
1320         during startup.
1321       </para>
1322       <para>
1323         If one or more optional runstate arguments are specified then
1324         the node must be in one of these runstates for the command to
1325         succeed.
1326       </para>
1327       <refsect3>
1328         <title>Example</title>
1329         <screen>
1330 # ctdb runstate
1331 RUNNING
1332         </screen>
1333       </refsect3>
1334     </refsect2>
1336     <refsect2>
1337       <title>setifacelink <parameter>IFACE</parameter> up|down</title>
1338       <para>
1339         Set the internal state of network interface IFACE.  This is
1340         typically used in the <filename>10.interface</filename> script
1341         in the "monitor" event.
1342       </para>
1343       <para>
1344         Example: ctdb setifacelink eth0 up
1345       </para>
1346     </refsect2>
1348     <refsect2>
1349       <title>setnatgwstate on|off</title>
1350       <para>
1351         Enable or disable the NAT gateway master capability on a node.
1352       </para>
1353     </refsect2>
1355     <refsect2>
1356       <title>tickle <parameter>SRC-IPADDR</parameter>:<parameter>SRC-PORT</parameter> <parameter>DST-IPADDR</parameter>:<parameter>DST-PORT</parameter></title>
1357       <para>
1358         Send a TCP tickle to the source host for the specified TCP
1359         connection.  A TCP tickle is a TCP ACK packet with an invalid
1360         sequence and acknowledge number and will when received by the
1361         source host result in it sending an immediate correct ACK back
1362         to the other end.
1363       </para>
1364       <para>
1365         TCP tickles are useful to "tickle" clients after a IP failover has
1366         occured since this will make the client immediately recognize the
1367         TCP connection has been disrupted and that the client will need
1368         to reestablish. This greatly speeds up the time it takes for a client
1369         to detect and reestablish after an IP failover in the ctdb cluster.
1370       </para>
1371     </refsect2>
1373     <refsect2>
1374       <title>version</title>
1375       <para>
1376         Display the CTDB version.
1377       </para>
1378     </refsect2>
1380   </refsect1>
1382   <refsect1>
1383     <title>DEBUGGING COMMANDS</title>
1384     <para>
1385       These commands are primarily used for CTDB development and testing and
1386       should not be used for normal administration.
1387     </para>
1390     <refsect2>
1391       <title>OPTIONS</title>
1393       <variablelist>
1394         <varlistentry><term>--print-emptyrecords</term>
1395         <listitem>
1396           <para>
1397             This enables printing of empty records when dumping databases
1398             with the catdb, cattbd and dumpdbbackup commands. Records with
1399             empty data segment are considered deleted by ctdb and cleaned
1400             by the vacuuming mechanism, so this switch can come in handy for
1401             debugging the vacuuming behaviour.
1402           </para>
1403         </listitem>
1404         </varlistentry>
1406         <varlistentry><term>--print-datasize</term>
1407         <listitem>
1408           <para>
1409             This lets database dumps (catdb, cattdb, dumpdbbackup) print the
1410             size of the record data instead of dumping the data contents.
1411           </para>
1412         </listitem>
1413         </varlistentry>
1415         <varlistentry><term>--print-lmaster</term>
1416         <listitem>
1417           <para>
1418             This lets catdb print the lmaster for each record.
1419           </para>
1420         </listitem>
1421         </varlistentry>
1423         <varlistentry><term>--print-hash</term>
1424         <listitem>
1425           <para>
1426             This lets database dumps (catdb, cattdb, dumpdbbackup) print the
1427             hash for each record.
1428           </para>
1429         </listitem>
1430         </varlistentry>
1432         <varlistentry><term>--print-recordflags</term>
1433         <listitem>
1434           <para>
1435             This lets catdb and dumpdbbackup print the
1436             record flags for each record. Note that cattdb always
1437             prints the flags.
1438           </para>
1439         </listitem>
1440         </varlistentry>
1442       </variablelist>
1443     </refsect2>
1445     <refsect2>
1446       <title>process-exists <parameter>PID</parameter></title>
1447       <para>
1448         This command checks if a specific process exists on the CTDB host. This is mainly used by Samba to check if remote instances of samba are still running or not.
1449       </para>
1450     </refsect2>
1452     <refsect2>
1453       <title>getdbstatus <parameter>DB</parameter></title>
1454       <para>
1455         This command displays more details about a database.
1456       </para>
1457       <refsect3>
1458         <title>Example</title>
1459         <screen>
1460 # ctdb getdbstatus test.tdb.0
1461 dbid: 0x122224da
1462 name: test.tdb
1463 path: /var/ctdb/test.tdb.0
1464 PERSISTENT: no
1465 HEALTH: OK
1467 # ctdb getdbstatus registry.tdb  # with a corrupted TDB
1468 dbid: 0xf2a58948
1469 name: registry.tdb
1470 path: /var/ctdb/persistent/registry.tdb.0
1471 PERSISTENT: yes
1472 HEALTH: NO-HEALTHY-NODES - ERROR - Backup of corrupted TDB in '/var/ctdb/persistent/registry.tdb.0.corrupted.20091208091949.0Z'
1473         </screen>
1474       </refsect3>
1475     </refsect2>
1477     <refsect2>
1478       <title>catdb <parameter>DB</parameter></title>
1479       <para>
1480         Print a dump of the clustered TDB database DB.
1481       </para>
1482     </refsect2>
1484     <refsect2>
1485       <title>cattdb <parameter>DB</parameter></title>
1486       <para>
1487         Print a dump of the contents of the local TDB database DB.
1488       </para>
1489     </refsect2>
1491     <refsect2>
1492       <title>dumpdbbackup <parameter>FILE</parameter></title>
1493       <para>
1494         Print a dump of the contents from database backup FILE,
1495         similar to <command>catdb</command>.
1496       </para>
1497     </refsect2>
1499     <refsect2>
1500       <title>wipedb <parameter>DB</parameter></title>
1501       <para>
1502         Remove all contents of database DB.
1503       </para>
1504     </refsect2>
1506     <refsect2>
1507       <title>recover</title>
1508       <para>
1509         This command will trigger the recovery daemon to do a cluster
1510         recovery.
1511       </para>
1512     </refsect2>
1514     <refsect2>
1515       <title>ipreallocate, sync</title>
1516       <para>
1517         This command will force the recovery master to perform a full ip reallocation process and redistribute all ip addresses. This is useful to "reset" the allocations back to its default state if they have been changed using the "moveip" command. While a "recover" will also perform this reallocation, a recovery is much more hevyweight since it will also rebuild all the databases.
1518       </para>
1519     </refsect2>
1521     <refsect2>
1522       <title>getmonmode</title>
1523       <para>
1524         This command returns the monutoring mode of a node. The monitoring mode is either ACTIVE or DISABLED. Normally a node will continuously monitor that all other nodes that are expected are in fact connected and that they respond to commands.
1525       </para>
1526       <para>
1527         ACTIVE - This is the normal mode. The node is actively monitoring all other nodes, both that the transport is connected and also that the node responds to commands. If a node becomes unavailable, it will be marked as DISCONNECTED and a recovery is initiated to restore the cluster.
1528       </para>
1529       <para>
1530         DISABLED - This node is not monitoring that other nodes are available. In this mode a node failure will not be detected and no recovery will be performed. This mode is useful when for debugging purposes one wants to attach GDB to a ctdb process but wants to prevent the rest of the cluster from marking this node as DISCONNECTED and do a recovery.
1531       </para>
1532     </refsect2>
1535     <refsect2>
1536       <title>setmonmode 0|1</title>
1537       <para>
1538         This command can be used to explicitly disable/enable monitoring mode on a node. The main purpose is if one wants to attach GDB to a running ctdb daemon but wants to prevent the other nodes from marking it as DISCONNECTED and issuing a recovery. To do this, set monitoring mode to 0 on all nodes before attaching with GDB. Remember to set monitoring mode back to 1 afterwards.
1539       </para>
1540     </refsect2>
1542     <refsect2>
1543       <title>attach <parameter>DBNAME</parameter> [persistent]</title>
1544       <para>
1545         Create a new CTDB database called DBNAME and attach to it on
1546         all nodes.
1547       </para>
1548     </refsect2>
1550     <refsect2>
1551       <title>detach <parameter>DB-LIST</parameter></title>
1552       <para>
1553         Detach specified non-persistent database(s) from the cluster. This
1554         command will disconnect specified database(s) on all nodes in
1555         the cluster.  This command should only be used when none of the
1556         specified database(s) are in use.
1557       </para>
1558       <para>
1559         All nodes should be active and tunable AllowClientDBAccess should
1560         be disabled on all nodes before detaching databases.
1561       </para>
1562     </refsect2>
1564     <refsect2>
1565       <title>dumpmemory</title>
1566       <para>
1567         This is a debugging command. This command will make the ctdb
1568         daemon to write a fill memory allocation map to standard output.
1569       </para>
1570     </refsect2>
1572     <refsect2>
1573       <title>rddumpmemory</title>
1574       <para>
1575         This is a debugging command. This command will dump the talloc memory
1576         allocation tree for the recovery daemon to standard output.
1577       </para>
1578     </refsect2>
1580     <refsect2>
1581       <title>thaw</title>
1582       <para>
1583         Thaw a previously frozen node.
1584       </para>
1585     </refsect2>
1588     <refsect2>
1589       <title>eventscript <parameter>ARGUMENTS</parameter></title>
1590       <para>
1591         This is a debugging command. This command can be used to manually
1592         invoke and run the eventscritps with arbitrary arguments.
1593       </para>
1594     </refsect2>
1596     <refsect2>
1597       <title>ban <parameter>BANTIME</parameter></title>
1598       <para>
1599         Administratively ban a node for BANTIME seconds.  The node
1600         will be unbanned after BANTIME seconds have elapsed.
1601       </para>
1602       <para>
1603         A banned node does not participate in the cluster.  It does
1604         not host any records for the clustered TDB and does not host
1605         any public IP addresses.
1606       </para>
1607       <para>
1608         Nodes are automatically banned if they misbehave.  For
1609         example, a node may be banned if it causes too many cluster
1610         recoveries.
1611       </para>
1612       <para>
1613         To administratively exclude a node from a cluster use the
1614         <command>stop</command> command.
1615       </para>
1616     </refsect2>
1618     <refsect2>
1619       <title>unban</title>
1620       <para>
1621         This command is used to unban a node that has either been
1622         administratively banned using the ban command or has been
1623         automatically banned.
1624       </para>
1625     </refsect2>
1627     <refsect2>
1628       <title>
1629         rebalancenode
1630         <optional><parameter>PNN-LIST</parameter></optional>
1631       </title>
1632       <para>
1633         This command marks the given nodes as rebalance targets in the
1634         LCP2 IP allocation algorithm.  The
1635         <command>reloadips</command> command will do this as necessary
1636         so this command should not be needed.
1637       </para>
1638     </refsect2>
1640     <refsect2>
1641       <title>check_srvids <parameter>SRVID</parameter> ...</title>
1642       <para>
1643         This command checks whether a set of srvid message ports are
1644         registered on the node or not. The command takes a list of
1645         values to check.
1646       </para>
1647       <refsect3>
1648         <title>Example</title>
1649         <screen>
1650 # ctdb check_srvids 1 2 3 14765
1651 Server id 0:1 does not exist
1652 Server id 0:2 does not exist
1653 Server id 0:3 does not exist
1654 Server id 0:14765 exists
1655         </screen>
1656       </refsect3>
1657     </refsect2>
1659   </refsect1>
1661   <!-- UNDOCUMENTED: showban stats disablemonitor enablemonitor
1662        isnotrecmaster addtickle deltickle regsrvid unregsrvid chksrvid
1663        getsrvids rebalanceip setdbprio getdbprio msglisten msgsend
1664        tfetch tstore readkey writekey
1665        checktcpport getdbseqnum ipiface
1666   -->
1668   <refsect1>
1669     <title>SEE ALSO</title>
1670     <para>
1671       <citerefentry><refentrytitle>ctdbd</refentrytitle>
1672       <manvolnum>1</manvolnum></citerefentry>,
1674       <citerefentry><refentrytitle>onnode</refentrytitle>
1675       <manvolnum>1</manvolnum></citerefentry>,
1677       <citerefentry><refentrytitle>ctdb</refentrytitle>
1678       <manvolnum>7</manvolnum></citerefentry>,
1680       <citerefentry><refentrytitle>ctdb-statistics</refentrytitle>
1681       <manvolnum>7</manvolnum></citerefentry>,
1683       <citerefentry><refentrytitle>ctdb-tunables</refentrytitle>
1684       <manvolnum>7</manvolnum></citerefentry>,
1686       <ulink url="http://ctdb.samba.org/"/>
1687     </para>
1688   </refsect1>
1691 </refentry>