LIBCTDB: add support for traverse
[sahlberg/ctdb.git] / doc / ctdb.1.xml
index f243ce1044abdc6c2be6007b37cb95050fbe22dd..31832a385cc8ec5c03b814bcaac859dfbefe2e33 100644 (file)
@@ -5,6 +5,8 @@
 <refmeta>
        <refentrytitle>ctdb</refentrytitle>
        <manvolnum>1</manvolnum>
+       <refmiscinfo class="source">ctdb</refmiscinfo>
+       <refmiscinfo class="manual">CTDB - clustered TDB database</refmiscinfo>
 </refmeta>
 
 
@@ -47,7 +49,7 @@
         <listitem>
           <para>
             This specifies the physical node number on which to execute the 
-           command. Default is to run the command on the deamon running on 
+           command. Default is to run the command on the daemon running on 
            the local host.
          </para>
          <para>
       This node does not perticipate in the CTDB cluster but can still be
       communicated with. I.e. ctdb commands can be sent to it.
         </para>
+        <para>
+       PARTIALLYONLINE - A node that is partially online participates
+       in a cluster like a node that is ok. Some interfaces to serve
+       public ip addresses are down, but at least one interface is up.
+       See also "ctdb ifaces".
+        </para>
       </refsect3>
 
       <refsect3><title>generation</title>
@@ -321,6 +329,50 @@ response from 3 time=0.000114 sec  (2 clients)
       </screen>
     </refsect2>
 
+    <refsect2><title>ifaces</title>
+      <para>
+       This command will display the list of network interfaces, which could
+       host public addresses, along with their status.
+      </para>
+      <para>
+       Example: ctdb ifaces
+      </para>
+      <para>
+       Example output:
+      </para>
+      <screen format="linespecific">
+Interfaces on node 0
+name:eth5 link:up references:2
+name:eth4 link:down references:0
+name:eth3 link:up references:1
+name:eth2 link:up references:1
+      </screen>
+      <para>
+       Example: ctdb ifaces -Y
+      </para>
+      <para>
+       Example output:
+      </para>
+      <screen format="linespecific">
+:Name:LinkStatus:References:
+:eth5:1:2
+:eth4:0:0
+:eth3:1:1
+:eth2:1:1
+      </screen>
+    </refsect2>
+
+    <refsect2><title>setifacelink &lt;iface&gt; &lt;status&gt;</title>
+      <para>
+       This command will set the status of a network interface.
+       The status needs to be "up" or "down". This is typically
+       used in the 10.interfaces script in the "monitor" event.
+      </para>
+      <para>
+       Example: ctdb setifacelink eth0 up
+      </para>
+    </refsect2>
+
     <refsect2><title>ip</title>
       <para>
         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".
@@ -332,11 +384,52 @@ response from 3 time=0.000114 sec  (2 clients)
        Example output:
       </para>
       <screen format="linespecific">
-Number of addresses:4
-12.1.1.1         0
-12.1.1.2         1
-12.1.1.3         2
-12.1.1.4         3
+Public IPs on node 0
+172.31.91.82 node[1] active[] available[eth2,eth3] configured[eth2,eth3]
+172.31.91.83 node[0] active[eth3] available[eth2,eth3] configured[eth2,eth3]
+172.31.91.84 node[1] active[] available[eth2,eth3] configured[eth2,eth3]
+172.31.91.85 node[0] active[eth2] available[eth2,eth3] configured[eth2,eth3]
+172.31.92.82 node[1] active[] available[eth5] configured[eth4,eth5]
+172.31.92.83 node[0] active[eth5] available[eth5] configured[eth4,eth5]
+172.31.92.84 node[1] active[] available[eth5] configured[eth4,eth5]
+172.31.92.85 node[0] active[eth5] available[eth5] configured[eth4,eth5]
+      </screen>
+      <para>
+       Example: ctdb ip -Y
+      </para>
+      <para>
+       Example output:
+      </para>
+      <screen format="linespecific">
+:Public IP:Node:ActiveInterface:AvailableInterfaces:ConfiguredInterfaces:
+:172.31.91.82:1::eth2,eth3:eth2,eth3:
+:172.31.91.83:0:eth3:eth2,eth3:eth2,eth3:
+:172.31.91.84:1::eth2,eth3:eth2,eth3:
+:172.31.91.85:0:eth2:eth2,eth3:eth2,eth3:
+:172.31.92.82:1::eth5:eth4,eth5:
+:172.31.92.83:0:eth5:eth5:eth4,eth5:
+:172.31.92.84:1::eth5:eth4,eth5:
+:172.31.92.85:0:eth5:eth5:eth4,eth5:
+      </screen>
+    </refsect2>
+
+    <refsect2><title>ipinfo &lt;ip&gt;</title>
+      <para>
+        This command will display details about the specified public addresses.
+      </para>
+      <para>
+       Example: ctdb ipinfo 172.31.92.85
+      </para>
+      <para>
+       Example output:
+      </para>
+      <screen format="linespecific">
+Public IP[172.31.92.85] info on node 0
+IP:172.31.92.85
+CurrentNode:0
+NumInterfaces:2
+Interface[1]: Name:eth4 Link:down References:0
+Interface[2]: Name:eth5 Link:up References:2 (active)
       </screen>
     </refsect2>
 
