<listitem>
<para>
Produce output in machine readable form for easier parsing
- by scripts. Not all commands support this option.
+ by scripts. This uses a field delimiter of ':'. Not all
+ commands support this option.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry><term>-x <parameter>SEPARATOR</parameter></term>
+ <listitem>
+ <para>
+ Use SEPARATOR to delimit fields in machine readable output.
+ This implies -Y.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry><term>-X</term>
+ <listitem>
+ <para>
+ Produce output in machine readable form for easier parsing
+ by scripts. This uses a field delimiter of '|'. Not all
+ commands support this option.
+ </para>
+ <para>
+ This is equivalent to "-x|" and avoids some shell quoting
+ issues.
</para>
</listitem>
</varlistentry>
<varlistentry><term>-d --debug=<parameter>DEBUGLEVEL</parameter></term>
<listitem>
<para>
- Change the debug level for the command. Default is ERR (0).
+ Change the debug level for the command. Default is NOTICE (2).
</para>
</listitem>
</varlistentry>
Specify that FILENAME is the name of the Unix domain
socket to use when connecting to the local CTDB
daemon. The default is
- <filename>/tmp/ctdb.socket</filename>.
+ <filename>/usr/local/var/run/ctdb/ctdbd.socket</filename>.
</para>
</listitem>
</varlistentry>
If PNN-LIST is provided then status is given for
the indicated node(s).
</para>
-
- <para>
- By default, <command>ctdb nodestatus</command> gathers
- status from the local node. However, if invoked with "-n
- all" (or similar) then status is gathered from the given
- node(s). In particular <command>ctdb nodestatus
- all</command> and <command>ctdb nodestatus -n
- all</command> will produce different output. It is
- possible to provide 2 different nodespecs (with and
- without "-n") but the output is usually confusing!
- </para>
</listitem>
</itemizedlist>
<refsect3>
<title>Example</title>
<screen>
-# ctdb ping -n all
+# ctdb ping
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)
</screen>
</refsect3>
</refsect2>
name:eth3 link:up references:1
name:eth2 link:up references:1
-# ctdb ifaces -Y
-:Name:LinkStatus:References:
-:eth5:1:2
-:eth4:0:0
-:eth3:1:1
-:eth2:1:1
+# ctdb -X ifaces
+|Name|LinkStatus|References|
+|eth5|1|2|
+|eth4|0|0|
+|eth3|1|1|
+|eth2|1|1|
</screen>
</refsect3>
</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".
+ This command will display the list of public addresses that are provided by the cluster and which physical node is currently serving this ip. By default this command will ONLY show those public addresses that are known to the node itself. To see the full list of all public ips across the cluster you must use "ctdb ip all".
</para>
<refsect3>
<title>Example</title>
<screen>
-# ctdb ip
+# ctdb ip -v
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.92.84 node[1] active[] available[eth5] configured[eth4,eth5]
172.31.92.85 node[0] active[eth5] available[eth5] configured[eth4,eth5]
-# ctdb ip -Y
-: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:
+# ctdb -X ip -v
+|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>
</refsect3>
</refsect2>
MonitorInterval = 15
TickleUpdateInterval = 20
EventScriptTimeout = 30
-EventScriptTimeoutCount = 1
+MonitorTimeoutCount = 1
RecoveryGracePeriod = 120
RecoveryBanPeriod = 300
DatabaseHashSize = 100001
LogLatencyMs = 0
RecLockLatencyMs = 1000
RecoveryDropAllIPs = 120
-VerifyRecoveryLock = 1
VacuumInterval = 10
VacuumMaxRunTime = 30
RepackLimit = 10000
RECMASTER: YES
LMASTER: YES
LVS: NO
-NATGW: YES
</screen>
</refsect2>
<refsect2>
<title>statistics</title>
<para>
- Collect statistics from the CTDB daemon about how many calls it has served.
+ Collect statistics from the CTDB daemon about
+ how many calls it has served. Information about
+ various fields in statistics can be found in
+ <citerefentry><refentrytitle>ctdb-statistics</refentrytitle>
+ <manvolnum>7</manvolnum></citerefentry>.
</para>
<refsect3>
<title>Example</title>
<refsect2>
<title>dbstatistics <parameter>DB</parameter></title>
<para>
- Display statistics about the database DB.
+ Display statistics about the database DB. Information
+ about various fields in dbstatistics can be found in
+ <citerefentry><refentrytitle>ctdb-statistics</refentrytitle>
+ <manvolnum>7</manvolnum></citerefentry>.
</para>
<refsect3>
<title>Example</title>
<refsect2>
<title>getreclock</title>
<para>
- This command is used to show the filename of the reclock file that is used.
+ Show the name of the recovery lock file, if any.
</para>
<para>
Example output:
</para>
<screen>
- Reclock file:/gpfs/.ctdb/shared
+ Reclock file:/clusterfs/.ctdb/recovery.lock
</screen>
</refsect2>
<refsect2>
- <title>setreclock [filename]</title>
+ <title>
+ setreclock <optional><parameter>FILE</parameter></optional>
+ </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".
+ FILE specifies the name of the recovery lock file. If the
+ recovery lock file is changed at run-time then this will cause
+ a recovery, which in turn causes the recovery lock to be
+ retaken.
</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.
+ If no FILE is specified then a recovery lock file will no
+ longer be used.
</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.
+ This command only affects the run-time setting of a single
+ CTDB node. This setting <emphasis>must</emphasis> be changed
+ on all nodes simultaneously. For information about configuring
+ the recovery lock file please see the
+ <citetitle>CTDB_RECOVERY_LOCK</citetitle> entry in
+ <citerefentry><refentrytitle>ctdbd.conf</refentrytitle>
+ <manvolnum>5</manvolnum></citerefentry> and the
+ <citetitle>--reclock</citetitle> entry in
+ <citerefentry><refentrytitle>ctdbd</refentrytitle>
+ <manvolnum>1</manvolnum></citerefentry>. For information
+ about the recovery lock please see the <citetitle>RECOVERY
+ LOCK</citetitle> section in
+ <citerefentry><refentrytitle>ctdb</refentrytitle>
+ <manvolnum>7</manvolnum></citerefentry>.
</para>
</refsect2>
The list of debug levels from highest to lowest are :
</para>
<para>
- EMERG ALERT CRIT ERR WARNING NOTICE INFO DEBUG
+ ERR WARNING NOTICE INFO DEBUG
</para>
</refsect2>
Set the debug level of a node. This controls what information will be logged.
</para>
<para>
- The debuglevel is one of EMERG ALERT CRIT ERR WARNING NOTICE INFO DEBUG
+ The debuglevel is one of ERR WARNING NOTICE INFO DEBUG
</para>
</refsect2>
<refsect2>
<title>reloadnodes</title>
<para>
- This command is used when adding new nodes, or removing existing nodes from an existing cluster.
- </para>
- <para>
- Procedure to add a node:
- </para>
- <para>
- 1, To expand an existing cluster, first ensure with 'ctdb status' that
- all nodes are up and running and that they are all healthy.
- Do not try to expand a cluster unless it is completely healthy!
- </para>
- <para>
- 2, On all nodes, edit /etc/ctdb/nodes and add the new node as the last
- entry to the file. The new node MUST be added to the end of this file!
- </para>
- <para>
- 3, Verify that all the nodes have identical /etc/ctdb/nodes files after you edited them and added the new node!
+ This command is used when adding new nodes, or removing
+ existing nodes from an existing cluster.
</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 they now show the additional node.
- </para>
- <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 poweroff 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..
+ Procedure to add nodes:
</para>
+ <orderedlist>
+ <listitem>
+ <para>
+ To expand an existing cluster, first ensure with
+ <command>ctdb status</command> that all nodes are up and
+ running and that they are all healthy. Do not try to
+ expand a cluster unless it is completely healthy!
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ On all nodes, edit <filename>/usr/local/etc/ctdb/nodes</filename>
+ and <emphasis>add the new nodes at the end of this
+ file</emphasis>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Verify that all the nodes have identical
+ <filename>/usr/local/etc/ctdb/nodes</filename> files after adding
+ the new nodes.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Run <command>ctdb reloadnodes</command> to force all nodes
+ to reload the nodes file.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Use <command>ctdb status</command> on all nodes and verify
+ that they now show the additional nodes.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Install and configure the new node and bring it online.
+ </para>
+ </listitem>
+ </orderedlist>
<para>
+ Procedure to remove nodes:
</para>
+ <orderedlist>
+ <listitem>
+ <para>
+ To remove nodes from an existing cluster, first ensure
+ with <command>ctdb status</command> that all nodes, except
+ the node to be deleted, are up and running and that they
+ are all healthy. Do not try to remove nodes from a
+ cluster unless the cluster is completely healthy!
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Shutdown and power off the node to be removed.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ On all other nodes, edit the
+ <filename>/usr/local/etc/ctdb/nodes</filename> file and
+ <emphasis>comment out</emphasis> the nodes to be removed.
+ <emphasis>Do not delete the lines for the deleted
+ nodes</emphasis>, just comment them out by adding a '#' at
+ the beginning of the lines.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Run <command>ctdb reloadnodes</command> to force all nodes
+ to reload the nodes file.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Use <command>ctdb status</command> on all nodes and verify
+ that the deleted nodes are no longer listed.
+ </para>
+ </listitem>
+ </orderedlist>
</refsect2>
<screen>
# ctdb getdbmap
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: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
-dbid:0x2672a57f name:idmap2.tdb path:/var/ctdb/persistent/idmap2.tdb.0 PERSISTENT
-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
+dbid:0x435d3410 name:notify.tdb path:/usr/local/var/lib/ctdb/notify.tdb.0
+dbid:0x42fe72c5 name:locking.tdb path:/usr/local/var/lib/ctdb/locking.tdb.0
+dbid:0x1421fb78 name:brlock.tdb path:/usr/local/var/lib/ctdb/brlock.tdb.0
+dbid:0x17055d90 name:connections.tdb path:/usr/local/var/lib/ctdb/connections.tdb.0
+dbid:0xc0bdde6a name:sessionid.tdb path:/usr/local/var/lib/ctdb/sessionid.tdb.0
+dbid:0x122224da name:test.tdb path:/usr/local/var/lib/ctdb/test.tdb.0
+dbid:0x2672a57f name:idmap2.tdb path:/usr/local/var/lib/ctdb/persistent/idmap2.tdb.0 PERSISTENT
+dbid:0xb775fff6 name:secrets.tdb path:/usr/local/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT
+dbid:0xe98e08b6 name:group_mapping.tdb path:/usr/local/var/lib/ctdb/persistent/group_mapping.tdb.0 PERSISTENT
+dbid:0x7bbbd26c name:passdb.tdb path:/usr/local/var/lib/ctdb/persistent/passdb.tdb.0 PERSISTENT
# ctdb getdbmap # example for unhealthy database
Number of databases:1
-dbid:0xb775fff6 name:secrets.tdb path:/var/ctdb/persistent/secrets.tdb.0 PERSISTENT UNHEALTHY
+dbid:0xb775fff6 name:secrets.tdb path:/usr/local/var/lib/ctdb/persistent/secrets.tdb.0 PERSISTENT UNHEALTHY
-# ctdb -Y getdbmap
-:ID:Name:Path:Persistent:Unhealthy:
-:0x7bbbd26c:passdb.tdb:/var/ctdb/persistent/passdb.tdb.0:1:0:
+# ctdb -X getdbmap
+|ID|Name|Path|Persistent|Unhealthy|
+|0x7bbbd26c|passdb.tdb|/usr/local/var/lib/ctdb/persistent/passdb.tdb.0|1|0|
</screen>
</refsect3>
</refsect2>
</para>
</refsect2>
- <refsect2>
- <title>getlog [<parameter>LEVEL</parameter>] [recoverd]</title>
- <para>
- In addition to the normal logging to a log file, CTDB 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 continuous 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. The level is not
- specified it defaults to NOTICE.
- </para>
- <para>
- By default, logs are extracted from the main CTDB daemon. If
- the recoverd option is given then logs are extracted from the
- recovery daemon.
- </para>
- </refsect2>
-
- <refsect2>
- <title>clearlog [recoverd]</title>
- <para>
- This command clears the in-memory logging ringbuffer.
- </para>
- <para>
- By default, logs are cleared in the main CTDB daemon. If the
- recoverd option is given then logs are cleared in the recovery
- daemon.
- </para>
- </refsect2>
-
<refsect2>
<title>setdbreadonly <parameter>DB</parameter></title>
<para>
</para>
</refsect2>
- <refsect2>
- <title>setnatgwstate on|off</title>
- <para>
- Enable or disable the NAT gateway master capability on a node.
- </para>
- </refsect2>
-
<refsect2>
<title>tickle <parameter>SRC-IPADDR</parameter>:<parameter>SRC-PORT</parameter> <parameter>DST-IPADDR</parameter>:<parameter>DST-PORT</parameter></title>
<para>
# ctdb getdbstatus test.tdb.0
dbid: 0x122224da
name: test.tdb
-path: /var/ctdb/test.tdb.0
+path: /usr/local/var/lib/ctdb/test.tdb.0
PERSISTENT: no
HEALTH: OK
# ctdb getdbstatus registry.tdb # with a corrupted TDB
dbid: 0xf2a58948
name: registry.tdb
-path: /var/ctdb/persistent/registry.tdb.0
+path: /usr/local/var/lib/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'
+HEALTH: NO-HEALTHY-NODES - ERROR - Backup of corrupted TDB in '/usr/local/var/lib/ctdb/persistent/registry.tdb.0.corrupted.20091208091949.0Z'
</screen>
</refsect3>
</refsect2>
the cluster. This command should only be used when none of the
specified database(s) are in use.
</para>
+ <para>
+ All nodes should be active and tunable AllowClientDBAccess should
+ be disabled on all nodes before detaching databases.
+ </para>
</refsect2>
<refsect2>
<citerefentry><refentrytitle>ctdb</refentrytitle>
<manvolnum>7</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>ctdb-statistics</refentrytitle>
+ <manvolnum>7</manvolnum></citerefentry>,
+
<citerefentry><refentrytitle>ctdb-tunables</refentrytitle>
<manvolnum>7</manvolnum></citerefentry>,