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 the special
30 node 'all'. You can also specify lists of nodes, separated by
31 commas, and ranges of numeric node numbers, separated by dashes.
32 If nodes are specified multiple times then the command will be
33 executed multiple times on those nodes. The order of nodes is
37 The COMMAND can be any shell command. The onnode utility uses
38 ssh or rsh to connect to the remote nodes and run the command.
42 <refsect1><title>OPTIONS</title>
45 <varlistentry><term>-c</term>
48 Execute COMMAND in the current working directory on each
54 <varlistentry><term>-p</term>
57 Run commands in parallel on the specified nodes. In this
63 <varlistentry><term>-q</term>
66 Do not print node addresses. Normally, onnode prints
67 informational node addresses if more than one node is
68 specified. This overrides -v.
73 <varlistentry><term>-v</term>
76 Print a node addresses even if only one node is specified.
77 Normally, onnode prints informational node addresses when
78 more than one node is specified.
83 <varlistentry><term>-h, --help</term>
86 Show a short usage guide.
93 <refsect1><title>EXAMPLES</title>
95 The following command would show the process ID of ctdb on all nodes
97 <screen format="linespecific">
98 onnode all pidof ctdbd
102 The following command would show the last 5 lines of log on each
103 node, preceded by the node's hostname
105 <screen format="linespecific">
106 onnode all "hostname; tail -5 /var/log/log.ctdb"
110 The following command would restart the ctdb service on all nodes.
112 <screen format="linespecific">
113 onnode all service ctdb restart
117 The following command would run ./foo in the current working
118 directory, in parallel, on nodes 0, 2, 3 and 4.
120 <screen format="linespecific">
121 onnode -c -p 0,2-4 ./foo
125 <refsect1><title>FILES</title>
128 <varlistentry><term>/etc/ctdb/nodes</term>
131 Contains a list of each node's IP address or hostname.
136 <varlistentry><term>/etc/ctdb/onnode.conf</term>
139 If this file exists it is sourced by onnode. The main
140 purpose is to allow the administrator to set $SSH to
141 something other than "ssh". In this case the -t option is
142 ignored. For example, the administrator may choose to use
143 use rsh instead of ssh.
150 <refsect1><title>SEE ALSO</title>
152 ctdbd(1), ctdb(1), <ulink url="http://ctdb.samba.org/"/>
155 <refsect1><title>COPYRIGHT/LICENSE</title>
157 Copyright (C) Andrew Tridgell 2007
158 Copyright (C) Ronnie sahlberg 2007
159 Copyright (C) Martin Schwenke 2008
161 This program is free software; you can redistribute it and/or modify
162 it under the terms of the GNU General Public License as published by
163 the Free Software Foundation; either version 3 of the License, or (at
164 your option) any later version.
166 This program is distributed in the hope that it will be useful, but
167 WITHOUT ANY WARRANTY; without even the implied warranty of
168 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
169 General Public License for more details.
171 You should have received a copy of the GNU General Public License
172 along with this program; if not, see http://www.gnu.org/licenses/.