document the ipreallocate command
[sahlberg/ctdb.git] / doc / ctdb.1.xml
index d3d816fac4b960cdf5d7403890032035c47b2bee..b0661fd374fbe76d0a45bd97193fd020370c3c8c 100644 (file)
       These are commands used to monitor and administrate a CTDB cluster.
     </para>
 
+    <refsect2><title>pnn</title>
+      <para>
+        This command displays the pnn of the current node.
+      </para>
+    </refsect2>
+
     <refsect2><title>status</title>
       <para>
         This command shows the current status of the ctdb node.
 
       <refsect3><title>node status</title>
         <para>
-          Node status reflects the current status of the node. There are four possible states:
+          Node status reflects the current status of the node. There are five possible states:
         </para>
         <para>
           OK - This node is fully functional.
@@ -250,6 +256,46 @@ Recovery master:0
       </screen>
     </refsect2>
 
+    <refsect2><title>recmaster</title>
+      <para>
+        This command shows the pnn of the node which is currently the recmaster.
+      </para>
+    </refsect2>
+
+    <refsect2><title>uptime</title>
+      <para>
+        This command shows the uptime for the ctdb daemon. When the last recovery completed and how long the last recovery took. If the "duration" is shown as a negative number, this indicates that there is a recovery in progress and it started that many seconds ago.
+      </para>
+
+      <para>
+       Example: ctdb uptime
+      </para>
+      <para>Example output:</para>
+      <screen format="linespecific">
+Current time of node  : Tue Mar 24 18:27:54 2009
+Ctdbd start time      : (000 00:00:05) Tue Mar 24 18:27:49 2009
+Time of last recovery : (000 00:00:05) Tue Mar 24 18:27:49 2009
+Duration of last recovery : 0.000000 seconds
+      </screen>
+    </refsect2>
+
+    <refsect2><title>listnodes</title>
+      <para>
+        This command shows lists the ip addresses of all the nodes in the cluster.
+      </para>
+
+      <para>
+       Example: ctdb listnodes
+      </para>
+      <para>Example output:</para>
+      <screen format="linespecific">
+10.0.0.71
+10.0.0.72
+10.0.0.73
+10.0.0.74
+      </screen>
+    </refsect2>
+
     <refsect2><title>ping</title>
       <para>
         This command will "ping" all CTDB daemons in the cluster to verify that they are processing commands correctly.
@@ -270,7 +316,7 @@ response from 3 time=0.000114 sec  (2 clients)
 
     <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.
+        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".
       </para>
       <para>
        Example: ctdb ip
@@ -287,6 +333,29 @@ Number of addresses:4
       </screen>
     </refsect2>
 
+    <refsect2><title>scriptstatus</title>
+      <para>
+        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.
+      </para>
+      <para>
+       Example: ctdb scriptstatus
+      </para>
+      <para>
+       Example output:
+      </para>
+      <screen format="linespecific">
+7 scripts were executed last monitoring cycle
+00.ctdb              Status:OK    Duration:0.056 Tue Mar 24 18:56:57 2009
+10.interface         Status:OK    Duration:0.077 Tue Mar 24 18:56:57 2009
+11.natgw             Status:OK    Duration:0.039 Tue Mar 24 18:56:57 2009
+20.multipathd        Status:OK    Duration:0.038 Tue Mar 24 18:56:57 2009
+40.vsftpd            Status:OK    Duration:0.045 Tue Mar 24 18:56:57 2009
+41.httpd             Status:OK    Duration:0.039 Tue Mar 24 18:56:57 2009
+50.samba             Status:ERROR    Duration:0.082 Tue Mar 24 18:56:57 2009
+   OUTPUT:ERROR: Samba tcp port 445 is not responding
+      </screen>
+    </refsect2>
+
     <refsect2><title>getvar &lt;name&gt;</title>
       <para>
         Get the runtime value of a tuneable variable.
@@ -340,6 +409,78 @@ RecoveryBanPeriod   = 300
       </screen>
     </refsect2>
 