@@ -417,21 +510,48 @@ MaxRedirectCount    = 3
        Example output:
       </para>
       <screen format="linespecific">
-MaxRedirectCount    = 5
-SeqnumFrequency     = 1
+MaxRedirectCount    = 3
+SeqnumInterval      = 1000
 ControlTimeout      = 60
 TraverseTimeout     = 20
-KeepaliveInterval   = 2
-KeepaliveLimit      = 3
+KeepaliveInterval   = 5
+KeepaliveLimit      = 5
 MaxLACount          = 7
-RecoverTimeout      = 5
+RecoverTimeout      = 20
 RecoverInterval     = 1
 ElectionTimeout     = 3
 TakeoverTimeout     = 5
 MonitorInterval     = 15
-EventScriptTimeout  = 20
-RecoveryGracePeriod = 60
+TickleUpdateInterval = 20
+EventScriptTimeout  = 30
+EventScriptBanCount = 10
+EventScriptUnhealthyOnTimeout = 0
+RecoveryGracePeriod = 120
 RecoveryBanPeriod   = 300
+DatabaseHashSize    = 10000
+DatabaseMaxDead     = 5
+RerecoveryTimeout   = 10
+EnableBans          = 1
+DeterministicIPs    = 1
+DisableWhenUnhealthy = 0
+ReclockPingPeriod   = 60
+NoIPFailback        = 0
+VerboseMemoryNames  = 0
+RecdPingTimeout     = 60
+RecdFailCount       = 10
+LogLatencyMs        = 0
+RecLockLatencyMs    = 1000
+RecoveryDropAllIPs  = 60
+VerifyRecoveryLock  = 1
+VacuumDefaultInterval = 300
+VacuumMaxRunTime    = 30
+RepackLimit         = 10000
+VacuumLimit         = 5000
+VacuumMinInterval   = 60
+VacuumMaxInterval   = 600
+MaxQueueDropMsg     = 1000
+UseStatusEvents     = 0
+AllowUnhealthyDBRead = 0
       </screen>
     </refsect2>
 
@@ -900,16 +1020,19 @@ Reclock file:/gpfs/.ctdb/shared
       </para>
     </refsect2>
 
-    <refsect2><title>backupdb &lt;database&gt; &lt;file&gt;</title>
+    <refsect2><title>backupdb &lt;dbname&gt; &lt;file&gt;</title>
       <para>
         This command can be used to copy the entire content of a database out to a file. This file can later be read back into ctdb using the restoredb command.
 This is mainly useful for backing up persistent databases such as secrets.tdb and similar.
       </para>
     </refsect2>
 
-    <refsect2><title>restoredb &lt;file&gt;</title>
+    <refsect2><title>restoredb &lt;file&gt; [dbname]</title>
       <para>
         This command restores a persistent database that was previously backed up using backupdb.
+       By default the data will be restored back into the same database as
+       it was created from. By specifying dbname you can restore the data
+       into a different database.
       </para>
     </refsect2>
 
@@ -921,6 +1044,30 @@ This is mainly useful for backing up persistent databases such as secrets.tdb an
   </refsect1>
 
 
+    <refsect2><title>getlog &lt;level&gt;</title>
+      <para>
+       In addition to the normal loggign to a log file,
+       CTDBD also keeps a in-memory ringbuffer containing the most recent
+       log entries for all log levels (except DEBUG).
+      </para><para>
+       This is useful since it allows for keeping continous logs to a file
+       at a reasonable non-verbose level, but shortly after an incident has
+       occured, a much more detailed log can be pulled from memory. This
+       can allow you to avoid having to reproduce an issue due to the
+       on-disk logs being of insufficient detail.
+      </para><para>
+       This command extracts all messages of level or lower log level from
+       memory and prints it to the screen.
+      </para>
+    </refsect2>
+
+    <refsect2><title>clearlog</title>
+      <para>
+       This command clears the in-memory logging ringbuffer.
+      </para>
+    </refsect2>
+
+
   <refsect1><title>Debugging Commands</title>
     <para>
       These commands are primarily used for CTDB development and testing and
