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