doc updates
authorRonnie Sahlberg <sahlberg@ronnie>
Wed, 16 Jan 2008 03:04:16 +0000 (14:04 +1100)
committerRonnie Sahlberg <sahlberg@ronnie>
Wed, 16 Jan 2008 03:04:16 +0000 (14:04 +1100)
(This used to be ctdb commit 968866699604bae8cdf43478ad2b2cb1c4df6dbc)

ctdb/doc/ctdb.1
ctdb/doc/ctdb.1.html
ctdb/doc/ctdb.1.xml

index d1f49789ac5c3563d341be322c2f749c86d476c2..441bfa62198acb4971e2af71155a601436f89b44 100644 (file)
@@ -100,6 +100,10 @@ BANNED \- This node failed too many recovery attempts and has been banned from p
 .RS
 .PP
 The generation id is a number that indicates the current generation of a cluster instance. Each time a cluster goes through a reconfiguration or a recovery its generation id will be changed.
+.PP
+This number does not have any particular meaning other than to keep track of when a cluster has gone through a recovery. It is a random number that represents the current instance of a ctdb cluster and its databases. CTDBD uses this number internally to be able to tell when commands to operate on the cluster and the databases was issued in a different generation of the cluster, to ensure that commands that operate on the databases will not survive across a cluster database recovery. After a recovery, all old outstanding commands will automatically become invalid.
+.PP
+Sometimes this number will be shown as "INVALID". This only means that the ctdbd daemon has started but it has not yet merged with the cluster through a recovery. All nodes start with generation "INVALID" and are not assigned a real generation id until they have successfully been merged with a cluster through a recovery.
 .RE
 .sp
 .it 1 an-trap
@@ -124,6 +128,10 @@ This is the current recovery mode of the cluster. There are two possible modes:
 NORMAL \- The cluster is fully operational.
 .PP
 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.
+.PP
+Once the recovery master detects an inconsistency, for example a node becomes disconnected/connected, the recovery daemon will trigger a cluster recovery process, where all databases are remerged across the cluster. When this process starts, the recovery master will first "freeze" all databases to prevent applications such as samba from accessing the databases and it will also mark the recovery mode as RECOVERY.
+.PP
+When CTDBD starts up, it will start in RECOVERY mode. Once the node has been merged into a cluster and all databases have been recovered, the node mode will change into NORMAL mode and the databases will be "thawed", allowing samba to access the databases again.
 .RE
 .sp
 .it 1 an-trap
@@ -134,6 +142,8 @@ RECOVERY \- The cluster databases have all been frozen, pausing all services whi
 .RS
 .PP
 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.
+.PP
+Only one node at a time can be the designated recovery master. Which node is designated the recovery master is decided by an election process in the recovery daemons running on each node.
 .RE
 .PP
 Example: ctdb status
index c8a58d837b21034cb62fd12fc59bfa7f681d6fe9..5d830df3b60862b1ef1d222728f1d427a2aacc07 100644 (file)
           The generation id is a number that indicates the current generation 
           of a cluster instance. Each time a cluster goes through a 
           reconfiguration or a recovery its generation id will be changed.
-        </p></div><div class="refsect3" lang="en"><a name="id2481283"></a><h4>VNNMAP</h4><p>
+         </p><p>
+         This number does not have any particular meaning other than to keep
+         track of when a cluster has gone through a recovery. It is a random
+         number that represents the current instance of a ctdb cluster
+         and its databases.
+         CTDBD uses this number internally to be able to tell when commands 
+         to operate on the cluster and the databases was issued in a different
+         generation of the cluster, to ensure that commands that operate
+         on the databases will not survive across a cluster database recovery.
+         After a recovery, all old outstanding commands will automatically
+         become invalid. 
+        </p><p>
+         Sometimes this number will be shown as "INVALID". This only means that
+         the ctdbd daemon has started but it has not yet merged with the cluster through a recovery.
+         All nodes start with generation "INVALID" and are not assigned a real
+         generation id until they have successfully been merged with a cluster
+         through a recovery.
+        </p></div><div class="refsect3" lang="en"><a name="id2481306"></a><h4>VNNMAP</h4><p>
           The list of Virtual Node Numbers. This is a list of all nodes that actively participates in the cluster and that share the workload of hosting the Clustered TDB database records.
           Only nodes that are participating in the vnnmap can become lmaster or dmaster for a database record.
