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