+    <refsect2><title>lvsmaster</title>
+      <para>
+      This command shows which node is currently the LVSMASTER. The
+      LVSMASTER is the node in the cluster which drives the LVS system and
+      which receives all incoming traffic from clients.
+      </para>
+      <para>
+      LVS is the mode where the entire CTDB/Samba cluster uses a single
+      ip address for the entire cluster. In this mode all clients connect to
+      one specific node which will then multiplex/loadbalance the clients
+      evenly onto the other nodes in the cluster. This is an alternative to using
+      public ip addresses. See the manpage for ctdbd for more information
+      about LVS.
+      </para>
+    </refsect2>
+
+    <refsect2><title>lvs</title>
+      <para>
+      This command shows which nodes in the cluster are currently active in the
+      LVS configuration. I.e. which nodes we are currently loadbalancing
+      the single ip address across.
+      </para>
+
+      <para>
+      LVS will by default only loadbalance across those nodes that are both
+      LVS capable and also HEALTHY. Except if all nodes are UNHEALTHY in which
+      case LVS will loadbalance across all UNHEALTHY nodes as well.
+      LVS will never use nodes that are DISCONNECTED, BANNED or DISABLED.
+      </para>
+
+      <para>
+       Example output:
+      </para>
+      <screen format="linespecific">
+2:10.0.0.13
+3:10.0.0.14
+      </screen>
+
+    </refsect2>
+
+
+    <refsect2><title>getcapabilities</title>
+      <para>
+      This command shows the capabilities of the current node.
+      Please see manpage for ctdbd for a full list of all capabilities and
+      more detailed description.
+      </para>
+
+      <para>
+      RECMASTER and LMASTER capabilities are primarily used when CTDBD
+      is used to create a cluster spanning across WAN links. In which case
+      ctdbd acts as a WAN accelerator.
+      </para>
+
+      <para>
+      LVS capabile means that the node is participating in LVS, a mode
+      where the entire CTDB cluster uses one single ip address for the
+      entire cluster instead of using public ip address failover.
+      This is an alternative to using a loadbalancing layer-4 switch.
+      </para>
+
+      <para>
+       Example output:
+      </para>
+      <screen format="linespecific">
+RECMASTER: YES
+LMASTER: YES
+LVS: NO
+      </screen>
+
+    </refsect2>
+
     <refsect2><title>statistics</title>
       <para>
         Collect statistics from the CTDB daemon about how many calls it has served.
@@ -398,6 +539,36 @@ CTDB version 1
       </para>
     </refsect2>
 
+    <refsect2><title>getreclock</title>
+      <para>
+       This command is used to show the filename of the reclock file that is used.
+      </para>
+
+      <para>
+       Example output:
+      </para>
+      <screen format="linespecific">
+Reclock file:/gpfs/.ctdb/shared
+      </screen>
+
+    </refsect2>
+
+    <refsect2><title>setreclock [filename]</title>
+      <para>
+       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".
+      </para>
+
+      <para>
+       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.
+      </para>
+
+      <para>
+       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.
+      </para>
+    </refsect2>
+
+
+
     <refsect2><title>getdebug</title>
       <para>
         Get the current debug level for the node. the debug level controls what information is written to the log file.
@@ -458,6 +629,29 @@ CTDB version 1
       </para>
     </refsect2>
 
+    <refsect2><title>addip &lt;public_ip/mask&gt; &lt;iface&gt;</title>
+      <para>
+       This command is used to add a new public ip to a node during runtime.
+       This allows public addresses to be added to a cluster without having
+       to restart the ctdb daemons.
+      </para>
+      <para>
+       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.
+ If you want this change to be permanent you must also update the public addresses file manually.
+      </para>
+    </refsect2>
+
+    <refsect2><title>delip &lt;public_ip&gt;</title>
+      <para>
+       This command is used to remove a public ip from a node during runtime.
+       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.
+      </para>
+      <para>
+       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.
+ If you want this change to be permanent you must also update the public addresses file manually.
+      </para>
+    </refsect2>
+
     <refsect2><title>moveip &lt;public_ip&gt; &lt;node&gt;</title>
       <para>
       This command can be used to manually fail a public ip address to a
@@ -497,24 +691,34 @@ CTDB version 1
       </para>
     </refsect2>
 
+    <refsect2><title>ipreallocate</title>
+      <para>
+        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.
+      </para>
+    </refsect2>
+
     <refsect2><title>killtcp &lt;srcip:port&gt; &lt;dstip:port&gt;</title>
       <para>
         This command will kill the specified TCP connection by issuing a