-        </p></div><div class="refsect3" lang="en"><a name="id2481297"></a><h4>Recovery mode</h4><p>
+        </p></div><div class="refsect3" lang="en"><a name="id2481320"></a><h4>Recovery mode</h4><p>
           This is the current recovery mode of the cluster. There are two possible modes:
         </p><p>
           NORMAL - The cluster is fully operational.
         </p><p>
           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.
-        </p></div><div class="refsect3" lang="en"><a name="id2481321"></a><h4>Recovery master</h4><p>
+        </p><p>
+       Once the recovery master detects an inconsistency, for example a node 
+       becomes disconnected/connected, the recovery daemon will trigger a 
+       cluster recovery process, where all databases are remerged across the
+       cluster. When this process starts, the recovery master will first
+       "freeze" all databases to prevent applications such as samba from 
+       accessing the databases and it will also mark the recovery mode as
+       RECOVERY.
+       </p><p>
+       When CTDBD starts up, it will start in RECOVERY mode.
+       Once the node has been merged into a cluster and all databases
+       have been recovered, the node mode will change into NORMAL mode
+       and the databases will be "thawed", allowing samba to access the
+       databases again.
+       </p></div><div class="refsect3" lang="en"><a name="id2528425"></a><h4>Recovery master</h4><p>
           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.
+        </p><p>
+       Only one node at a time can be the designated recovery master. Which
+       node is designated the recovery master is decided by an election
+       process in the recovery daemons running on each node.
         </p></div><p>
        Example: ctdb status
       </p><p>Example output:</p><pre class="screen">
@@ -75,7 +110,7 @@ hash:2 lmaster:2
 hash:3 lmaster:3
 Recovery mode:NORMAL (0)
 Recovery master:0
-      </pre></div><div class="refsect2" lang="en"><a name="id2528410"></a><h3>ping</h3><p>
+      </pre></div><div class="refsect2" lang="en"><a name="id2528458"></a><h3>ping</h3><p>
         This command will "ping" all CTDB daemons in the cluster to verify that they are processing commands correctly.
       </p><p>
        Example: ctdb ping
@@ -86,7 +121,7 @@ response from 0 time=0.000054 sec  (3 clients)
 response from 1 time=0.000144 sec  (2 clients)
 response from 2 time=0.000105 sec  (2 clients)
 response from 3 time=0.000114 sec  (2 clients)
-      </pre></div><div class="refsect2" lang="en"><a name="id2528437"></a><h3>ip</h3><p>
+      </pre></div><div class="refsect2" lang="en"><a name="id2528484"></a><h3>ip</h3><p>
         This command will display the list of public addresses that are provided by the cluster and which physical node is currently serving this ip.
       </p><p>
        Example: ctdb ip
@@ -98,7 +133,7 @@ Number of addresses:4
 12.1.1.2         1
 12.1.1.3         2
 12.1.1.4         3
-      </pre></div><div class="refsect2" lang="en"><a name="id2528462"></a><h3>getvar &lt;name&gt;</h3><p>
+      </pre></div><div class="refsect2" lang="en"><a name="id2528510"></a><h3>getvar &lt;name&gt;</h3><p>
         Get the runtime value of a tuneable variable.
       </p><p>
        Example: ctdb getvar MaxRedirectCount
@@ -106,11 +141,11 @@ Number of addresses:4
        Example output:
       </p><pre class="screen">
 MaxRedirectCount    = 3
-      </pre></div><div class="refsect2" lang="en"><a name="id2528485"></a><h3>setvar &lt;name&gt; &lt;value&gt;</h3><p>
+      </pre></div><div class="refsect2" lang="en"><a name="id2528533"></a><h3>setvar &lt;name&gt; &lt;value&gt;</h3><p>
         Set the runtime value of a tuneable variable.
       </p><p>
        Example: ctdb setvar MaxRedirectCount 5
