ctdb-docs: Fix the documentation for VNN map
[Samba.git] / ctdb / doc / ctdb.1.xml
blobae3b9d3b699cb83f2ba86b67d08e51979eb57dde
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry
3         PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
4         "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
5 <refentry id="ctdb.1">
7   <refentryinfo>
8     <author>
9       <contrib>
10         This documentation was written by
11         Ronnie Sahlberg,
12         Amitay Isaacs,
13         Martin Schwenke
14       </contrib>
15     </author>
17     <copyright>
18       <year>2007</year>
19       <holder>Andrew Tridgell</holder>
20       <holder>Ronnie Sahlberg</holder>
21     </copyright>
22     <legalnotice>
23       <para>
24         This program is free software; you can redistribute it and/or
25         modify it under the terms of the GNU General Public License as
26         published by the Free Software Foundation; either version 3 of
27         the License, or (at your option) any later version.
28       </para>
29       <para>
30         This program is distributed in the hope that it will be
31         useful, but WITHOUT ANY WARRANTY; without even the implied
32         warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
33         PURPOSE.  See the GNU General Public License for more details.
34       </para>
35       <para>
36         You should have received a copy of the GNU General Public
37         License along with this program; if not, see
38         <ulink url="http://www.gnu.org/licenses"/>.
39       </para>
40     </legalnotice>
41   </refentryinfo>
43   <refmeta>
44     <refentrytitle>ctdb</refentrytitle>
45     <manvolnum>1</manvolnum>
46     <refmiscinfo class="source">ctdb</refmiscinfo>
47     <refmiscinfo class="manual">CTDB - clustered TDB database</refmiscinfo>
48   </refmeta>
50   <refnamediv>
51     <refname>ctdb</refname>
52     <refpurpose>CTDB management utility</refpurpose>
53   </refnamediv>
55   <refsynopsisdiv>
56     <cmdsynopsis>
57       <command>ctdb</command>
58       <arg rep="repeat"><replaceable>OPTION</replaceable></arg>
59       <arg choice="req"><replaceable>COMMAND</replaceable></arg>
60       <arg choice="opt"><replaceable>COMMAND-ARGS</replaceable></arg>
61     </cmdsynopsis>
62   </refsynopsisdiv>
64   <refsect1>
65     <title>DESCRIPTION</title>
66     <para>
67       ctdb is a utility to view and manage a CTDB cluster.
68     </para>
70     <para>
71       The following terms are used when referring to nodes in a
72       cluster:
73       <variablelist>
74         <varlistentry>
75           <term>PNN</term>
76           <listitem>
77             <para>
78               Physical Node Number.  The physical node number is an
79               integer that describes the node in the cluster. The
80               first node has physical node number 0.  in a cluster.
81             </para>
82           </listitem>
83         </varlistentry>
84         <varlistentry>
85           <term>PNN-LIST</term>
86           <listitem>
87             <para>
88               This is either a single PNN, a comma-separate list of PNNs
89               or "all".
90             </para>
91           </listitem>
92         </varlistentry>
93       </variablelist>
94     </para>
96     <para>
97       Commands that reference a database use the following terms:
98       <variablelist>
99         <varlistentry>
100           <term>DB</term>
101           <listitem>
102             <para>
103               This is either a database name, such as
104               <filename>locking.tdb</filename> or a database ID such
105               as "0x42fe72c5".
106             </para>
107           </listitem>
108         </varlistentry>
109         <varlistentry>
110           <term>DB-LIST</term>
111           <listitem>
112             <para>
113               A space separated list of at least one
114               <parameter>DB</parameter>.
115             </para>
116           </listitem>
117         </varlistentry>
118       </variablelist>
119     </para>
120   </refsect1>
122   <refsect1>
123     <title>OPTIONS</title>
125     <variablelist>
126       <varlistentry><term>-n <parameter>PNN</parameter></term>
127       <listitem>
128         <para>
129           The node specified by PNN should be queried for the
130           requested information.  Default is to query the daemon
131           running on the local host.
132         </para>
133       </listitem>
134       </varlistentry>
136       <varlistentry><term>-Y</term>
137       <listitem>
138         <para>
139           Produce output in machine readable form for easier parsing
140           by scripts. This uses a field delimiter of ':'.  Not all
141           commands support this option.
142         </para>
143       </listitem>
144       </varlistentry>
146       <varlistentry><term>-x <parameter>SEPARATOR</parameter></term>
147       <listitem>
148         <para>
149           Use SEPARATOR to delimit fields in machine readable output.
150           This implies -Y.
151         </para>
152       </listitem>
153       </varlistentry>
155       <varlistentry><term>-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>
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>
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>
190       <varlistentry><term>-? --help</term>
191       <listitem>
192         <para>
193           Print some help text to the screen.
194         </para>
195       </listitem>
196       </varlistentry>
198       <varlistentry><term>--usage</term>
199       <listitem>
200         <para>
201           Print useage information to the screen.
202         </para>
203       </listitem>
204       </varlistentry>
206       <varlistentry><term>-d --debug=<parameter>DEBUGLEVEL</parameter></term>
207       <listitem>
208         <para>
209           Change the debug level for the command. Default is NOTICE.
210         </para>
211       </listitem>
212       </varlistentry>
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>
228   <refsect1>
229     <title>ADMINISTRATIVE COMMANDS</title>
230     <para>
231       These are commands used to monitor and administer a CTDB cluster.
232     </para>
234     <refsect2>
235       <title>pnn</title>
236       <para>
237         This command displays the PNN of the current node.
238       </para>
239     </refsect2>
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>
248       <para>
249         Note: If the the queried node is INACTIVE then the status
250         might not be current.
251       </para>
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>
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>
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.  Only nodes
296           that are participating in the VNN map can become lmaster for
297           database records.
298         </para>
299       </refsect3>
301       <refsect3>
302         <title>Recovery mode</title>
303         <para>
304           This is the current recovery mode of the cluster. There are two possible modes:
305         </para>
306         <para>
307           NORMAL - The cluster is fully operational.
308         </para>
309         <para>
310           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.
311         </para>
312         <para>
313           Once the recovery master detects an inconsistency, for example a node 
314           becomes disconnected/connected, the recovery daemon will trigger a 
315           cluster recovery process, where all databases are remerged across the
316           cluster. When this process starts, the recovery master will first
317           "freeze" all databases to prevent applications such as samba from 
318           accessing the databases and it will also mark the recovery mode as
319           RECOVERY.
320         </para>
321         <para>
322           When the CTDB daemon starts up, it will start in RECOVERY
323           mode.  Once the node has been merged into a cluster and all
324           databases have been recovered, the node mode will change into
325           NORMAL mode and the databases will be "thawed", allowing samba
326           to access the databases again.
327         </para>
328       </refsect3>
329       <refsect3>
330         <title>Recovery master</title>
331         <para>
332           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.
333         </para>
334         <para>
335           Only one node at a time can be the designated recovery master. Which
336           node is designated the recovery master is decided by an election
337           process in the recovery daemons running on each node.
338         </para>
339       </refsect3>
341       <refsect3>
342         <title>Example</title>
343         <screen>
344 # ctdb status
345 Number of nodes:4
346 pnn:0 192.168.2.200       OK (THIS NODE)
347 pnn:1 192.168.2.201       OK
348 pnn:2 192.168.2.202       OK
349 pnn:3 192.168.2.203       OK
350 Generation:1362079228
351 Size:4
352 hash:0 lmaster:0
353 hash:1 lmaster:1
354 hash:2 lmaster:2
355 hash:3 lmaster:3
356 Recovery mode:NORMAL (0)
357 Recovery master:0
358         </screen>
359       </refsect3>
360     </refsect2>
362     <refsect2>
363       <title>nodestatus <optional><parameter>PNN-LIST</parameter></optional></title>
364       <para>
365         This command is similar to the <command>status</command>
366         command.  It displays the "node status" subset of output.  The
367         main differences are:
368       </para>
370       <itemizedlist>
371         <listitem>
372           <para>
373             The exit code is the bitwise-OR of the flags for each
374             specified node, while <command>ctdb status</command> exits
375             with 0 if it was able to retrieve status for all nodes.
376           </para>
377         </listitem>
379         <listitem>
380           <para>
381             <command>ctdb status</command> provides status information
382             for all nodes.  <command>ctdb nodestatus</command>
383             defaults to providing status for only the current node.
384             If PNN-LIST is provided then status is given for
385             the indicated node(s).
386           </para>
387         </listitem>
388       </itemizedlist>
390       <para>
391         A common invocation in scripts is <command>ctdb nodestatus
392         all</command> to check whether all nodes in a cluster are
393         healthy.
394       </para>
396       <refsect3>
397         <title>Example</title>
398         <screen>
399 # ctdb nodestatus
400 pnn:0 10.0.0.30        OK (THIS NODE)
402 # ctdb nodestatus all
403 Number of nodes:2
404 pnn:0 10.0.0.30        OK (THIS NODE)
405 pnn:1 10.0.0.31        OK
406         </screen>
407       </refsect3>
408     </refsect2>
410     <refsect2>
411       <title>recmaster</title>
412       <para>
413         This command shows the pnn of the node which is currently the recmaster.
414       </para>
416       <para>
417         Note: If the the queried node is INACTIVE then the status
418         might not be current.
419       </para>
420     </refsect2>
422     <refsect2>
423       <title>uptime</title>
424       <para>
425         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.
426       </para>
428       <refsect3>
429         <title>Example</title>
430         <screen>
431 # ctdb uptime
432 Current time of node          :                Thu Oct 29 10:38:54 2009
433 Ctdbd start time              : (000 16:54:28) Wed Oct 28 17:44:26 2009
434 Time of last recovery/failover: (000 16:53:31) Wed Oct 28 17:45:23 2009
435 Duration of last recovery/failover: 2.248552 seconds
436         </screen>
437       </refsect3>
438     </refsect2>
440     <refsect2>
441       <title>listnodes</title>
442       <para>
443         This command shows lists the ip addresses of all the nodes in the cluster.
444       </para>
446       <refsect3>
447         <title>Example</title>
448         <screen>
449 # ctdb listnodes
450 192.168.2.200
451 192.168.2.201
452 192.168.2.202
453 192.168.2.203
454         </screen>
455       </refsect3>
456     </refsect2>
458     <refsect2>
459       <title>natgw {master|list|status}</title>
460       <para>
461         This command shows different aspects of NAT gateway status.
462         For an overview of CTDB's NAT gateway functionality please see
463         the <citetitle>NAT GATEWAY</citetitle> section in
464         <citerefentry><refentrytitle>ctdb</refentrytitle>
465         <manvolnum>7</manvolnum></citerefentry>.
466       </para>
468       <variablelist>
469         <varlistentry>
470           <term>master</term>
471           <listitem>
472             <para>
473               Show the PNN and private IP address of the current NAT
474               gateway master node.
475             </para>
476             <para>
477               Example output:
478             </para>
479             <screen>
480 1 192.168.2.201
481             </screen>
482           </listitem>
483         </varlistentry>
484         <varlistentry>
485           <term>list</term>
486           <listitem>
487             <para>
488               List the private IP addresses of nodes in the current
489               NAT gateway group, annotating the master node.
490             </para>
491             <para>
492               Example output:
493             </para>
494             <screen>
495 192.168.2.200
496 192.168.2.201   MASTER
497 192.168.2.202
498 192.168.2.203
499             </screen>
500           </listitem>
501         </varlistentry>
502         <varlistentry>
503           <term>status</term>
504           <listitem>
505             <para>
506               List the nodes in the current NAT gateway group and
507               their status.
508             </para>
509             <para>
510               Example output:
511             </para>
512             <screen>
513 pnn:0 192.168.2.200       UNHEALTHY (THIS NODE)
514 pnn:1 192.168.2.201       OK
515 pnn:2 192.168.2.202       OK
516 pnn:3 192.168.2.203       OK
517             </screen>
518           </listitem>
519         </varlistentry>
520       </variablelist>
521     </refsect2>
523     <refsect2>
524       <title>ping</title>
525       <para>
526         This command will "ping" specified CTDB nodes in the cluster
527         to verify that they are running.
528       </para>
529       <refsect3>
530         <title>Example</title>
531         <screen>
532 # ctdb ping
533 response from 0 time=0.000054 sec  (3 clients)
534         </screen>
535       </refsect3>
536     </refsect2>
538     <refsect2>
539       <title>ifaces</title>
540       <para>
541         This command will display the list of network interfaces, which could
542         host public addresses, along with their status.
543       </para>
544       <refsect3>
545         <title>Example</title>
546         <screen>
547 # ctdb ifaces
548 Interfaces on node 0
549 name:eth5 link:up references:2
550 name:eth4 link:down references:0
551 name:eth3 link:up references:1
552 name:eth2 link:up references:1
554 # ctdb -X ifaces
555 |Name|LinkStatus|References|
556 |eth5|1|2|
557 |eth4|0|0|
558 |eth3|1|1|
559 |eth2|1|1|
560         </screen>
561       </refsect3>
562     </refsect2>
564     <refsect2>
565       <title>ip</title>
566       <para>
567         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".
568       </para>
569       <refsect3>
570         <title>Example</title>
571         <screen>
572 # ctdb ip -v
573 Public IPs on node 0
574 172.31.91.82 node[1] active[] available[eth2,eth3] configured[eth2,eth3]
575 172.31.91.83 node[0] active[eth3] available[eth2,eth3] configured[eth2,eth3]
576 172.31.91.84 node[1] active[] available[eth2,eth3] configured[eth2,eth3]
577 172.31.91.85 node[0] active[eth2] available[eth2,eth3] configured[eth2,eth3]
578 172.31.92.82 node[1] active[] available[eth5] configured[eth4,eth5]
579 172.31.92.83 node[0] active[eth5] available[eth5] configured[eth4,eth5]
580 172.31.92.84 node[1] active[] available[eth5] configured[eth4,eth5]
581 172.31.92.85 node[0] active[eth5] available[eth5] configured[eth4,eth5]
583 # ctdb -X ip -v
584 |Public IP|Node|ActiveInterface|AvailableInterfaces|ConfiguredInterfaces|
585 |172.31.91.82|1||eth2,eth3|eth2,eth3|
586 |172.31.91.83|0|eth3|eth2,eth3|eth2,eth3|
587 |172.31.91.84|1||eth2,eth3|eth2,eth3|
588 |172.31.91.85|0|eth2|eth2,eth3|eth2,eth3|
589 |172.31.92.82|1||eth5|eth4,eth5|
590 |172.31.92.83|0|eth5|eth5|eth4,eth5|
591 |172.31.92.84|1||eth5|eth4,eth5|
592 |172.31.92.85|0|eth5|eth5|eth4,eth5|
593         </screen>
594       </refsect3>
595     </refsect2>
597     <refsect2>
598       <title>ipinfo <parameter>IP</parameter></title>
599       <para>
600         This command will display details about the specified public addresses.
601       </para>
602       <refsect3>
603         <title>Example</title>
604         <screen>
605 # ctdb ipinfo 172.31.92.85
606 Public IP[172.31.92.85] info on node 0
607 IP:172.31.92.85
608 CurrentNode:0
609 NumInterfaces:2
610 Interface[1]: Name:eth4 Link:down References:0
611 Interface[2]: Name:eth5 Link:up References:2 (active)
612         </screen>
613       </refsect3>
614     </refsect2>
616     <refsect2>
617       <title>event run|status|script list|script enable|script disable</title>
618       <para>
619         This command is used to control event daemon and to inspect
620         status of various events.
621       </para>
623       <variablelist>
624         <varlistentry>
625           <term>run <parameter>EVENT</parameter> <parameter>TIMEOUT</parameter> <optional><parameter>ARGUMENTS</parameter></optional> </term>
626           <listitem>
627             <para>
628              This command can be used to manually run specified EVENT
629              with optional ARGUMENTS.  The event will be allowed to run
630              a maximum of TIMEOUT seconds.  If TIMEOUT is 0, then there
631              is no time limit for running the event.
632             </para>
633           </listitem>
634         </varlistentry>
636         <varlistentry>
637           <term>status <optional><parameter>EVENT</parameter></optional> <optional>lastrun|lastpass|lastfail</optional></term>
638           <listitem>
639             <para>
640               This command displays the last execution status of the
641               specified EVENT.  If no event is specified, then the status
642               of last executed monitor event will be displayed.
643             </para>
644             <para>
645               To see the last successful execution of the event, lastpass
646               can be specified. Similarly lastfail can be specified
647               to see the last unsuccessful execution of the event.
648               The optional lastrun can be specified to query the last
649               execution of the event.
650             </para>
651             <para>
652               The command will terminate with the exit status
653               corresponding to the overall status of event that is
654               displayed.  If lastpass is specified, then the command will
655               always terminate with 0.  If lastfail is specified then the
656               command will always terminate with non-zero exit status.
657               If lastrun is specified, then the command will terminate
658               with 0 or not depending on if the last execution of the
659               event was successful or not.
660             </para>
661             <para>
662               The output is the list of event scripts executed.
663               Each line shows the name, status, duration and start time
664               for each script.
665             </para>
666             <para>
667               Example output:
668             </para>
669             <screen>
670 00.ctdb              OK         0.014 Sat Dec 17 19:39:11 2016
671 01.reclock           OK         0.013 Sat Dec 17 19:39:11 2016
672 05.system            OK         0.029 Sat Dec 17 19:39:11 2016
673 06.nfs               OK         0.014 Sat Dec 17 19:39:11 2016
674 10.external          DISABLED  
675 10.interface         OK         0.037 Sat Dec 17 19:39:11 2016
676 11.natgw             OK         0.011 Sat Dec 17 19:39:11 2016
677 11.routing           OK         0.007 Sat Dec 17 19:39:11 2016
678 13.per_ip_routing    OK         0.007 Sat Dec 17 19:39:11 2016
679 20.multipathd        OK         0.007 Sat Dec 17 19:39:11 2016
680 31.clamd             OK         0.007 Sat Dec 17 19:39:11 2016
681 40.vsftpd            OK         0.013 Sat Dec 17 19:39:11 2016
682 41.httpd             OK         0.018 Sat Dec 17 19:39:11 2016
683 49.winbind           OK         0.023 Sat Dec 17 19:39:11 2016
684 50.samba             OK         0.100 Sat Dec 17 19:39:12 2016
685 60.nfs               OK         0.376 Sat Dec 17 19:39:12 2016
686 70.iscsi             OK         0.009 Sat Dec 17 19:39:12 2016
687 91.lvs               OK         0.007 Sat Dec 17 19:39:12 2016
688 99.timeout           OK         0.007 Sat Dec 17 19:39:12 2016
689             </screen>
690           </listitem>
691         </varlistentry>
693         <varlistentry>
694           <term>script list</term>
695           <listitem>
696             <para>
697               List the available event scripts.
698             </para>
699             <para>
700               Example output:
701             </para>
702             <screen>
703 00.ctdb             
704 01.reclock          
705 05.system           
706 06.nfs              
707 10.external          DISABLED
708 10.interface        
709 11.natgw            
710 11.routing          
711 13.per_ip_routing   
712 20.multipathd       
713 31.clamd            
714 40.vsftpd           
715 41.httpd            
716 49.winbind          
717 50.samba            
718 60.nfs              
719 70.iscsi            
720 91.lvs              
721 99.timeout          
722             </screen>
723           </listitem>
724         </varlistentry>
726         <varlistentry>
727           <term>script enable <parameter>SCRIPT</parameter></term>
728           <listitem>
729             <para>
730               Enable the specified event SCRIPT.  Only enabled scripts will be
731               executed when running any event.
732             </para>
733           </listitem>
734         </varlistentry>
736         <varlistentry>
737           <term>script disable <parameter>SCRIPT</parameter></term>
738           <listitem>
739             <para>
740               Disable the specified event SCRIPT.  This will prevent the script
741               from executing when running any event.
742             </para>
743           </listitem>
744         </varlistentry>
745       </variablelist>
746     </refsect2>
748     <refsect2>
749       <title>scriptstatus</title>
750       <para>
751         This command displays which event scripts where run in the previous
752         monitoring cycle and the result of each script. If a script
753         failed with an error, causing the node to become unhealthy,
754         the output from that script is also shown.
755       </para>
756       <para>
757         This command is deprecated.  It's provided for backward
758         compatibility.  In place of <command>ctdb scriptstatus</command>,
759         use <command>ctdb event status</command>.
760       </para>
761       <refsect3>
762         <title>Example</title>
763         <screen>
764 # ctdb scriptstatus
765 00.ctdb              OK         0.011 Sat Dec 17 19:40:46 2016
766 01.reclock           OK         0.010 Sat Dec 17 19:40:46 2016
767 05.system            OK         0.030 Sat Dec 17 19:40:46 2016
768 06.nfs               OK         0.014 Sat Dec 17 19:40:46 2016
769 10.external          DISABLED  
770 10.interface         OK         0.041 Sat Dec 17 19:40:46 2016
771 11.natgw             OK         0.008 Sat Dec 17 19:40:46 2016
772 11.routing           OK         0.007 Sat Dec 17 19:40:46 2016
773 13.per_ip_routing    OK         0.007 Sat Dec 17 19:40:46 2016
774 20.multipathd        OK         0.007 Sat Dec 17 19:40:46 2016
775 31.clamd             OK         0.007 Sat Dec 17 19:40:46 2016
776 40.vsftpd            OK         0.013 Sat Dec 17 19:40:46 2016
777 41.httpd             OK         0.015 Sat Dec 17 19:40:46 2016
778 49.winbind           OK         0.022 Sat Dec 17 19:40:46 2016
779 50.samba             ERROR      0.077 Sat Dec 17 19:40:46 2016
780   OUTPUT: ERROR: samba tcp port 445 is not responding
781       </screen>
782       </refsect3>
783     </refsect2>
785     <refsect2>
786       <title>listvars</title>
787       <para>
788         List all tuneable variables, except the values of the obsolete tunables
789         like VacuumMinInterval. The obsolete tunables can be retrieved only
790         explicitly with the "ctdb getvar" command.
791       </para>
792       <refsect3>
793         <title>Example</title>
794         <screen>
795 # ctdb listvars
796 SeqnumInterval          = 1000
797 ControlTimeout          = 60
798 TraverseTimeout         = 20
799 KeepaliveInterval       = 5
800 KeepaliveLimit          = 5
801 RecoverTimeout          = 120
802 RecoverInterval         = 1
803 ElectionTimeout         = 3
804 TakeoverTimeout         = 9
805 MonitorInterval         = 15
806 TickleUpdateInterval    = 20
807 EventScriptTimeout      = 30
808 MonitorTimeoutCount     = 20
809 RecoveryGracePeriod     = 120
810 RecoveryBanPeriod       = 300
811 DatabaseHashSize        = 100001
812 DatabaseMaxDead         = 5
813 RerecoveryTimeout       = 10
814 EnableBans              = 1
815 NoIPFailback            = 0
816 DisableIPFailover       = 0
817 VerboseMemoryNames      = 0
818 RecdPingTimeout         = 60
819 RecdFailCount           = 10
820 LogLatencyMs            = 0
821 RecLockLatencyMs        = 1000
822 RecoveryDropAllIPs      = 120
823 VacuumInterval          = 10
824 VacuumMaxRunTime        = 120
825 RepackLimit             = 10000
826 VacuumLimit             = 5000
827 VacuumFastPathCount     = 60
828 MaxQueueDropMsg         = 1000000
829 AllowUnhealthyDBRead    = 0
830 StatHistoryInterval     = 1
831 DeferredAttachTO        = 120
832 AllowClientDBAttach     = 1
833 RecoverPDBBySeqNum      = 1
834 DeferredRebalanceOnNodeAdd = 300
835 FetchCollapse           = 1
836 HopcountMakeSticky      = 50
837 StickyDuration          = 600
838 StickyPindown           = 200
839 NoIPTakeover            = 0
840 DBRecordCountWarn       = 100000
841 DBRecordSizeWarn        = 10000000
842 DBSizeWarn              = 100000000
843 PullDBPreallocation     = 10485760
844 NoIPHostOnAllDisabled   = 0
845 TDBMutexEnabled         = 1
846 LockProcessesPerDB      = 200
847 RecBufferSizeLimit      = 1000000
848 QueueBufferSize         = 1024
849 IPAllocAlgorithm        = 2
850         </screen>
851       </refsect3>
852     </refsect2>
854     <refsect2>
855       <title>getvar <parameter>NAME</parameter></title>
856       <para>
857         Get the runtime value of a tuneable variable.
858       </para>
859       <refsect3>
860         <title>Example</title>
861         <screen>
862 # ctdb getvar MonitorInterval
863 MonitorInterval         = 15
864         </screen>
865       </refsect3>
866     </refsect2>
868     <refsect2>
869       <title>setvar <parameter>NAME</parameter> <parameter>VALUE</parameter></title>
870       <para>
871         Set the runtime value of a tuneable variable.
872       </para>
873       <refsect3>
874         <title>Example</title>
875         <screen>
876 # ctdb setvar MonitorInterval 20
877         </screen>
878       </refsect3>
879     </refsect2>
881     <refsect2>
882       <title>lvs {master|list|status}</title>
883       <para>
884         This command shows different aspects of LVS status.  For an
885         overview of CTDB's LVS functionality please see the
886         <citetitle>LVS</citetitle> section in
887         <citerefentry><refentrytitle>ctdb</refentrytitle>
888         <manvolnum>7</manvolnum></citerefentry>.
889       </para>
891       <variablelist>
892         <varlistentry>
893           <term>master</term>
894           <listitem>
895             <para>
896               Shows the PNN of the current LVS master node.
897             </para>
898       <para>
899         Example output:
900       </para>
901       <screen>
903       </screen>
904           </listitem>
905         </varlistentry>
906         <varlistentry>
907           <term>list</term>
908           <listitem>
909             <para>
910               Lists the currently usable LVS nodes.
911             </para>
912       <para>
913         Example output:
914       </para>
915       <screen>
916 2 10.0.0.13
917 3 10.0.0.14
918       </screen>
919           </listitem>
920         </varlistentry>
921         <varlistentry>
922           <term>status</term>
923           <listitem>
924             <para>
925               List the nodes in the current LVS group and their status.
926             </para>
927       <para>
928         Example output:
929       </para>
930       <screen>
931 pnn:0 10.0.0.11        UNHEALTHY (THIS NODE)
932 pnn:1 10.0.0.12        UNHEALTHY
933 pnn:2 10.0.0.13        OK
934 pnn:3 10.0.0.14        OK
935       </screen>
936           </listitem>
937         </varlistentry>
938       </variablelist>
940     </refsect2>
943     <refsect2>
944       <title>getcapabilities</title>
946       <para>
947         This command shows the capabilities of the current node.  See
948         the <citetitle>CAPABILITIES</citetitle> section in
949         <citerefentry><refentrytitle>ctdb</refentrytitle>
950         <manvolnum>7</manvolnum></citerefentry> for more details.
951       </para>
953       <para>
954         Example output:
955       </para>
956       <screen>
957 RECMASTER: YES
958 LMASTER: YES
959       </screen>
961     </refsect2>
963     <refsect2>
964       <title>statistics</title>
965       <para>
966         Collect statistics from the CTDB daemon about
967         how many calls it has served.  Information about
968         various fields in statistics can be found in
969         <citerefentry><refentrytitle>ctdb-statistics</refentrytitle>
970         <manvolnum>7</manvolnum></citerefentry>.
971       </para>
972       <refsect3>
973         <title>Example</title>
974         <screen>
975 # ctdb statistics
976 CTDB version 1
977 Current time of statistics  :                Tue Mar  8 15:18:51 2016
978 Statistics collected since  : (003 21:31:32) Fri Mar  4 17:47:19 2016
979  num_clients                        9
980  frozen                             0
981  recovering                         0
982  num_recoveries                     2
983  client_packets_sent          8170534
984  client_packets_recv          7166132
985  node_packets_sent           16549998
986  node_packets_recv            5244418
987  keepalive_packets_sent        201969
988  keepalive_packets_recv        201969
989  node
990      req_call                      26
991      reply_call                     0
992      req_dmaster                    9
993      reply_dmaster                 12
994      reply_error                    0
995      req_message              1339231
996      req_control              8177506
997      reply_control            6831284
998  client
999      req_call                      15
1000      req_message               334809
1001      req_control              6831308
1002  timeouts
1003      call                           0
1004      control                        0
1005      traverse                       0
1006  locks
1007      num_calls                      8
1008      num_current                    0
1009      num_pending                    0
1010      num_failed                     0
1011  total_calls                       15
1012  pending_calls                      0
1013  childwrite_calls                   0
1014  pending_childwrite_calls             0
1015  memory_used                   394879
1016  max_hop_count                      1
1017  total_ro_delegations               0
1018  total_ro_revokes                   0
1019  hop_count_buckets: 8 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1020  lock_buckets: 0 0 8 0 0 0 0 0 0 0 0 0 0 0 0 0
1021  locks_latency      MIN/AVG/MAX     0.010005/0.010418/0.011010 sec out of 8
1022  reclock_ctdbd      MIN/AVG/MAX     0.002538/0.002538/0.002538 sec out of 1
1023  reclock_recd       MIN/AVG/MAX     0.000000/0.000000/0.000000 sec out of 0
1024  call_latency       MIN/AVG/MAX     0.000044/0.002142/0.011702 sec out of 15
1025  childwrite_latency MIN/AVG/MAX     0.000000/0.000000/0.000000 sec out of 0
1026         </screen>
1027       </refsect3>
1028     </refsect2>
1030     <refsect2>
1031       <title>statisticsreset</title>
1032       <para>
1033         This command is used to clear all statistics counters in a node.
1034       </para>
1035       <para>
1036         Example: ctdb statisticsreset
1037       </para>
1038     </refsect2>
1040     <refsect2>
1041       <title>dbstatistics <parameter>DB</parameter></title>
1042       <para>
1043         Display statistics about the database DB.  Information
1044         about various fields in dbstatistics can be found in
1045         <citerefentry><refentrytitle>ctdb-statistics</refentrytitle>
1046         <manvolnum>7</manvolnum></citerefentry>.
1047       </para>
1048       <refsect3>
1049         <title>Example</title>
1050         <screen>
1051 # ctdb dbstatistics locking.tdb
1052 DB Statistics: locking.tdb
1053  ro_delegations                     0
1054  ro_revokes                         0
1055  locks
1056      total                      14356
1057      failed                         0
1058      current                        0
1059      pending                        0
1060  hop_count_buckets: 28087 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0
1061  lock_buckets: 0 14188 38 76 32 19 3 0 0 0 0 0 0 0 0 0
1062  locks_latency      MIN/AVG/MAX     0.001066/0.012686/4.202292 sec out of 14356
1063  vacuum_latency     MIN/AVG/MAX     0.000472/0.002207/15.243570 sec out of 224530
1064  Num Hot Keys:     1
1065      Count:8 Key:ff5bd7cb3ee3822edc1f0000000000000000000000000000
1066         </screen>
1067       </refsect3>
1068     </refsect2>
1070     <refsect2>
1071       <title>getreclock</title>
1072       <para>
1073         Show details of the recovery lock, if any.
1074       </para>
1076       <para>
1077         Example output:
1078       </para>
1079       <screen>
1080         /clusterfs/.ctdb/recovery.lock
1081       </screen>
1083     </refsect2>
1085     <refsect2>
1086       <title>getdebug</title>
1087       <para>
1088         Get the current debug level for the node. the debug level controls what information is written to the log file.
1089       </para>
1090       <para>
1091         The debug levels are mapped to the corresponding syslog levels.
1092         When a debug level is set, only those messages at that level and higher
1093         levels will be printed.
1094       </para>
1095       <para>
1096         The list of debug levels from highest to lowest are :
1097       </para>
1098       <para>
1099         ERROR WARNING NOTICE INFO DEBUG
1100       </para>
1101     </refsect2>
1103     <refsect2>
1104       <title>setdebug <parameter>DEBUGLEVEL</parameter></title>
1105       <para>
1106         Set the debug level of a node. This controls what information will be logged.
1107       </para>
1108       <para>
1109         The debuglevel is one of ERROR WARNING NOTICE INFO DEBUG
1110       </para>
1111     </refsect2>
1113     <refsect2>
1114       <title>getpid</title>
1115       <para>
1116         This command will return the process id of the ctdb daemon.
1117       </para>
1118     </refsect2>
1120     <refsect2>
1121       <title>disable</title>
1122       <para>
1123         This command is used to administratively disable a node in the cluster.
1124         A disabled node will still participate in the cluster and host
1125         clustered TDB records but its public ip address has been taken over by
1126         a different node and it no longer hosts any services.
1127       </para>
1128     </refsect2>
1130     <refsect2>
1131       <title>enable</title>
1132       <para>
1133         Re-enable a node that has been administratively disabled.
1134       </para>
1135     </refsect2>
1137     <refsect2>
1138       <title>stop</title>
1139       <para>
1140         This command is used to administratively STOP a node in the cluster.
1141         A STOPPED node is connected to the cluster but will not host any
1142         public ip addresse, nor does it participate in the VNNMAP.
1143         The difference between a DISABLED node and a STOPPED node is that
1144         a STOPPED node does not host any parts of the database which means
1145         that a recovery is required to stop/continue nodes.
1146       </para>
1147     </refsect2>
1149     <refsect2>
1150       <title>continue</title>
1151       <para>
1152         Re-start a node that has been administratively stopped.
1153       </para>
1154     </refsect2>
1156     <refsect2>
1157       <title>addip <parameter>IPADDR</parameter>/<parameter>mask</parameter> <parameter>IFACE</parameter></title>
1158       <para>
1159         This command is used to add a new public ip to a node
1160         during runtime.  It should be followed by a <command>ctdb
1161         ipreallocate</command>.  This allows public addresses to be
1162         added to a cluster without having to restart the ctdb daemons.
1163       </para>
1164       <para>
1165         Note that this only updates the runtime instance of ctdb. Any
1166         changes will be lost next time ctdb is restarted and the public
1167         addresses file is re-read.  If you want this change to be
1168         permanent you must also update the public addresses file manually.
1169       </para>
1170     </refsect2>
1172     <refsect2>
1173       <title>delip <parameter>IPADDR</parameter></title>
1174       <para>
1175         This command flags IPADDR for deletion from a node at runtime.
1176         It should be followed by a <command>ctdb
1177         ipreallocate</command>.  If IPADDR is currently hosted by the
1178         node it is being removed from, this ensures that the IP will
1179         first be failed over to another node, if possible, and that it
1180         is then actually removed.
1181       </para>
1182       <para>
1183         Note that this only updates the runtime instance of CTDB.  Any
1184         changes will be lost next time CTDB is restarted and the
1185         public addresses file is re-read.  If you want this change to
1186         be permanent you must also update the public addresses file
1187         manually.
1188       </para>
1189     </refsect2>
1191     <refsect2>
1192       <title>moveip <parameter>IPADDR</parameter> <parameter>PNN</parameter></title>
1193       <para>
1194         This command can be used to manually fail a public ip address to a
1195         specific node.
1196       </para>
1197       <para>
1198         In order to manually override the "automatic" distribution of public 
1199         ip addresses that ctdb normally provides, this command only works
1200         when you have changed the tunables for the daemon to:
1201       </para>
1202       <para>
1203         IPAllocAlgorithm != 0
1204       </para>
1205       <para>
1206         NoIPFailback = 1
1207       </para>
1208     </refsect2>
1210     <refsect2>
1211       <title>shutdown</title>
1212       <para>
1213         This command will shutdown a specific CTDB daemon.
1214       </para>
1215     </refsect2>
1217     <refsect2>
1218       <title>setlmasterrole on|off</title>
1219       <para>
1220         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.
1221       </para>
1223       <para>
1224         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.
1225       </para>
1226       <para>
1227         Once this setting has been enabled/disabled, you need to perform a recovery for it to take effect.
1228       </para>
1229       <para>
1230         See also "ctdb getcapabilities"
1231       </para>
1232     </refsect2>
1234     <refsect2>
1235       <title>setrecmasterrole on|off</title>
1236       <para>
1237         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.
1238       </para>
1240       <para>
1241         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.
1242       </para>
1243       <para>
1244         See also "ctdb getcapabilities"
1245       </para>
1246     </refsect2>
1248     <refsect2>
1249       <title>reloadnodes</title>
1250       <para>
1251         This command is used when adding new nodes, or removing
1252         existing nodes from an existing cluster.
1253       </para>
1254       <para>
1255         Procedure to add nodes:
1256       </para>
1257       <orderedlist>
1258         <listitem>
1259           <para>
1260              To expand an existing cluster, first ensure with
1261              <command>ctdb status</command> that all nodes are up and
1262              running and that they are all healthy.  Do not try to
1263              expand a cluster unless it is completely healthy!
1264           </para>
1265         </listitem>
1266         <listitem>
1267           <para>
1268             On all nodes, edit <filename>/usr/local/etc/ctdb/nodes</filename>
1269             and <emphasis>add the new nodes at the end of this
1270             file</emphasis>.
1271           </para>
1272         </listitem>
1273         <listitem>
1274           <para>
1275             Verify that all the nodes have identical
1276             <filename>/usr/local/etc/ctdb/nodes</filename> files after adding
1277             the new nodes.
1278           </para>
1279         </listitem>
1280         <listitem>
1281           <para>
1282             Run <command>ctdb reloadnodes</command> to force all nodes
1283             to reload the nodes file.
1284           </para>
1285         </listitem>
1286         <listitem>
1287           <para>
1288             Use <command>ctdb status</command> on all nodes and verify
1289             that they now show the additional nodes.
1290           </para>
1291         </listitem>
1292         <listitem>
1293           <para>
1294             Install and configure the new node and bring it online.
1295           </para>
1296         </listitem>
1297       </orderedlist>
1298       <para>
1299         Procedure to remove nodes:
1300       </para>
1301       <orderedlist>
1302         <listitem>
1303           <para>
1304             To remove nodes from an existing cluster, first ensure
1305             with <command>ctdb status</command> that all nodes, except
1306             the node to be deleted, are up and running and that they
1307             are all healthy.  Do not try to remove nodes from a
1308             cluster unless the cluster is completely healthy!
1309           </para>
1310         </listitem>
1311         <listitem>
1312           <para>
1313             Shutdown and power off the node to be removed.
1314           </para>
1315         </listitem>
1316         <listitem>
1317           <para>
1318             On all other nodes, edit the
1319             <filename>/usr/local/etc/ctdb/nodes</filename> file and
1320             <emphasis>comment out</emphasis> the nodes to be removed.
1321             <emphasis>Do not delete the lines for the deleted
1322             nodes</emphasis>, just comment them out by adding a '#' at
1323             the beginning of the lines.
1324           </para>
1325         </listitem>
1326         <listitem>
1327           <para>
1328             Run <command>ctdb reloadnodes</command> to force all nodes
1329             to reload the nodes file.
1330           </para>
1331         </listitem>
1332         <listitem>
1333           <para>
1334             Use <command>ctdb status</command> on all nodes and verify
1335             that the deleted nodes are no longer listed.
1336           </para>
1337         </listitem>
1338       </orderedlist>
1340     </refsect2>
1342     <refsect2>
1343       <title>
1344         reloadips
1345         <optional><parameter>PNN-LIST</parameter></optional>
1346       </title>
1347       <para>
1348         This command reloads the public addresses configuration file
1349         on the specified nodes.  When it completes addresses will be
1350         reconfigured and reassigned across the cluster as necessary.
1351       </para>
1353       <para>
1354         This command is currently unable to make changes to the
1355         netmask or interfaces associated with existing addresses.
1356         Such changes must be made in 2 steps by deleting addresses in
1357         question and re-adding then.  Unfortunately this will disrupt
1358         connections to the changed addresses.
1359       </para>
1360     </refsect2>
1362     <refsect2>
1363       <title>getdbmap</title>
1364       <para>
1365         This command lists all clustered TDB databases that the CTDB
1366         daemon has attached to. Some databases are flagged as PERSISTENT,
1367         this means that the database stores data persistently and the
1368         data will remain across reboots. One example of such a database
1369         is secrets.tdb where information about how the cluster was joined
1370         to the domain is stored.  Some database are flagged as REPLICATED,
1371         this means that the data in that database is replicated across all
1372         the nodes.  But the data will not remain across reboots.  This
1373         type of database is used by CTDB to store it's internal state.
1374       </para>
1375       <para>
1376         If a PERSISTENT database is not in a healthy state the database
1377         is flagged as UNHEALTHY. If there's at least one completely
1378         healthy node running in the cluster, it's possible that the
1379         content is restored by a recovery run automaticly. Otherwise an
1380         administrator needs to analyze the problem.
1381       </para>
1382       <para>
1383         See also "ctdb getdbstatus", "ctdb backupdb", "ctdb restoredb",
1384         "ctdb dumpbackup", "ctdb wipedb", "ctdb setvar AllowUnhealthyDBRead 1"
1385         and (if samba or tdb-utils are installed) "tdbtool check".
1386       </para>
1387       <para>
1388         Most databases are not persistent and only store the state
1389         information that the currently running samba daemons need. These
1390         databases are always wiped when ctdb/samba starts and when a
1391         node is rebooted.
1392       </para>
1394       <refsect3>
1395         <title>Example</title>
1396         <screen>
1397 # ctdb getdbmap
1398 Number of databases:10
1399 dbid:0x435d3410 name:notify.tdb path:/usr/local/var/lib/ctdb/notify.tdb.0
1400 dbid:0x42fe72c5 name:locking.tdb path:/usr/local/var/lib/ctdb/locking.tdb.0
1401 dbid:0x1421fb78 name:brlock.tdb path:/usr/local/var/lib/ctdb/brlock.tdb.0
1402 dbid:0x17055d90 name:connections.tdb path:/usr/local/var/lib/ctdb/connections.tdb.0
1403 dbid:0xc0bdde6a name:sessionid.tdb path:/usr/local/var/lib/ctdb/sessionid.tdb.0
1404 dbid:0x122224da name:test.tdb path:/usr/local/var/lib/ctdb/test.tdb.0
1405 dbid:0x2672a57f name:idmap2.tdb path:/usr/local/var/lib/ctdb/persistent/idmap2.tdb.0 PERSISTENT
1406 dbid:0xb775fff6 name:secrets.tdb path:/usr/local/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT
1407 dbid:0xe98e08b6 name:group_mapping.tdb path:/usr/local/var/lib/ctdb/persistent/group_mapping.tdb.0 PERSISTENT
1408 dbid:0x7bbbd26c name:passdb.tdb path:/usr/local/var/lib/ctdb/persistent/passdb.tdb.0 PERSISTENT
1410 # ctdb getdbmap  # example for unhealthy database
1411 Number of databases:1
1412 dbid:0xb775fff6 name:secrets.tdb path:/usr/local/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT UNHEALTHY
1414 # ctdb -X getdbmap
1415 |ID|Name|Path|Persistent|Unhealthy|
1416 |0x7bbbd26c|passdb.tdb|/usr/local/var/lib/ctdb/persistent/passdb.tdb.0|1|0|
1417         </screen>
1418       </refsect3>
1419     </refsect2>
1421     <refsect2>
1422       <title>
1423         backupdb
1424         <parameter>DB</parameter>
1425         <parameter>FILE</parameter>
1426       </title>
1427       <para>
1428         Copy the contents of database DB to FILE.  FILE can later be
1429         read back using <command>restoredb</command>.  This is mainly
1430         useful for backing up persistent databases such as
1431         <filename>secrets.tdb</filename> and similar.
1432       </para>
1433     </refsect2>
1435     <refsect2>
1436       <title>
1437         restoredb
1438         <parameter>FILE</parameter>
1439         <optional><parameter>DB</parameter></optional>
1440       </title>
1441       <para>
1442         This command restores a persistent database that was
1443         previously backed up using backupdb.  By default the data will
1444         be restored back into the same database as it was created
1445         from. By specifying dbname you can restore the data into a
1446         different database.
1447       </para>
1448     </refsect2>
1450     <refsect2>
1451       <title>setdbreadonly <parameter>DB</parameter></title>
1452       <para>
1453         This command will enable the read-only record support for a
1454         database.  This is an experimental feature to improve
1455         performance for contended records primarily in locking.tdb and
1456         brlock.tdb.  When enabling this feature you must set it on all
1457         nodes in the cluster.
1458       </para>
1459     </refsect2>
1461     <refsect2>
1462       <title>setdbsticky <parameter>DB</parameter></title>
1463       <para>
1464         This command will enable the sticky record support for the
1465         specified database.  This is an experimental feature to
1466         improve performance for contended records primarily in
1467         locking.tdb and brlock.tdb.  When enabling this feature you
1468         must set it on all nodes in the cluster.
1469       </para>
1470     </refsect2>
1472   </refsect1>
1474   <refsect1>
1475     <title>INTERNAL COMMANDS</title>
1477     <para>
1478       Internal commands are used by CTDB's scripts and are not
1479       required for managing a CTDB cluster.  Their parameters and
1480       behaviour are subject to change.
1481     </para>
1483     <refsect2>
1484       <title>gettickles <parameter>IPADDR</parameter></title>
1485       <para>
1486         Show TCP connections that are registered with CTDB to be
1487         "tickled" if there is a failover.
1488       </para>
1489     </refsect2>
1491     <refsect2>
1492       <title>gratarp <parameter>IPADDR</parameter> <parameter>INTERFACE</parameter></title>
1493       <para>
1494         Send out a gratuitous ARP for the specified interface through
1495         the specified interface. This command is mainly used by the
1496         ctdb eventscripts.
1497       </para>
1498     </refsect2>
1500     <refsect2>
1501       <title>
1502         pdelete <parameter>DB</parameter> <parameter>KEY</parameter>
1503       </title>
1504       <para>
1505         Delete KEY from DB.
1506       </para>
1507     </refsect2>
1509     <refsect2>
1510       <title>
1511         pfetch <parameter>DB</parameter> <parameter>KEY</parameter>
1512       </title>
1513       <para>
1514         Print the value associated with KEY in DB.
1515       </para>
1516     </refsect2>
1518     <refsect2>
1519       <title>
1520         pstore
1521         <parameter>DB</parameter>
1522         <parameter>KEY</parameter>
1523         <parameter>FILE</parameter>
1524       </title>
1525       <para>
1526         Store KEY in DB with contents of FILE as the associated value.
1527       </para>
1528     </refsect2>
1530     <refsect2>
1531       <title>
1532         ptrans
1533         <parameter>DB</parameter>
1534         <optional><parameter>FILE</parameter></optional>
1535       </title>
1536       <para>
1537         Read a list of key-value pairs, one per line from FILE, and
1538         store them in DB using a single transaction.  An empty value
1539         is equivalent to deleting the given key.
1540       </para>
1541       <para>
1542         The key and value should be separated by spaces or tabs. Each
1543         key/value should be a printable string enclosed in
1544         double-quotes.
1545       </para>
1546     </refsect2>
1548     <refsect2>
1549       <title>runstate [setup|first_recovery|startup|running]</title>
1550       <para>
1551         Print the runstate of the specified node.  Runstates are used
1552         to serialise important state transitions in CTDB, particularly
1553         during startup.
1554       </para>
1555       <para>
1556         If one or more optional runstate arguments are specified then
1557         the node must be in one of these runstates for the command to
1558         succeed.
1559       </para>
1560       <refsect3>
1561         <title>Example</title>
1562         <screen>
1563 # ctdb runstate
1564 RUNNING
1565         </screen>
1566       </refsect3>
1567     </refsect2>
1569     <refsect2>
1570       <title>setifacelink <parameter>IFACE</parameter> up|down</title>
1571       <para>
1572         Set the internal state of network interface IFACE.  This is
1573         typically used in the <filename>10.interface</filename> script
1574         in the "monitor" event.
1575       </para>
1576       <para>
1577         Example: ctdb setifacelink eth0 up
1578       </para>
1579     </refsect2>
1581     <refsect2>
1582       <title>tickle</title>
1583       <para>
1584         Read a list of TCP connections, one per line, from standard
1585         input and send a TCP tickle to the source host for each
1586         connection.  A connection is specified as:
1587       </para>
1588       <synopsis>
1589         <parameter>SRC-IPADDR</parameter>:<parameter>SRC-PORT</parameter> <parameter>DST-IPADDR</parameter>:<parameter>DST-PORT</parameter>
1590       </synopsis>
1591       <para>
1592         A single connection can be specified on the command-line
1593         rather than on standard input.
1594       </para>
1595       <para>
1596         A TCP tickle is a TCP ACK packet with an invalid sequence and
1597         acknowledge number and will when received by the source host
1598         result in it sending an immediate correct ACK back to the
1599         other end.
1600       </para>
1601       <para>
1602         TCP tickles are useful to "tickle" clients after a IP failover has
1603         occurred since this will make the client immediately recognize the
1604         TCP connection has been disrupted and that the client will need
1605         to reestablish. This greatly speeds up the time it takes for a client
1606         to detect and reestablish after an IP failover in the ctdb cluster.
1607       </para>
1608     </refsect2>
1610     <refsect2>
1611       <title>version</title>
1612       <para>
1613         Display the CTDB version.
1614       </para>
1615     </refsect2>
1617   </refsect1>
1619   <refsect1>
1620     <title>DEBUGGING COMMANDS</title>
1621     <para>
1622       These commands are primarily used for CTDB development and testing and
1623       should not be used for normal administration.
1624     </para>
1627     <refsect2>
1628       <title>OPTIONS</title>
1630       <variablelist>
1631         <varlistentry><term>--print-emptyrecords</term>
1632         <listitem>
1633           <para>
1634             This enables printing of empty records when dumping databases
1635             with the catdb, cattbd and dumpdbbackup commands. Records with
1636             empty data segment are considered deleted by ctdb and cleaned
1637             by the vacuuming mechanism, so this switch can come in handy for
1638             debugging the vacuuming behaviour.
1639           </para>
1640         </listitem>
1641         </varlistentry>
1643         <varlistentry><term>--print-datasize</term>
1644         <listitem>
1645           <para>
1646             This lets database dumps (catdb, cattdb, dumpdbbackup) print the
1647             size of the record data instead of dumping the data contents.
1648           </para>
1649         </listitem>
1650         </varlistentry>
1652         <varlistentry><term>--print-lmaster</term>
1653         <listitem>
1654           <para>
1655             This lets catdb print the lmaster for each record.
1656           </para>
1657         </listitem>
1658         </varlistentry>
1660         <varlistentry><term>--print-hash</term>
1661         <listitem>
1662           <para>
1663             This lets database dumps (catdb, cattdb, dumpdbbackup) print the
1664             hash for each record.
1665           </para>
1666         </listitem>
1667         </varlistentry>
1669         <varlistentry><term>--print-recordflags</term>
1670         <listitem>
1671           <para>
1672             This lets catdb and dumpdbbackup print the
1673             record flags for each record. Note that cattdb always
1674             prints the flags.
1675           </para>
1676         </listitem>
1677         </varlistentry>
1679       </variablelist>
1680     </refsect2>
1682     <refsect2>
1683       <title>process-exists <parameter>PID</parameter> <parameter>[SRVID]</parameter></title>
1684       <para>
1685         This command checks if a specific process exists on the CTDB
1686         host. This is mainly used by Samba to check if remote instances
1687         of samba are still running or not.  When the optional SRVID
1688         argument is specified, the command check if a specific process
1689         exists on the CTDB host and has registered for specified SRVID.
1690       </para>
1691     </refsect2>
1693     <refsect2>
1694       <title>getdbstatus <parameter>DB</parameter></title>
1695       <para>
1696         This command displays more details about a database.
1697       </para>
1698       <refsect3>
1699         <title>Example</title>
1700         <screen>
1701 # ctdb getdbstatus test.tdb.0
1702 dbid: 0x122224da
1703 name: test.tdb
1704 path: /usr/local/var/lib/ctdb/test.tdb.0
1705 PERSISTENT: no
1706 HEALTH: OK
1708 # ctdb getdbstatus registry.tdb  # with a corrupted TDB
1709 dbid: 0xf2a58948
1710 name: registry.tdb
1711 path: /usr/local/var/lib/ctdb/persistent/registry.tdb.0
1712 PERSISTENT: yes
1713 HEALTH: NO-HEALTHY-NODES - ERROR - Backup of corrupted TDB in '/usr/local/var/lib/ctdb/persistent/registry.tdb.0.corrupted.20091208091949.0Z'
1714         </screen>
1715       </refsect3>
1716     </refsect2>
1718     <refsect2>
1719       <title>catdb <parameter>DB</parameter></title>
1720       <para>
1721         Print a dump of the clustered TDB database DB.
1722       </para>
1723     </refsect2>
1725     <refsect2>
1726       <title>cattdb <parameter>DB</parameter></title>
1727       <para>
1728         Print a dump of the contents of the local TDB database DB.
1729       </para>
1730     </refsect2>
1732     <refsect2>
1733       <title>dumpdbbackup <parameter>FILE</parameter></title>
1734       <para>
1735         Print a dump of the contents from database backup FILE,
1736         similar to <command>catdb</command>.
1737       </para>
1738     </refsect2>
1740     <refsect2>
1741       <title>wipedb <parameter>DB</parameter></title>
1742       <para>
1743         Remove all contents of database DB.
1744       </para>
1745     </refsect2>
1747     <refsect2>
1748       <title>recover</title>
1749       <para>
1750         This command will trigger the recovery daemon to do a cluster
1751         recovery.
1752       </para>
1753     </refsect2>
1755     <refsect2>
1756       <title>ipreallocate, sync</title>
1757       <para>
1758         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.
1759       </para>
1760     </refsect2>
1762     <refsect2>
1763       <title>getmonmode</title>
1764       <para>
1765         This command prints the monitoring mode of a node.  This
1766         indicates when CTDB is monitoring services on the node. The
1767         monitoring mode is either ENABLED or DISABLED.
1768       </para>
1769     </refsect2>
1771     <refsect2>
1772       <title>attach <parameter>DBNAME</parameter> [persistent|replicated]</title>
1773       <para>
1774         Create a new CTDB database called DBNAME and attach to it on
1775         all nodes.
1776       </para>
1777     </refsect2>
1779     <refsect2>
1780       <title>detach <parameter>DB-LIST</parameter></title>
1781       <para>
1782         Detach specified non-persistent database(s) from the cluster. This
1783         command will disconnect specified database(s) on all nodes in
1784         the cluster.  This command should only be used when none of the
1785         specified database(s) are in use.
1786       </para>
1787       <para>
1788         All nodes should be active and tunable AllowClientDBAccess should
1789         be disabled on all nodes before detaching databases.
1790       </para>
1791     </refsect2>
1793     <refsect2>
1794       <title>dumpmemory</title>
1795       <para>
1796         This is a debugging command. This command will make the ctdb
1797         daemon to write a fill memory allocation map to standard output.
1798       </para>
1799     </refsect2>
1801     <refsect2>
1802       <title>rddumpmemory</title>
1803       <para>
1804         This is a debugging command. This command will dump the talloc memory
1805         allocation tree for the recovery daemon to standard output.
1806       </para>
1807     </refsect2>
1809     <refsect2>
1810       <title>ban <parameter>BANTIME</parameter></title>
1811       <para>
1812         Administratively ban a node for BANTIME seconds.  The node
1813         will be unbanned after BANTIME seconds have elapsed.
1814       </para>
1815       <para>
1816         A banned node does not participate in the cluster.  It does
1817         not host any records for the clustered TDB and does not host
1818         any public IP addresses.
1819       </para>
1820       <para>
1821         Nodes are automatically banned if they misbehave.  For
1822         example, a node may be banned if it causes too many cluster
1823         recoveries.
1824       </para>
1825       <para>
1826         To administratively exclude a node from a cluster use the
1827         <command>stop</command> command.
1828       </para>
1829     </refsect2>
1831     <refsect2>
1832       <title>unban</title>
1833       <para>
1834         This command is used to unban a node that has either been
1835         administratively banned using the ban command or has been
1836         automatically banned.
1837       </para>
1838     </refsect2>
1840     <refsect2>
1841       <title>check_srvids <parameter>SRVID</parameter> ...</title>
1842       <para>
1843         This command checks whether a set of srvid message ports are
1844         registered on the node or not. The command takes a list of
1845         values to check.
1846       </para>
1847       <refsect3>
1848         <title>Example</title>
1849         <screen>
1850 # ctdb check_srvids 1 2 3 14765
1851 Server id 0:1 does not exist
1852 Server id 0:2 does not exist
1853 Server id 0:3 does not exist
1854 Server id 0:14765 exists
1855         </screen>
1856       </refsect3>
1857     </refsect2>
1859   </refsect1>
1861   <!-- UNDOCUMENTED: showban stats disablemonitor enablemonitor
1862        isnotrecmaster addtickle deltickle
1863        msglisten msgsend
1864        tfetch tstore readkey writekey
1865        checktcpport getdbseqnum ipiface
1866   -->
1868   <refsect1>
1869     <title>SEE ALSO</title>
1870     <para>
1871       <citerefentry><refentrytitle>ctdbd</refentrytitle>
1872       <manvolnum>1</manvolnum></citerefentry>,
1874       <citerefentry><refentrytitle>onnode</refentrytitle>
1875       <manvolnum>1</manvolnum></citerefentry>,
1877       <citerefentry><refentrytitle>ctdb</refentrytitle>
1878       <manvolnum>7</manvolnum></citerefentry>,
1880       <citerefentry><refentrytitle>ctdb-statistics</refentrytitle>
1881       <manvolnum>7</manvolnum></citerefentry>,
1883       <citerefentry><refentrytitle>ctdb-tunables</refentrytitle>
1884       <manvolnum>7</manvolnum></citerefentry>,
1886       <ulink url="http://ctdb.samba.org/"/>
1887     </para>
1888   </refsect1>
1891 </refentry>