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