-      </p></div><div class="refsect2" lang="en"><a name="id2528500"></a><h3>listvars</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2528547"></a><h3>listvars</h3><p>
         List all tuneable variables.
       </p><p>
        Example: ctdb listvars
@@ -132,7 +167,7 @@ MonitorInterval     = 15
 EventScriptTimeout  = 20
 RecoveryGracePeriod = 60
 RecoveryBanPeriod   = 300
-      </pre></div><div class="refsect2" lang="en"><a name="id2528528"></a><h3>statistics</h3><p>
+      </pre></div><div class="refsect2" lang="en"><a name="id2528576"></a><h3>statistics</h3><p>
         Collect statistics from the CTDB daemon about how many calls it has served.
       </p><p>
        Example: ctdb statistics
@@ -174,43 +209,43 @@ CTDB version 1
  max_hop_count                      0
  max_call_latency                   4.948321 sec
  max_lockwait_latency               0.000000 sec
-      </pre></div><div class="refsect2" lang="en"><a name="id2528571"></a><h3>statisticsreset</h3><p>
+      </pre></div><div class="refsect2" lang="en"><a name="id2528619"></a><h3>statisticsreset</h3><p>
         This command is used to clear all statistics counters in a node.
       </p><p>
        Example: ctdb statisticsreset
-      </p></div><div class="refsect2" lang="en"><a name="id2528586"></a><h3>getdebug</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2528633"></a><h3>getdebug</h3><p>
         Get the current debug level for the node. the debug level controls what information is written to the log file.
-      </p></div><div class="refsect2" lang="en"><a name="id2528597"></a><h3>setdebug &lt;debuglevel&gt;</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2528644"></a><h3>setdebug &lt;debuglevel&gt;</h3><p>
         Set the debug level of a node. This is a number between 0 and 9 and controls what information will be written to the logfile.
-      </p></div><div class="refsect2" lang="en"><a name="id2528608"></a><h3>getpid</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2528656"></a><h3>getpid</h3><p>
         This command will return the process id of the ctdb daemon.
-      </p></div><div class="refsect2" lang="en"><a name="id2528619"></a><h3>disable</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2528666"></a><h3>disable</h3><p>
         This command is used to administratively disable a node in the cluster.
         A disabled node will still participate in the cluster and host
         clustered TDB records but its public ip address has been taken over by
         a different node and it no longer hosts any services.
-      </p></div><div class="refsect2" lang="en"><a name="id2528632"></a><h3>enable</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2528680"></a><h3>enable</h3><p>
         Re-enable a node that has been administratively disabled.
-      </p></div><div class="refsect2" lang="en"><a name="id2528643"></a><h3>ban &lt;bantime|0&gt;</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2528690"></a><h3>ban &lt;bantime|0&gt;</h3><p>
         Administratively ban a node for bantime seconds. A bantime of 0 means that the node should be permanently banned. 
       </p><p>
         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.
       </p><p>
         Nodes are automatically banned if they are the cause of too many
         cluster recoveries.
-      </p></div><div class="refsect2" lang="en"><a name="id2528666"></a><h3>unban</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2528714"></a><h3>unban</h3><p>
         This command is used to unban a node that has either been 
         administratively banned using the ban command or has been automatically
         banned by the recovery daemon.
-      </p></div><div class="refsect2" lang="en"><a name="id2528678"></a><h3>shutdown</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2528726"></a><h3>shutdown</h3><p>
         This command will shutdown a specific CTDB daemon.
-      </p></div><div class="refsect2" lang="en"><a name="id2528688"></a><h3>recover</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2528736"></a><h3>recover</h3><p>
         This command will trigger the recovery daemon to do a cluster
         recovery.
-      </p></div><div class="refsect2" lang="en"><a name="id2528699"></a><h3>killtcp &lt;srcip:port&gt; &lt;dstip:port&gt;</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2528746"></a><h3>killtcp &lt;srcip:port&gt; &lt;dstip:port&gt;</h3><p>
         This command will kill the specified TCP connection by issuing a
         TCP RST to the srcip:port endpoint.