-        TCP RST to the srcip:port endpoint.
+        TCP RST to the srcip:port endpoint. This is a command used by the 
+       ctdb eventscripts.
+      </para>
+    </refsect2>
+
+    <refsect2><title>gratiousarp &lt;ip&gt; &lt;interface&gt;</title>
+      <para>
+       This command will send out a gratious arp for the specified interface
+       through the specified interface. This command is mainly used by the
+       ctdb eventscripts.
       </para>
     </refsect2>
 
     <refsect2><title>reloadnodes</title>
       <para>
-      This command is used when adding new nodes to an existing cluster and
-      to reduce the disruption of this operation. This command should never
-      be used except when expanding an existing cluster.
-      This can only be used to expand a cluster. To remove a node from the
-      cluster you still need to shut down ctdb on all nodes, edit the nodes file
-      and restart ctdb.
+      This command is used when adding new nodes, or removing existing nodes from an existing cluster.
       </para>
       <para>
-      Procedure:
+      Procedure to add a node:
       </para>
       <para>
       1, To expand an existing cluster, first ensure with 'ctdb status' that
@@ -529,7 +733,7 @@ CTDB version 1
       3, Verify that all the nodes have identical /etc/ctdb/nodes files after you edited them and added the new node!
       </para>
       <para>
-      4, Run 'ctdb reloadnodes' to force all nodes to reaload the nodesfile.
+      4, Run 'ctdb reloadnodes' to force all nodes to reload the nodesfile.
       </para>
       <para>
       5, Use 'ctdb status' on all nodes and verify that they now show the additional node.
@@ -537,6 +741,29 @@ CTDB version 1
       <para>
       6, Install and configure the new node and bring it online.
       </para>
+      <para>
+      Procedure to remove a node:
+      </para>
+      <para>
+      1, To remove a node from an existing cluster, first ensure with 'ctdb status' that
+      all nodes, except the node to be deleted, are up and running and that they are all healthy.
+      Do not try to remove a node from a cluster unless the cluster is completely healthy!
+      </para>
+      <para>
+      2, Shutdown and poerwoff the node to be removed.
+      </para>
+      <para>
+      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.
+      </para>
+      <para>
+      4, Run 'ctdb reloadnodes' to force all nodes to reload the nodesfile.
+      </para>
+      <para>
+      5, Use 'ctdb status' on all nodes and verify that the deleted node no longer shows up in the list..
+      </para>
+      <para>
+      </para>
+      
     </refsect2>
 
     <refsect2><title>tickle &lt;srcip:port&gt; &lt;dstip:port&gt;</title>
@@ -556,6 +783,12 @@ CTDB version 1
       </para>
     </refsect2>
 
+    <refsect2><title>gettickles &lt;ip&gt;</title>
+      <para>
+       This command is used to show which TCP connections are registered with
+       CTDB to be "tickled" if there is a failover.
+      </para>
+    </refsect2>
     <refsect2><title>repack [max_freelist]</title>
       <para>
        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.
@@ -694,6 +927,13 @@ dbid:0x7bbbd26c name:passdb.tdb path:/var/ctdb/persistent/passdb.tdb.0 PERSISTEN
       </para>
     </refsect2>
 
+    <refsect2><title>rddumpmemory</title>
+      <para>
+        This is a debugging command. This command will dump the talloc memory
+       allocation tree for the recovery daemon to standard output.
+      </para>
+    </refsect2>
+
     <refsect2><title>freeze</title>
       <para>
         This command will lock all the local TDB databases causing clients 
@@ -713,8 +953,29 @@ dbid:0x7bbbd26c name:passdb.tdb path:/var/ctdb/persistent/passdb.tdb.0 PERSISTEN
       </para>
     </refsect2>
 
-  </refsect1>
 
+    <refsect2><title>eventscript &lt;arguments&gt;</title>
+      <para>
+        This is a debugging command. This command can be used to manually
+       invoke and run the eventscritps with arbitrary arguments.
+      </para>
+    </refsect2>
+
+    <refsect2><title>backupdb &lt;database&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>
+      <para>
+        This command restores a persistent database that was previously backed up using backupdb.
+      </para>
+    </refsect2>
+
+
+  </refsect1>
 
   <refsect1><title>SEE ALSO</title>
     <para>