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