-      </p></div><div class="refsect2" lang="en"><a name="id2528710"></a><h3>tickle &lt;srcip:port&gt; &lt;dstip:port&gt;</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2528758"></a><h3>tickle &lt;srcip:port&gt; &lt;dstip:port&gt;</h3><p>
         This command will will send a TCP tickle to the source host for the
         specified TCP connection.
        A TCP tickle is a TCP ACK packet with an invalid sequence and 
@@ -222,7 +257,7 @@ CTDB version 1
         TCP connection has been disrupted and that the client will need
         to reestablish. This greatly speeds up the time it takes for a client
         to detect and reestablish after an IP failover in the ctdb cluster.
-      </p></div><div class="refsect2" lang="en"><a name="id2528735"></a><h3>repack [max_freelist]</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2528783"></a><h3>repack [max_freelist]</h3><p>
        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.
        This command is used to defragment a TDB database and pruning the freelist.
       </p><p>
@@ -237,7 +272,7 @@ CTDB version 1
        Example: ctdb repack 1000
       </p><p>
         By default, this operation is issued from the 00.ctdb event script every 5 minutes.
-      </p></div><div class="refsect2" lang="en"><a name="id2528781"></a><h3>vacuum [max_records]</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2528829"></a><h3>vacuum [max_records]</h3><p>
        Over time CTDB databases will fill up with empty deleted records which will lead to a progressive slow down of CTDB database access.
        This command is used to prune all databases and delete all empty records from the cluster.
       </p><p>
@@ -253,12 +288,12 @@ CTDB version 1
        Example: ctdb vacuum
       </p><p>
         By default, this operation is issued from the 00.ctdb event script every 5 minutes.
-      </p></div></div><div class="refsect1" lang="en"><a name="id2528818"></a><h2>Debugging Commands</h2><p>
+      </p></div></div><div class="refsect1" lang="en"><a name="id2528866"></a><h2>Debugging Commands</h2><p>
       These commands are primarily used for CTDB development and testing and
       should not be used for normal administration.
-    </p><div class="refsect2" lang="en"><a name="id2528829"></a><h3>process-exists &lt;pid&gt;</h3><p>
+    </p><div class="refsect2" lang="en"><a name="id2528876"></a><h3>process-exists &lt;pid&gt;</h3><p>
         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.
-      </p></div><div class="refsect2" lang="en"><a name="id2528841"></a><h3>getdbmap</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2528888"></a><h3>getdbmap</h3><p>
         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.
        </p><p>
        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.
@@ -277,21 +312,21 @@ dbid:0x2672a57f name:idmap2.tdb path:/var/ctdb/persistent/idmap2.tdb.0 PERSISTEN
 dbid:0xb775fff6 name:secrets.tdb path:/var/ctdb/persistent/secrets.tdb.0 PERSISTENT
 dbid:0xe98e08b6 name:group_mapping.tdb path:/var/ctdb/persistent/group_mapping.tdb.0 PERSISTENT
 dbid:0x7bbbd26c name:passdb.tdb path:/var/ctdb/persistent/passdb.tdb.0 PERSISTENT
-      </pre></div><div class="refsect2" lang="en"><a name="id2528887"></a><h3>catdb &lt;dbname&gt;</h3><p>
+      </pre></div><div class="refsect2" lang="en"><a name="id2528935"></a><h3>catdb &lt;dbname&gt;</h3><p>
         This command will dump a clustered TDB database to the screen. This is a debugging command.
-      </p></div><div class="refsect2" lang="en"><a name="id2528898"></a><h3>getmonmode</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2528945"></a><h3>getmonmode</h3><p>
         This command returns the monutoring mode of a node. The monitoring mode is either ACTIVE or DISABLED. Normally a node will continously monitor that all other nodes that are expected are in fact connected and that they respond to commands.
       </p><p>
         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.
       </p><p>
         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.
-      </p></div><div class="refsect2" lang="en"><a name="id2528929"></a><h3>setmonmode &lt;0|1&gt;</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2528976"></a><h3>setmonmode &lt;0|1&gt;</h3><p>
         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.
-      </p></div><div class="refsect2" lang="en"><a name="id2528944"></a><h3>attach &lt;dbname&gt;</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2528992"></a><h3>attach &lt;dbname&gt;</h3><p>
         This is a debugging command. This command will make the CTDB daemon create a new CTDB database and attach to it.
