1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <refentry id="onnode.1">
6 <refentrytitle>onnode</refentrytitle>
7 <manvolnum>1</manvolnum>
12 <refname>onnode</refname>
13 <refpurpose>run commands on ctdb nodes</refpurpose>
18 <command>onnode [OPTION] ... NODES COMMAND ...</command>
22 <refsect1><title>DESCRIPTION</title>
24 onnode is a utility to run commands on a specific node of a CTDB
25 cluster, or on all nodes.
28 The NODES option specifies which node to run a command on. You
29 can specify a numeric node number (from 0 to N-1) or a
30 descriptive node specification (see DESCRIPTIVE NODE
31 SPECIFICATIONS below). You can also specify lists of nodes,
32 separated by commas, and ranges of numeric node numbers,
33 separated by dashes. If nodes are specified multiple times then
34 the command will be executed multiple times on those nodes. The
35 order of nodes is significant.
38 The COMMAND can be any shell command. The onnode utility uses
39 ssh or rsh to connect to the remote nodes and run the command.
43 <refsect1><title>DESCRIPTIVE NODE SPECIFICATIONS</title>
46 The following descriptive node specification can be used in
47 place of numeric node numbers:
51 <varlistentry><term>all</term>
58 <varlistentry><term>ok | healthy</term>
61 All nodes that are not disconnected, banned, disabled or
66 <varlistentry><term>con | connected</term>
69 All nodes that are not disconnected.
73 <varlistentry><term>lvs | lvsmaster</term>
76 The current LVS master.
80 <varlistentry><term>natgw | natgwlist</term>
83 The current NAT gateway.
87 <varlistentry><term>rm | recmaster</term>
90 The current recovery master.
97 <refsect1><title>OPTIONS</title>
100 <varlistentry><term>-c</term>
103 Execute COMMAND in the current working directory on the
109 <varlistentry><term>-o <prefix></term>
112 Causes standard output from each node to be saved into a
113 file with name <prefix>.<ip>.
118 <varlistentry><term>-p</term>
121 Run COMMAND in parallel on the specified nodes. The
122 default is to run COMMAND sequentially on each node.
127 <varlistentry><term>-q</term>
130 Do not print node addresses. Normally, onnode prints
131 informational node addresses if more than one node is
132 specified. This overrides -v.
137 <varlistentry><term>-v</term>
140 Print a node addresses even if only one node is specified.
141 Normally, onnode prints informational node addresses when
142 more than one node is specified.
147 <varlistentry><term>-h, --help</term>
150 Show a short usage guide.
157 <refsect1><title>EXAMPLES</title>
159 The following command would show the process ID of ctdb on all nodes
161 <screen format="linespecific">
162 onnode all pidof ctdbd
166 The following command would show the last 5 lines of log on each
167 node, preceded by the node's hostname
169 <screen format="linespecific">
170 onnode all "hostname; tail -5 /var/log/log.ctdb"
174 The following command would restart the ctdb service on all nodes.
176 <screen format="linespecific">
177 onnode all service ctdb restart
181 The following command would run ./foo in the current working
182 directory, in parallel, on nodes 0, 2, 3 and 4.
184 <screen format="linespecific">
185 onnode -c -p 0,2-4 ./foo
189 <refsect1><title>FILES</title>
192 <varlistentry><term>/etc/ctdb/nodes</term>
195 Contains a list of each node's IP address or hostname.
200 <varlistentry><term>/etc/ctdb/onnode.conf</term>
203 If this file exists it is sourced by onnode. The main
204 purpose is to allow the administrator to set $SSH to
205 something other than "ssh". In this case the -t option is
206 ignored. For example, the administrator may choose to use
207 use rsh instead of ssh.
214 <refsect1><title>SEE ALSO</title>
216 ctdbd(1), ctdb(1), <ulink url="http://ctdb.samba.org/"/>
219 <refsect1><title>COPYRIGHT/LICENSE</title>
221 Copyright (C) Andrew Tridgell 2007
222 Copyright (C) Ronnie sahlberg 2007
223 Copyright (C) Martin Schwenke 2008
225 This program is free software; you can redistribute it and/or modify
226 it under the terms of the GNU General Public License as published by
227 the Free Software Foundation; either version 3 of the License, or (at
228 your option) any later version.
230 This program is distributed in the hope that it will be useful, but
231 WITHOUT ANY WARRANTY; without even the implied warranty of
232 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
233 General Public License for more details.
235 You should have received a copy of the GNU General Public License
236 along with this program; if not, see http://www.gnu.org/licenses/.