persistent: if a node failed to update_record, trigger a recovery
[sahlberg/ctdb.git] / doc / onnode.1
index 9923867989abdf213424e90c3348c89e655e63cc..055a82e089ce73f45cb3d95ba3e6d6d3bad7d519 100644 (file)
+'\" t
 .\"     Title: onnode
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
-.\"      Date: 07/10/2008
-.\"    Manual: [FIXME: manual]
-.\"    Source: [FIXME: source]
+.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
+.\"      Date: 02/05/2010
+.\"    Manual:  
+.\"    Source:  
 .\"  Language: English
 .\"
-.TH "ONNODE" "1" "07/10/2008" "[FIXME: source]" "[FIXME: manual]"
-.\" -----------------------------------------------------------------
-.\" * (re)Define some macros
-.\" -----------------------------------------------------------------
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" toupper - uppercase a string (locale-aware)
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.de toupper
-.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
-\\$*
-.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
-..
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" SH-xref - format a cross-reference to an SH section
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.de SH-xref
-.ie n \{\
-.\}
-.toupper \\$*
-.el \{\
-\\$*
-.\}
-..
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" SH - level-one heading that works better for non-TTY output
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.de1 SH
-.\" put an extra blank line of space above the head in non-TTY output
-.if t \{\
-.sp 1
-.\}
-.sp \\n[PD]u
-.nr an-level 1
-.set-an-margin
-.nr an-prevailing-indent \\n[IN]
-.fi
-.in \\n[an-margin]u
-.ti 0
-.HTML-TAG ".NH \\n[an-level]"
-.it 1 an-trap
-.nr an-no-space-flag 1
-.nr an-break-flag 1
-\." make the size of the head bigger
-.ps +3
-.ft B
-.ne (2v + 1u)
-.ie n \{\
-.\" if n (TTY output), use uppercase
-.toupper \\$*
-.\}
-.el \{\
-.nr an-break-flag 0
-.\" if not n (not TTY), use normal case (not uppercase)
-\\$1
-.in \\n[an-margin]u
-.ti 0
-.\" if not n (not TTY), put a border/line under subheading
-.sp -.6
-\l'\n(.lu'
-.\}
-..
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" SS - level-two heading that works better for non-TTY output
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.de1 SS
-.sp \\n[PD]u
-.nr an-level 1
-.set-an-margin
-.nr an-prevailing-indent \\n[IN]
-.fi
-.in \\n[IN]u
-.ti \\n[SN]u
-.it 1 an-trap
-.nr an-no-space-flag 1
-.nr an-break-flag 1
-.ps \\n[PS-SS]u
-\." make the size of the head bigger
-.ps +2
-.ft B
-.ne (2v + 1u)
-.if \\n[.$] \&\\$*
-..
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" BB/BE - put background/screen (filled box) around block of text
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.de BB
-.if t \{\
-.sp -.5
-.br
-.in +2n
-.ll -2n
-.gcolor red
-.di BX
-.\}
-..
-.de EB
-.if t \{\
-.if "\\$2"adjust-for-leading-newline" \{\
-.sp -1
-.\}
-.br
-.di
-.in
-.ll
-.gcolor
-.nr BW \\n(.lu-\\n(.i
-.nr BH \\n(dn+.5v
-.ne \\n(BHu+.5v
-.ie "\\$2"adjust-for-leading-newline" \{\
-\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
-.\}
-.el \{\
-\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
-.\}
-.in 0
-.sp -.5v
-.nf
-.BX
-.in
-.sp .5v
-.fi
-.\}
-..
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" BM/EM - put colored marker in margin next to block of text
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.de BM
-.if t \{\
-.br
-.ll -2n
-.gcolor red
-.di BX
-.\}
-..
-.de EM
-.if t \{\
-.br
-.di
-.ll
-.gcolor
-.nr BH \\n(dn
-.ne \\n(BHu
-\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
-.in 0
-.nf
-.BX
-.in
-.fi
-.\}
-..
+.TH "ONNODE" "1" "02/05/2010" "" ""
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
 .\" -----------------------------------------------------------------
 .\" * MAIN CONTENT STARTS HERE *
 .\" -----------------------------------------------------------------
-.SH "Name"
+.SH "NAME"
 onnode \- run commands on ctdb nodes
-.SH "Synopsis"
-.fam C
+.SH "SYNOPSIS"
 .HP \w'\fBonnode\ [OPTION]\ \&.\&.\&.\ NODES\ COMMAND\ \&.\&.\&.\fR\ 'u
 \fBonnode [OPTION] \&.\&.\&. NODES COMMAND \&.\&.\&.\fR
-.fam
 .SH "DESCRIPTION"
 .PP
 onnode is a utility to run commands on a specific node of a CTDB cluster, or on all nodes\&.
 .PP
-The NODES option specifies which node to run a command on\&. You can specify a numeric node number (from 0 to N\-1) or the special node \'all\'\&. You can also specify lists of nodes, separated by commas, and ranges of numeric node numbers, separated by dashes\&. If nodes are specified multiple times then the command will be executed multiple times on those nodes\&. The order of nodes is significant\&.
+The NODES option specifies which node to run a command on\&. You can specify a numeric node number (from 0 to N\-1) or a descriptive node specification (see DESCRIPTIVE NODE SPECIFICATIONS below)\&. You can also specify lists of nodes, separated by commas, and ranges of numeric node numbers, separated by dashes\&. If nodes are specified multiple times then the command will be executed multiple times on those nodes\&. The order of nodes is significant\&.
 .PP
 The COMMAND can be any shell command\&. The onnode utility uses ssh or rsh to connect to the remote nodes and run the command\&.
+.SH "DESCRIPTIVE NODE SPECIFICATIONS"
+.PP
+The following descriptive node specification can be used in place of numeric node numbers:
+.PP
+all
+.RS 4
+All nodes\&.
+.RE
+.PP
+any
+.RS 4
+A node where ctdbd is running\&. This semi\-random but there is a bias towards choosing a low numbered node\&.
+.RE
+.PP
+ok | healthy
+.RS 4
+All nodes that are not disconnected, banned, disabled or unhealthy\&.
+.RE
+.PP
+con | connected
+.RS 4
+All nodes that are not disconnected\&.
+.RE
+.PP
+lvs | lvsmaster
+.RS 4
+The current LVS master\&.
+.RE
+.PP
+natgw | natgwlist
+.RS 4
+The current NAT gateway\&.
+.RE
+.PP
+rm | recmaster
+.RS 4
+The current recovery master\&.
+.RE
 .SH "OPTIONS"
 .PP
 \-c
 .RS 4
-Execute COMMAND in the current working directory on each node\&.
+Execute COMMAND in the current working directory on the specified nodes\&.
+.RE
+.PP
+\-o <prefix>
+.RS 4
+Causes standard output from each node to be saved into a file with name <prefix>\&.<ip>\&.
 .RE
 .PP
 \-p
 .RS 4
-Run commands in parallel on the specified nodes\&. In this mode
+Run COMMAND in parallel on the specified nodes\&. The default is to run COMMAND sequentially on each node\&.
 .RE
 .PP
 \-q
@@ -197,6 +90,19 @@ Run commands in parallel on the specified nodes\&. In this mode
 Do not print node addresses\&. Normally, onnode prints informational node addresses if more than one node is specified\&. This overrides \-v\&.
 .RE
 .PP
+\-n
+.RS 4
+Allow nodes to be specified by name rather than node numbers\&. These nodes don\'t need to be listed in the nodes file\&. You can avoid the nodes file entirely by combining this with
+\-f /dev/null\&.
+.RE
+.PP
+\-f <file>
+.RS 4
+Specify an alternative nodes file to use instead of the default\&. This option overrides the CTDB_NODES_FILE environment variable\&. See the discussion of
+/etc/ctdb/nodes
+in the FILES section for more details\&.
+.RE
+.PP
 \-v
 .RS 4
 Print a node addresses even if only one node is specified\&. Normally, onnode prints informational node addresses when more than one node is specified\&.
@@ -213,24 +119,10 @@ The following command would show the process ID of ctdb on all nodes
 .if n \{\
 .RS 4
 .\}
-.fam C
-.ps -1
 .nf
-.if t \{\
-.sp -1
-.\}
-.BB lightgray adjust-for-leading-newline
-.sp -1
-
       onnode all pidof ctdbd
     
-.EB lightgray adjust-for-leading-newline
-.if t \{\
-.sp 1
-.\}
 .fi
-.fam
-.ps +1
 .if n \{\
 .RE
 .\}
@@ -240,24 +132,10 @@ The following command would show the last 5 lines of log on each node, preceded
 .if n \{\
 .RS 4
 .\}
-.fam C
-.ps -1
 .nf
-.if t \{\
-.sp -1
-.\}
-.BB lightgray adjust-for-leading-newline
-.sp -1
-
       onnode all "hostname; tail \-5 /var/log/log\&.ctdb"
     
-.EB lightgray adjust-for-leading-newline
-.if t \{\
-.sp 1
-.\}
 .fi
-.fam
-.ps +1
 .if n \{\
 .RE
 .\}
@@ -267,24 +145,10 @@ The following command would restart the ctdb service on all nodes\&.
 .if n \{\
 .RS 4
 .\}
-.fam C
-.ps -1
 .nf
-.if t \{\
-.sp -1
-.\}
-.BB lightgray adjust-for-leading-newline
-.sp -1
-
       onnode all service ctdb restart
     
-.EB lightgray adjust-for-leading-newline
-.if t \{\
-.sp 1
-.\}
 .fi
-.fam
-.ps +1
 .if n \{\
 .RE
 .\}
@@ -294,32 +158,35 @@ The following command would run \&./foo in the current working directory, in par
 .if n \{\
 .RS 4
 .\}
-.fam C
-.ps -1
 .nf
-.if t \{\
-.sp -1
-.\}
-.BB lightgray adjust-for-leading-newline
-.sp -1
-
       onnode \-c \-p 0,2\-4 \&./foo
     
-.EB lightgray adjust-for-leading-newline
-.if t \{\
-.sp 1
-.\}
 .fi
-.fam
-.ps +1
 .if n \{\
 .RE
 .\}
+.SH "ENVIRONMENT"
+.PP
+\fBCTDB_NODES_FILE\fR
+.RS 4
+Name of alternative nodes file to use instead of the default\&. See the discussion of
+/etc/ctdb/nodes
+in the FILES section for more details\&.
+.RE
 .SH "FILES"
 .PP
 /etc/ctdb/nodes
 .RS 4
-Contains a list of each node\'s IP address or hostname\&.
+Default file containing a list of each node\'s IP address or hostname\&.
+.sp
+Actually, the default is
+$\fBCTDB_BASE\fR/nodes, where
+\fB$CTDB_BASE\fR
+defaults to
+/etc/ctdb\&. If a relative path is given (via the \-f option or
+\fB$CTDB_BASE\fR) and no corresponding file exists relative to the current directory then the file is also searched for in the
+$\fBCTDB_BASE\fR
+directory\&.
 .RE
 .PP
 /etc/ctdb/onnode\&.conf
@@ -335,15 +202,7 @@ ctdbd(1), ctdb(1),
 .if n \{\
 .RS 4
 .\}
-.fam C
-.ps -1
 .nf
-.if t \{\
-.sp -1
-.\}
-.BB lightgray adjust-for-leading-newline
-.sp -1
-
 Copyright (C) Andrew Tridgell 2007
 Copyright (C) Ronnie sahlberg 2007
 Copyright (C) Martin Schwenke 2008
@@ -360,13 +219,7 @@ 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 http://www\&.gnu\&.org/licenses/\&.
-.EB lightgray adjust-for-leading-newline
-.if t \{\
-.sp 1
-.\}
 .fi
-.fam
-.ps +1
 .if n \{\
 .RE
 .\}