-      </p></div><div class="refsect2" lang="en"><a name="id2528956"></a><h3>dumpmemory</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2529003"></a><h3>dumpmemory</h3><p>
         This is a debugging command. This command will make the ctdb daemon to write a fill memory allocation map to the log file.
-      </p></div><div class="refsect2" lang="en"><a name="id2528967"></a><h3>freeze</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2529014"></a><h3>freeze</h3><p>
         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.
@@ -299,12 +334,12 @@ dbid:0x7bbbd26c name:passdb.tdb path:/var/ctdb/persistent/passdb.tdb.0 PERSISTEN
         This is primarily used by the recovery daemon to stop all samba
         daemons from accessing any databases while the database is recovered
         and rebuilt.
-      </p></div><div class="refsect2" lang="en"><a name="id2528985"></a><h3>thaw</h3><p>
+      </p></div><div class="refsect2" lang="en"><a name="id2529033"></a><h3>thaw</h3><p>
         Thaw a previously frozen node.
-      </p></div></div><div class="refsect1" lang="en"><a name="id2528996"></a><h2>SEE ALSO</h2><p>
+      </p></div></div><div class="refsect1" lang="en"><a name="id2529043"></a><h2>SEE ALSO</h2><p>
       ctdbd(1), onnode(1)
       <a href="http://ctdb.samba.org/" target="_top">http://ctdb.samba.org/</a>
-    </p></div><div class="refsect1" lang="en"><a name="id2529009"></a><h2>COPYRIGHT/LICENSE</h2><div class="literallayout"><p><br>
+    </p></div><div class="refsect1" lang="en"><a name="id2529056"></a><h2>COPYRIGHT/LICENSE</h2><div class="literallayout"><p><br>
 Copyright (C) Andrew Tridgell 2007<br>
 Copyright (C) Ronnie sahlberg 2007<br>
 <br>
index daa1d7383988d1a91dcc23ba227036ef9495a739..4979f077b62b77410c2ccb53ea925dc918f94615 100644 (file)
           The generation id is a number that indicates the current generation 
           of a cluster instance. Each time a cluster goes through a 
           reconfiguration or a recovery its generation id will be changed.
+         </para>
+         <para>
+         This number does not have any particular meaning other than to keep
+         track of when a cluster has gone through a recovery. It is a random
+         number that represents the current instance of a ctdb cluster
+         and its databases.
+         CTDBD uses this number internally to be able to tell when commands 
+         to operate on the cluster and the databases was issued in a different
+         generation of the cluster, to ensure that commands that operate
+         on the databases will not survive across a cluster database recovery.
+         After a recovery, all old outstanding commands will automatically
+         become invalid. 
+        </para>
+        <para>
+         Sometimes this number will be shown as "INVALID". This only means that
+         the ctdbd daemon has started but it has not yet merged with the cluster through a recovery.
+         All nodes start with generation "INVALID" and are not assigned a real
+         generation id until they have successfully been merged with a cluster
+         through a recovery.
         </para>
       </refsect3>
 
         <para>
           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.
         </para>
+       <para>
+       Once the recovery master detects an inconsistency, for example a node 
+       becomes disconnected/connected, the recovery daemon will trigger a 
+       cluster recovery process, where all databases are remerged across the
+       cluster. When this process starts, the recovery master will first
+       "freeze" all databases to prevent applications such as samba from 
+       accessing the databases and it will also mark the recovery mode as
+       RECOVERY.
+       </para>
+       <para>
+       When CTDBD starts up, it will start in RECOVERY mode.
+       Once the node has been merged into a cluster and all databases
+       have been recovered, the node mode will change into NORMAL mode
+       and the databases will be "thawed", allowing samba to access the
+       databases again.
+       </para>
       </refsect3>
 
       <refsect3><title>Recovery master</title>
         <para>
           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.
         </para>
+        <para>
+       Only one node at a time can be the designated recovery master. Which
+       node is designated the recovery master is decided by an election
+       process in the recovery daemons running on each node.
+        </para>
       </refsect3>
 
       <para>