2009-09-15 13:33:35 +04:00
'\" t
2007-06-12 07:44:01 +04:00
. \" Title: onnode
2009-09-15 13:33:35 +04:00
. \" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
2009-12-07 15:02:59 +03:00
. \" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
. \" Date: 12/08/2009
. \" Manual:
. \" Source:
2009-09-15 13:33:35 +04:00
. \" Language: English
2007-06-12 07:44:01 +04:00
. \"
2009-12-07 15:02:59 +03:00
.TH "ONNODE" "1" "12/08/2009" "" ""
2009-09-15 13:33:35 +04:00
. \" -----------------------------------------------------------------
. \" * set default formatting
. \" -----------------------------------------------------------------
2007-06-12 07:44:01 +04:00
. \" disable hyphenation
.nh
. \" disable justification (adjust text to left margin only)
.ad l
2009-09-15 13:33:35 +04:00
. \" -----------------------------------------------------------------
. \" * MAIN CONTENT STARTS HERE *
. \" -----------------------------------------------------------------
2008-09-22 19:38:28 +04:00
.SH "NAME"
2009-09-15 13:33:35 +04:00
onnode \- run commands on ctdb nodes
2008-09-22 19:38:28 +04:00
.SH "SYNOPSIS"
2009-09-15 13:33:35 +04:00
.HP \w '\fBonnode\ [OPTION]\ \& .\&.\&.\ NODES\ COMMAND\ \& .\&.\&.\fR\ 'u
\fB onnode [OPTION] \& .\& .\& . NODES COMMAND \& .\& .\& .\fR
2007-06-12 07:44:01 +04:00
.SH "DESCRIPTION"
.PP
2009-09-15 13:33:35 +04:00
onnode is a utility to run commands on a specific node of a CTDB cluster, or on all nodes\& .
2008-09-22 19:38:28 +04:00
.PP
2009-09-15 13:33:35 +04:00
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\& .
2008-09-22 19:38:28 +04:00
.PP
2009-09-15 13:33:35 +04:00
The COMMAND can be any shell command\& . The onnode utility uses ssh or rsh to connect to the remote nodes and run the command\& .
2008-09-22 19:38:28 +04:00
.SH "DESCRIPTIVE NODE SPECIFICATIONS"
.PP
The following descriptive node specification can be used in place of numeric node numbers:
.PP
all
.RS 4
2009-09-15 13:33:35 +04:00
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\& .
2008-09-22 19:38:28 +04:00
.RE
.PP
ok | healthy
.RS 4
2009-09-15 13:33:35 +04:00
All nodes that are not disconnected, banned, disabled or unhealthy\& .
2008-09-22 19:38:28 +04:00
.RE
2007-06-12 07:44:01 +04:00
.PP
2008-09-22 19:38:28 +04:00
con | connected
.RS 4
2009-09-15 13:33:35 +04:00
All nodes that are not disconnected\& .
2008-09-22 19:38:28 +04:00
.RE
2007-06-12 07:44:01 +04:00
.PP
2009-05-12 12:21:26 +04:00
lvs | lvsmaster
.RS 4
2009-09-15 13:33:35 +04:00
The current LVS master\& .
2009-05-12 12:21:26 +04:00
.RE
.PP
natgw | natgwlist
.RS 4
2009-09-15 13:33:35 +04:00
The current NAT gateway\& .
2009-05-12 12:21:26 +04:00
.RE
.PP
2008-09-22 19:38:28 +04:00
rm | recmaster
.RS 4
2009-09-15 13:33:35 +04:00
The current recovery master\& .
2008-09-22 19:38:28 +04:00
.RE
2008-07-10 08:19:52 +04:00
.SH "OPTIONS"
2007-06-12 07:44:01 +04:00
.PP
2008-07-10 08:19:52 +04:00
\- c
.RS 4
2009-09-15 13:33:35 +04:00
Execute COMMAND in the current working directory on the specified nodes\& .
2008-07-10 08:19:52 +04:00
.RE
.PP
2009-05-12 12:21:26 +04:00
\- o <prefix>
.RS 4
2009-09-15 13:33:35 +04:00
Causes standard output from each node to be saved into a file with name <prefix>\& .<ip>\& .
2009-05-12 12:21:26 +04:00
.RE
.PP
2008-07-10 08:19:52 +04:00
\- p
.RS 4
2009-09-15 13:33:35 +04:00
Run COMMAND in parallel on the specified nodes\& . The default is to run COMMAND sequentially on each node\& .
2008-07-10 08:19:52 +04:00
.RE
.PP
\- q
.RS 4
2009-09-15 13:33:35 +04:00
Do not print node addresses\& . Normally, onnode prints informational node addresses if more than one node is specified\& . This overrides \- v\& .
2008-07-10 08:19:52 +04:00
.RE
.PP
2009-10-22 10:47:10 +04:00
\- 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
/etc/ctdb/nodes\& . This overrides the CTDB_NODES_FILE environment variable\& .
.RE
.PP
2008-07-10 08:19:52 +04:00
\- v
.RS 4
2009-09-15 13:33:35 +04:00
Print a node addresses even if only one node is specified\& . Normally, onnode prints informational node addresses when more than one node is specified\& .
2008-07-10 08:19:52 +04:00
.RE
.PP
\- h, \- \- help
.RS 4
2009-09-15 13:33:35 +04:00
Show a short usage guide\& .
2008-07-10 08:19:52 +04:00
.RE
2007-06-12 07:44:01 +04:00
.SH "EXAMPLES"
.PP
The following command would show the process ID of ctdb on all nodes
.sp
2009-09-15 13:33:35 +04:00
.if n \{ \
2007-06-12 07:44:01 +04:00
.RS 4
2009-09-15 13:33:35 +04:00
. \}
2007-06-12 07:44:01 +04:00
.nf
2008-07-10 08:19:52 +04:00
onnode all pidof ctdbd
.fi
2009-09-15 13:33:35 +04:00
.if n \{ \
2008-07-10 08:19:52 +04:00
.RE
2009-09-15 13:33:35 +04:00
. \}
2008-07-10 08:19:52 +04:00
.PP
The following command would show the last 5 lines of log on each node, preceded by the node\' s hostname
.sp
2009-09-15 13:33:35 +04:00
.if n \{ \
2008-07-10 08:19:52 +04:00
.RS 4
2009-09-15 13:33:35 +04:00
. \}
2008-07-10 08:19:52 +04:00
.nf
2009-09-15 13:33:35 +04:00
onnode all "hostname; tail \- 5 /var/log/log\& .ctdb"
2008-07-10 08:19:52 +04:00
2007-06-12 07:44:01 +04:00
.fi
2009-09-15 13:33:35 +04:00
.if n \{ \
2007-06-12 07:44:01 +04:00
.RE
2009-09-15 13:33:35 +04:00
. \}
2007-06-12 07:44:01 +04:00
.PP
2009-09-15 13:33:35 +04:00
The following command would restart the ctdb service on all nodes\& .
2007-06-12 07:44:01 +04:00
.sp
2009-09-15 13:33:35 +04:00
.if n \{ \
2007-06-12 07:44:01 +04:00
.RS 4
2009-09-15 13:33:35 +04:00
. \}
2007-06-12 07:44:01 +04:00
.nf
2008-07-10 08:19:52 +04:00
onnode all service ctdb restart
2007-06-12 07:44:01 +04:00
.fi
2009-09-15 13:33:35 +04:00
.if n \{ \
2007-06-12 07:44:01 +04:00
.RE
2009-09-15 13:33:35 +04:00
. \}
2007-06-12 07:44:01 +04:00
.PP
2009-09-15 13:33:35 +04:00
The following command would run \& ./foo in the current working directory, in parallel, on nodes 0, 2, 3 and 4\& .
2007-06-12 07:44:01 +04:00
.sp
2009-09-15 13:33:35 +04:00
.if n \{ \
2007-06-12 07:44:01 +04:00
.RS 4
2009-09-15 13:33:35 +04:00
. \}
2007-06-12 07:44:01 +04:00
.nf
2009-09-15 13:33:35 +04:00
onnode \- c \- p 0,2\- 4 \& ./foo
2008-07-10 08:19:52 +04:00
2007-06-12 07:44:01 +04:00
.fi
2009-09-15 13:33:35 +04:00
.if n \{ \
2008-07-10 08:19:52 +04:00
.RE
2009-09-15 13:33:35 +04:00
. \}
2009-10-06 06:38:00 +04:00
.SH "ENVIRONMENT"
.PP
\fB CTDB_NODES_FILE\fR
.RS 4
Name of alternative nodes file to use instead of
/etc/ctdb/nodes\& .
.RE
2008-07-10 08:19:52 +04:00
.SH "FILES"
.PP
/etc/ctdb/nodes
.RS 4
2009-10-06 06:38:00 +04:00
Default file containing a list of each node\' s IP address or hostname\& .
2008-07-10 08:19:52 +04:00
.RE
.PP
2009-09-15 13:33:35 +04:00
/etc/ctdb/onnode\& .conf
2008-07-10 08:19:52 +04:00
.RS 4
2009-09-15 13:33:35 +04:00
If this file exists it is sourced by onnode\& . The main purpose is to allow the administrator to set $SSH to something other than "ssh"\& . In this case the \- t option is ignored\& . For example, the administrator may choose to use use rsh instead of ssh\& .
2007-06-12 07:44:01 +04:00
.RE
.SH "SEE ALSO"
.PP
ctdbd(1), ctdb(1),
2009-09-15 13:33:35 +04:00
\m[blue]\fB\%http://ctdb.samba.org/\fR\m[]
2007-06-12 07:44:01 +04:00
.SH "COPYRIGHT/LICENSE"
.sp
2009-09-15 13:33:35 +04:00
.if n \{ \
2007-06-12 07:44:01 +04:00
.RS 4
2009-09-15 13:33:35 +04:00
. \}
2007-06-12 07:44:01 +04:00
.nf
Copyright (C) Andrew Tridgell 2007
Copyright (C) Ronnie sahlberg 2007
2008-07-10 08:19:52 +04:00
Copyright (C) Martin Schwenke 2008
2007-06-12 07:44:01 +04:00
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
2007-07-10 09:29:31 +04:00
the Free Software Foundation; either version 3 of the License, or (at
2009-09-15 13:33:35 +04:00
your option) any later version\& .
2007-06-12 07:44:01 +04:00
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
2009-09-15 13:33:35 +04:00
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\& . See the GNU
General Public License for more details\& .
2007-06-12 07:44:01 +04:00
You should have received a copy of the GNU General Public License
2009-09-15 13:33:35 +04:00
along with this program; if not, see http://www\& .gnu\& .org/licenses/\& .
2007-06-12 07:44:01 +04:00
.fi
2009-09-15 13:33:35 +04:00
.if n \{ \
2007-06-12 07:44:01 +04:00
.RE
2009-09-15 13:33:35 +04:00
. \}