1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>onnode</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="onnode.1"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>onnode — run commands on ctdb nodes</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">onnode [OPTION] ... NODES COMMAND ...</code> </p></div></div><div class="refsect1" lang="en"><a name="id2507974"></a><h2>DESCRIPTION</h2><p>
2 onnode is a utility to run commands on a specific node of a CTDB
3 cluster, or on all nodes.
5 The NODES option specifies which node to run a command on. You
6 can specify a numeric node number (from 0 to N-1) or the special
7 node 'all'. You can also specify lists of nodes, separated by
8 commas, and ranges of numeric node numbers, separated by dashes.
9 If nodes are specified multiple times then the command will be
10 executed multiple times on those nodes. The order of nodes is
13 The COMMAND can be any shell command. The onnode utility uses
14 ssh or rsh to connect to the remote nodes and run the command.
15 </p></div><div class="refsect1" lang="en"><a name="id2508000"></a><h2>OPTIONS</h2><div class="variablelist"><dl><dt><span class="term">-c</span></dt><dd><p>
16 Execute COMMAND in the current working directory on the
18 </p></dd><dt><span class="term">-p</span></dt><dd><p>
19 Run COMMAND in parallel on the specified nodes. The
20 default is to run COMMAND sequentially on each node.
21 </p></dd><dt><span class="term">-q</span></dt><dd><p>
22 Do not print node addresses. Normally, onnode prints
23 informational node addresses if more than one node is
24 specified. This overrides -v.
25 </p></dd><dt><span class="term">-v</span></dt><dd><p>
26 Print a node addresses even if only one node is specified.
27 Normally, onnode prints informational node addresses when
28 more than one node is specified.
29 </p></dd><dt><span class="term">-h, --help</span></dt><dd><p>
30 Show a short usage guide.
31 </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2511602"></a><h2>EXAMPLES</h2><p>
32 The following command would show the process ID of ctdb on all nodes
33 </p><pre class="screen">
34 onnode all pidof ctdbd
36 The following command would show the last 5 lines of log on each
37 node, preceded by the node's hostname
38 </p><pre class="screen">
39 onnode all "hostname; tail -5 /var/log/log.ctdb"
41 The following command would restart the ctdb service on all nodes.
42 </p><pre class="screen">
43 onnode all service ctdb restart
45 The following command would run ./foo in the current working
46 directory, in parallel, on nodes 0, 2, 3 and 4.
47 </p><pre class="screen">
48 onnode -c -p 0,2-4 ./foo
49 </pre></div><div class="refsect1" lang="en"><a name="id2511652"></a><h2>FILES</h2><div class="variablelist"><dl><dt><span class="term">/etc/ctdb/nodes</span></dt><dd><p>
50 Contains a list of each node's IP address or hostname.
51 </p></dd><dt><span class="term">/etc/ctdb/onnode.conf</span></dt><dd><p>
52 If this file exists it is sourced by onnode. The main
53 purpose is to allow the administrator to set $SSH to
54 something other than "ssh". In this case the -t option is
55 ignored. For example, the administrator may choose to use
56 use rsh instead of ssh.
57 </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2511691"></a><h2>SEE ALSO</h2><p>
58 ctdbd(1), ctdb(1), <a class="ulink" href="http://ctdb.samba.org/" target="_top">http://ctdb.samba.org/</a>
59 </p></div><div class="refsect1" lang="en"><a name="id2511703"></a><h2>COPYRIGHT/LICENSE</h2><div class="literallayout"><p><br>
60 Copyright (C) Andrew Tridgell 2007<br>
61 Copyright (C) Ronnie sahlberg 2007<br>
62 Copyright (C) Martin Schwenke 2008<br>
64 This program is free software; you can redistribute it and/or modify<br>
65 it under the terms of the GNU General Public License as published by<br>
66 the Free Software Foundation; either version 3 of the License, or (at<br>
67 your option) any later version.<br>
69 This program is distributed in the hope that it will be useful, but<br>
70 WITHOUT ANY WARRANTY; without even the implied warranty of<br>
71 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU<br>
72 General Public License for more details.<br>
74 You should have received a copy of the GNU General Public License<br>
75 along with this program; if not, see http://www.gnu.org/licenses/.<br>
76 </p></div></div></div></body></html>