From: Martin Schwenke Date: Wed, 13 Nov 2013 05:19:00 +0000 (+1100) Subject: doc: Update ctdb.1 - primarily to add pdelete/pfetch/pstore/ptrans X-Git-Tag: ctdb-2.5.1~24 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=4a0ec35758098269012b108c37783f582397e197;p=martins%2Fctdb.git doc: Update ctdb.1 - primarily to add pdelete/pfetch/pstore/ptrans Also: * More above to make the XML valid. * Describe DB argument in introduction and use it for database commands. * Remove unnecessary format="linespecific" from tags, since it will not be allowed in DocBook 5.0. * Sort the items in "INTERNAL COMMANDS". * Update/simplify some command descriptions. Signed-off-by: Martin Schwenke --- diff --git a/doc/ctdb.1.xml b/doc/ctdb.1.xml index 27e52cd2..ec8421fd 100644 --- a/doc/ctdb.1.xml +++ b/doc/ctdb.1.xml @@ -4,6 +4,42 @@ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> + + + + This documentation was written by + Ronnie Sahlberg, + Amitay Isaacs, + Martin Schwenke + + + + + 2007 + Andrew Tridgell + Ronnie Sahlberg + + + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + + This program is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the GNU General Public License for more details. + + + You should have received a copy of the GNU General Public + License along with this program; if not, see + . + + + + ctdb 1 @@ -56,6 +92,13 @@ + + + Commands that reference a database have a + DB argument. This is either a database + name, such as locking.tdb or a database ID + such as "0x42fe72c5". + @@ -141,7 +184,7 @@ - Administrative Commands + ADMINISTRATIVE COMMANDS These are commands used to monitor and administer a CTDB cluster. @@ -266,7 +309,7 @@ Example - + # ctdb status Number of nodes:4 pnn:0 192.168.2.200 OK (THIS NODE) @@ -332,7 +375,7 @@ Recovery master:0 Example - + # ctdb nodestatus pnn:0 10.0.0.30 OK (THIS NODE) @@ -364,7 +407,7 @@ pnn:1 10.0.0.31 OK Example - + # ctdb uptime Current time of node : Thu Oct 29 10:38:54 2009 Ctdbd start time : (000 16:54:28) Wed Oct 28 17:44:26 2009 @@ -382,7 +425,7 @@ Duration of last recovery/failover: 2.248552 seconds Example - + # ctdb listnodes 192.168.2.200 192.168.2.201 @@ -404,7 +447,7 @@ Duration of last recovery/failover: 2.248552 seconds Example - + # ctdb natgwlist 0 192.168.2.200 Number of nodes:4 @@ -424,7 +467,7 @@ pnn:3 192.168.2.203 OK Example - + # ctdb ping -n all response from 0 time=0.000054 sec (3 clients) response from 1 time=0.000144 sec (2 clients) @@ -442,7 +485,7 @@ response from 3 time=0.000114 sec (2 clients) Example - + # ctdb ifaces Interfaces on node 0 name:eth5 link:up references:2 @@ -467,7 +510,7 @@ name:eth2 link:up references:1 Example - + # ctdb ip Public IPs on node 0 172.31.91.82 node[1] active[] available[eth2,eth3] configured[eth2,eth3] @@ -500,7 +543,7 @@ Public IPs on node 0 Example - + # ctdb ipinfo 172.31.92.85 Public IP[172.31.92.85] info on node 0 IP:172.31.92.85 @@ -519,7 +562,7 @@ Interface[2]: Name:eth5 Link:up References:2 (active) Example - + # ctdb scriptstatus 7 scripts were executed last monitoring cycle 00.ctdb Status:OK Duration:0.056 Tue Mar 24 18:56:57 2009 @@ -564,7 +607,7 @@ OUTPUT:ERROR: Samba tcp port 445 is not responding Example - + # ctdb listvars MaxRedirectCount = 3 SeqnumInterval = 1000 @@ -621,7 +664,7 @@ RecoverPDBBySeqNum = 0 Example - + # ctdb getvar MaxRedirectCount MaxRedirectCount = 3 @@ -674,7 +717,7 @@ MaxRedirectCount = 3 Example output: - + 2:10.0.0.13 3:10.0.0.14 @@ -695,7 +738,7 @@ MaxRedirectCount = 3 Example output: - + RECMASTER: YES LMASTER: YES LVS: NO @@ -711,7 +754,7 @@ NATGW: YES Example - + # ctdb statistics CTDB version 1 num_clients 3 @@ -763,13 +806,13 @@ max_lockwait_latency 0.000000 sec - dbstatistics <parameter>DBNAME</parameter>|<parameter>HASH</parameter> + dbstatistics <parameter>DB</parameter> - Display statistics about the specified database. + Display statistics about the database DB. Example - + # ctdb dbstatistics locking.tdb DB Statistics: locking.tdb ro_delegations 0 @@ -797,7 +840,7 @@ DB Statistics: locking.tdb Example output: - + Reclock file:/gpfs/.ctdb/shared @@ -1062,7 +1105,7 @@ DB Statistics: locking.tdb Example - + # ctdb getdbmap Number of databases:10 dbid:0x435d3410 name:notify.tdb path:/var/ctdb/notify.tdb.0 @@ -1088,20 +1131,31 @@ dbid:0xb775fff6 name:secrets.tdb path:/var/ctdb/persistent/secrets.tdb.0 PERSIST - backupdb <parameter>DBNAME</parameter> <parameter>FILE</parameter> + + backupdb + <parameter>DB</parameter> + <parameter>FILE</parameter> + - 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. + Copy the contents of database DB to FILE. FILE can later be + read back using restoredb. This is mainly + useful for backing up persistent databases such as + secrets.tdb and similar. - restoredb <parameter>FILE</parameter> [<parameter>DBNAME</parameter>] + + restoredb + <parameter>FILE</parameter> + <optional><parameter>DB</parameter></optional> + - 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. + 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. @@ -1144,7 +1198,7 @@ dbid:0xb775fff6 name:secrets.tdb path:/var/ctdb/persistent/secrets.tdb.0 PERSIST - setdbreadonly <parameter>DBNAME</parameter>|<parameter>HASH</parameter> + setdbreadonly <parameter>DB</parameter> This command will enable the read-only record support for a database. This is an experimental feature to improve @@ -1155,7 +1209,7 @@ dbid:0xb775fff6 name:secrets.tdb path:/var/ctdb/persistent/secrets.tdb.0 PERSIST - setdbsticky <parameter>DBNAME</parameter>|<parameter>HASH</parameter> + setdbsticky <parameter>DB</parameter> This command will enable the sticky record support for the specified database. This is an experimental feature to @@ -1168,7 +1222,7 @@ dbid:0xb775fff6 name:secrets.tdb path:/var/ctdb/persistent/secrets.tdb.0 PERSIST - Internal commands + INTERNAL COMMANDS Internal commands are used by CTDB's scripts and are not @@ -1177,50 +1231,34 @@ dbid:0xb775fff6 name:secrets.tdb path:/var/ctdb/persistent/secrets.tdb.0 PERSIST - runstate [setup|first_recovery|startup|running] - - Print the runstate of the specified node. Runstates are used - to serialise important state transitions in CTDB, particularly - during startup. - + gettickles <parameter>IPADDR</parameter> - If one or more optional runstate arguments are specified then - the node must be in one of these runstates for the command to - succeed. + Show TCP connections that are registered with CTDB to be + "tickled" if there is a failover. - - Example - -# ctdb runstate -RUNNING - - - setifacelink <parameter>IFACE</parameter> <parameter>STATUS</parameter> - - 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. - + gratiousarp <parameter>IPADDR</parameter> <parameter>INTERFACE</parameter> - Example: ctdb setifacelink eth0 up + Send out a gratious ARP for the specified interface through + the specified interface. This command is mainly used by the + ctdb eventscripts. killtcp - This command reads a list of TCP connections, one per line, - from standard input and terminates each connection. A connection - is specified as: + Read a list of TCP connections, one per line, from standard + input and terminate each connection. A connection is + specified as: SRC-IPADDR:SRC-PORT DST-IPADDR:DST-PORT - A connection is terminated by issuing a TCP RST to the + Each connection is terminated by issuing a TCP RST to the SRC-IPADDR:SRC-PORT endpoint. @@ -1230,44 +1268,83 @@ RUNNING - gratiousarp <parameter>IPADDR</parameter> <parameter>INTERFACE</parameter> + + pdelete <parameter>DB</parameter> <parameter>KEY</parameter> + - 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. + Delete KEY from DB. - tickle <parameter>SRC-IPADDR</parameter>:<parameter>SRC-PORT</parameter> <parameter>DST-IPADDR</parameter>:<parameter>DST-PORT</parameter> + + pfetch <parameter>DB</parameter> <parameter>KEY</parameter> + - 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 - acknowledge number and will when received by the source host result - in it sending an immediate correct ACK back to the other end. + Print the value associated with KEY in DB. + + + + + pstore + <parameter>DB</parameter> + <parameter>KEY</parameter> + <parameter>FILE</parameter> + - TCP tickles are useful to "tickle" clients after a IP failover has - occured since this will make the client immediately recognize the - 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. + Store KEY in DB with contents of FILE as the associated value. - gettickles <parameter>IPADDR</parameter> + + ptrans + <parameter>DB</parameter> + <optional><parameter>FILE</parameter></optional> + + + Read a list of key-value pairs, one per line from FILE, and + store them in DB using a single transaction. An empty value + is equivalent to deleting the given key. + - This command is used to show which TCP connections are registered with - CTDB to be "tickled" if there is a failover. + The key and value should be separated by spaces or tabs. Each + key/value should be a printable string enclosed in + double-quotes. - version + runstate [setup|first_recovery|startup|running] - Displays the CTDB version. + Print the runstate of the specified node. Runstates are used + to serialise important state transitions in CTDB, particularly + during startup. + + + If one or more optional runstate arguments are specified then + the node must be in one of these runstates for the command to + succeed. + + + Example + +# ctdb runstate +RUNNING + + + + + + setifacelink <parameter>IFACE</parameter> up|down + + Set the internal state of network interface IFACE. This is + typically used in the 10.interface script + in the "monitor" event. + + + Example: ctdb setifacelink eth0 up @@ -1278,10 +1355,35 @@ RUNNING + + tickle <parameter>SRC-IPADDR</parameter>:<parameter>SRC-PORT</parameter> <parameter>DST-IPADDR</parameter>:<parameter>DST-PORT</parameter> + + 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 acknowledge number and will when received by the + source host result in it sending an immediate correct ACK back + to the other end. + + + TCP tickles are useful to "tickle" clients after a IP failover has + occured since this will make the client immediately recognize the + 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. + + + + + version + + Display the CTDB version. + + + - Debugging Commands + DEBUGGING COMMANDS These commands are primarily used for CTDB development and testing and should not be used for normal administration. @@ -1351,13 +1453,13 @@ RUNNING - getdbstatus <parameter>DBNAME</parameter> + getdbstatus <parameter>DB</parameter> This command displays more details about a database. Example - + # ctdb getdbstatus test.tdb.0 dbid: 0x122224da name: test.tdb @@ -1376,31 +1478,31 @@ HEALTH: NO-HEALTHY-NODES - ERROR - Backup of corrupted TDB in '/var/ctdb/persist - catdb <parameter>DBNAME</parameter> + catdb <parameter>DB</parameter> - This command will dump a clustered TDB database to the screen. This is a debugging command. + Print a dump of the clustered TDB database DB. - cattdb <parameter>DBNAME</parameter> + cattdb <parameter>DB</parameter> - This command will dump the content of the local TDB database to the screen. This is a debugging command. + Print a dump of the contents of the local TDB database DB. - dumpdbbackup <parameter>BACKUP-FILE</parameter> + dumpdbbackup <parameter>FILE</parameter> - This command will dump the content of database backup to the screen - (similar to ctdb catdb). This is a debugging command. + Print a dump of the contents from database backup FILE, + similar to catdb. - wipedb <parameter>DBNAME</parameter> + wipedb <parameter>DB</parameter> - This command can be used to remove all content of a database. + Remove all contents of database DB. @@ -1532,7 +1634,7 @@ HEALTH: NO-HEALTHY-NODES - ERROR - Backup of corrupted TDB in '/var/ctdb/persist Example - + # ctdb check_srvids 1 2 3 14765 Server id 0:1 does not exist Server id 0:2 does not exist @@ -1611,11 +1713,10 @@ Server id 0:14765 exists - SEE ALSO @@ -1635,40 +1736,5 @@ Server id 0:14765 exists - - - - This documentation was written by - Ronnie Sahlberg, - Amitay Isaacs, - Martin Schwenke - - - - - 2007 - Andrew Tridgell - Ronnie Sahlberg - - - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - - This program is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied - warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the GNU General Public License for more details. - - - You should have received a copy of the GNU General Public - License along with this program; if not, see - . - - -