Fix some documentation typos
[samba.git] / ctdb / doc / onnode.1.xml
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">
4
5 <refmeta>
6         <refentrytitle>onnode</refentrytitle>
7         <manvolnum>1</manvolnum>
8         <refmiscinfo class="source"> </refmiscinfo>
9         <refmiscinfo class="manual"> </refmiscinfo>
10 </refmeta>
11
12
13 <refnamediv>
14         <refname>onnode</refname>
15         <refpurpose>run commands on ctdb nodes</refpurpose>
16 </refnamediv>
17
18 <refsynopsisdiv>
19         <cmdsynopsis>
20                 <command>onnode [OPTION] ... NODES COMMAND ...</command>
21         </cmdsynopsis>
22 </refsynopsisdiv>
23
24   <refsect1><title>DESCRIPTION</title>
25     <para>
26       onnode is a utility to run commands on a specific node of a CTDB
27       cluster, or on all nodes.
28     </para>
29     <para>
30       The NODES option specifies which node to run a command on.  You
31       can specify a numeric node number (from 0 to N-1) or a
32       descriptive node specification (see DESCRIPTIVE NODE
33       SPECIFICATIONS below).  You can also specify lists of nodes,
34       separated by commas, and ranges of numeric node numbers,
35       separated by dashes.  If nodes are specified multiple times then
36       the command will be executed multiple times on those nodes.  The
37       order of nodes is significant.
38     </para>
39     <para>
40       The COMMAND can be any shell command. The onnode utility uses
41       ssh or rsh to connect to the remote nodes and run the command.
42     </para>
43   </refsect1>
44
45   <refsect1><title>DESCRIPTIVE NODE SPECIFICATIONS</title>
46
47     <para>
48       The following descriptive node specification can be used in
49       place of numeric node numbers:
50     </para>
51
52     <variablelist>
53       <varlistentry><term>all</term>
54         <listitem>
55           <para>
56             All nodes.
57           </para>
58         </listitem>
59       </varlistentry>
60       <varlistentry><term>any</term>
61         <listitem>
62           <para>
63              A node where ctdbd is running.  This semi-random but
64              there is a bias towards choosing a low numbered node.
65           </para>
66         </listitem>
67       </varlistentry>
68       <varlistentry><term>ok | healthy</term>
69         <listitem>
70           <para>
71             All nodes that are not disconnected, banned, disabled or
72             unhealthy.
73           </para>
74         </listitem>
75       </varlistentry>
76       <varlistentry><term>con | connected</term>
77         <listitem>
78           <para>
79             All nodes that are not disconnected.
80           </para>
81         </listitem>
82       </varlistentry>
83       <varlistentry><term>lvs | lvsmaster</term>
84         <listitem>
85           <para>
86             The current LVS master.
87           </para>
88         </listitem>
89       </varlistentry>
90       <varlistentry><term>natgw | natgwlist</term>
91         <listitem>
92           <para>
93             The current NAT gateway.
94           </para>
95         </listitem>
96       </varlistentry>
97       <varlistentry><term>rm | recmaster</term>
98         <listitem>
99           <para>
100             The current recovery master.
101           </para>
102         </listitem>
103       </varlistentry>
104     </variablelist>
105   </refsect1>
106
107   <refsect1><title>OPTIONS</title>
108
109     <variablelist>
110       <varlistentry><term>-c</term>
111         <listitem>
112           <para>
113             Execute COMMAND in the current working directory on the
114             specified nodes.
115           </para>
116         </listitem>
117       </varlistentry>
118
119       <varlistentry><term>-o &lt;prefix&gt;</term>
120         <listitem>
121           <para>
122             Causes standard output from each node to be saved into a
123             file with name &lt;prefix&gt;.&lt;ip&gt;.
124           </para>
125         </listitem>
126       </varlistentry>
127
128       <varlistentry><term>-p</term>
129         <listitem>
130           <para>
131             Run COMMAND in parallel on the specified nodes.  The
132             default is to run COMMAND sequentially on each node.
133           </para>
134         </listitem>
135       </varlistentry>
136
137       <varlistentry><term>-q</term>
138         <listitem>
139           <para>
140             Do not print node addresses.  Normally, onnode prints
141             informational node addresses if more than one node is
142             specified.  This overrides -v.
143           </para>
144         </listitem>
145       </varlistentry>
146
147       <varlistentry><term>-n</term>
148         <listitem>
149           <para>
150             Allow nodes to be specified by name rather than node
151             numbers.  These nodes don't need to be listed in the nodes
152             file.  You can avoid the nodes file entirely by combining
153             this with <code>-f /dev/null</code>.
154           </para>
155         </listitem>
156       </varlistentry>
157
158       <varlistentry><term>-f &lt;file&gt;</term>
159         <listitem>
160           <para>
161             Specify an alternative nodes file to use instead of the
162             default.  This option overrides the CTDB_NODES_FILE
163             environment variable.  See the discussion of
164             <filename>/etc/ctdb/nodes</filename> in the FILES section
165             for more details.
166           </para>
167         </listitem>
168       </varlistentry>
169
170       <varlistentry><term>-v</term>
171         <listitem>
172           <para>
173             Print a node addresses even if only one node is specified.
174             Normally, onnode prints informational node addresses when
175             more than one node is specified.
176           </para>
177         </listitem>
178       </varlistentry>
179
180       <varlistentry><term>-h, --help</term>
181         <listitem>
182           <para>
183             Show a short usage guide.
184           </para>
185         </listitem>
186       </varlistentry>
187     </variablelist>
188   </refsect1>
189
190   <refsect1><title>EXAMPLES</title>
191     <para>
192       The following command would show the process ID of ctdb on all nodes
193     </para>
194     <screen format="linespecific">
195       onnode all pidof ctdbd
196     </screen>
197
198     <para>
199       The following command would show the last 5 lines of log on each
200       node, preceded by the node's hostname
201     </para>
202     <screen format="linespecific">
203       onnode all "hostname; tail -5 /var/log/log.ctdb"
204     </screen>
205
206     <para>
207       The following command would restart the ctdb service on all nodes.
208     </para>
209     <screen format="linespecific">
210       onnode all service ctdb restart
211     </screen>
212
213     <para>
214       The following command would run ./foo in the current working
215       directory, in parallel, on nodes 0, 2, 3 and 4.
216     </para>
217     <screen format="linespecific">
218       onnode -c -p 0,2-4 ./foo
219     </screen>
220   </refsect1>
221
222   <refsect1><title>ENVIRONMENT</title>
223
224     <variablelist>
225       <varlistentry><term><envar>CTDB_NODES_FILE</envar></term>
226         <listitem>
227           <para>
228             Name of alternative nodes file to use instead of the
229             default.  See the discussion of
230             <filename>/etc/ctdb/nodes</filename> in the FILES section
231             for more details.
232           </para>
233         </listitem>
234       </varlistentry>
235
236     </variablelist>
237   </refsect1>
238
239   <refsect1><title>FILES</title>
240
241     <variablelist>
242       <varlistentry><term><filename>/etc/ctdb/nodes</filename></term>
243         <listitem>
244           <para>
245             Default file containing a list of each node's IP address
246             or hostname.
247           </para>
248           <para>
249             Actually, the default is
250             <filename>$<envar>CTDB_BASE</envar>/nodes</filename>,
251             where <envar>$CTDB_BASE</envar> defaults to
252             <filename>/etc/ctdb</filename>.  If a relative path is
253             given (via the -f option or <envar>$CTDB_BASE</envar>) and
254             no corresponding file exists relative to the current
255             directory then the file is also searched for in the
256             <filename>$<envar>CTDB_BASE</envar></filename> directory.
257           </para>
258         </listitem>
259       </varlistentry>
260
261       <varlistentry><term><filename>/etc/ctdb/onnode.conf</filename></term>
262         <listitem>
263           <para>
264             If this file exists it is sourced by onnode.  The main
265             purpose is to allow the administrator to set $SSH to
266             something other than "ssh".  In this case the -t option is
267             ignored.  For example, the administrator may choose to use
268             use rsh instead of ssh.
269           </para>
270         </listitem>
271       </varlistentry>
272     </variablelist>
273   </refsect1>
274
275   <refsect1><title>SEE ALSO</title>
276     <para>
277       ctdbd(1), ctdb(1), <ulink url="http://ctdb.samba.org/"/>
278     </para>
279   </refsect1>
280   <refsect1><title>COPYRIGHT/LICENSE</title>
281 <literallayout>
282 Copyright (C) Andrew Tridgell 2007
283 Copyright (C) Ronnie sahlberg 2007
284 Copyright (C) Martin Schwenke 2008
285
286 This program is free software; you can redistribute it and/or modify
287 it under the terms of the GNU General Public License as published by
288 the Free Software Foundation; either version 3 of the License, or (at
289 your option) any later version.
290
291 This program is distributed in the hope that it will be useful, but
292 WITHOUT ANY WARRANTY; without even the implied warranty of
293 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
294 General Public License for more details.
295
296 You should have received a copy of the GNU General Public License
297 along with this program; if not, see http://www.gnu.org/licenses/.
298 </literallayout>
299   </refsect1>
300 </refentry>