@@ -960,7 +1107,8 @@ This is mainly useful for backing up persistent databases such as secrets.tdb an
       <screen format="linespecific">
 Number of databases:10
 dbid:0x435d3410 name:notify.tdb path:/var/ctdb/notify.tdb.0 
-dbid:0x42fe72c5 name:locking.tdb path:/var/ctdb/locking.tdb.0 dbid:0x1421fb78 name:brlock.tdb path:/var/ctdb/brlock.tdb.0 
+dbid:0x42fe72c5 name:locking.tdb path:/var/ctdb/locking.tdb.0
+dbid:0x1421fb78 name:brlock.tdb path:/var/ctdb/brlock.tdb.0 
 dbid:0x17055d90 name:connections.tdb path:/var/ctdb/connections.tdb.0 
 dbid:0xc0bdde6a name:sessionid.tdb path:/var/ctdb/sessionid.tdb.0 
 dbid:0x122224da name:test.tdb path:/var/ctdb/test.tdb.0 
@@ -986,6 +1134,38 @@ dbid:0xb775fff6 name:secrets.tdb path:/var/ctdb/persistent/secrets.tdb.0 PERSIST
       </screen>
     </refsect2>
 
+    <refsect2><title>getdbstatus &lt;dbname&gt;</title>
+      <para>
+       This command displays more details about a database.
+      </para>
+      <para>
+       Example: ctdb getdbstatus test.tdb.0
+      </para>
+      <para>
+       Example output:
+      </para>
+      <screen format="linespecific">
+dbid: 0x122224da
+name: test.tdb
+path: /var/ctdb/test.tdb.0
+PERSISTENT: no
+HEALTH: OK
+      </screen>
+      <para>
+       Example: ctdb getdbstatus registry.tdb (with a corrupted TDB)
+      </para>
+      <para>
+       Example output:
+      </para>
+      <screen format="linespecific">
+dbid: 0xf2a58948
+name: registry.tdb
+path: /var/ctdb/persistent/registry.tdb.0
+PERSISTENT: yes
+HEALTH: NO-HEALTHY-NODES - ERROR - Backup of corrupted TDB in '/var/ctdb/persistent/registry.tdb.0.corrupted.20091208091949.0Z'
+      </screen>
+    </refsect2>
+
     <refsect2><title>catdb &lt;dbname&gt;</title>
       <para>
         This command will dump a clustered TDB database to the screen. This is a debugging command.
@@ -1014,7 +1194,7 @@ dbid:0xb775fff6 name:secrets.tdb path:/var/ctdb/persistent/secrets.tdb.0 PERSIST
 
     <refsect2><title>setmonmode &lt;0|1&gt;</title>
       <para>
-        This command can be used to explicitely 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.
+        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.
       </para>
     </refsect2>
 
@@ -1038,19 +1218,6 @@ dbid:0xb775fff6 name:secrets.tdb path:/var/ctdb/persistent/secrets.tdb.0 PERSIST
       </para>
     </refsect2>
 
-    <refsect2><title>freeze</title>
-      <para>
-        This command will lock all the local TDB databases causing clients 
-        that are accessing these TDBs such as samba3 to block until the
-        databases are thawed.
-      </para>
-      <para>
-        This is primarily used by the recovery daemon to stop all samba
-        daemons from accessing any databases while the database is recovered
-        and rebuilt.
-      </para>
-    </refsect2>
-
     <refsect2><title>thaw</title>
       <para>
         Thaw a previously frozen node.
@@ -1070,7 +1237,7 @@ dbid:0xb775fff6 name:secrets.tdb path:/var/ctdb/persistent/secrets.tdb.0 PERSIST
         Administratively ban a node for bantime seconds. A bantime of 0 means that the node should be permanently banned. 
       </para>
       <para>
-        A banned node does not participate in the cluster and does not host any records for the clustered TDB. Its ip address has been taken over by an other node and no services are hosted.
+        A banned node does not participate in the cluster and does not host any records for the clustered TDB. Its ip address has been taken over by another node and no services are hosted.
       </para>
       <para>
         Nodes are automatically banned if they are the cause of too many