update the man pages with the "getreclock" and "setreclock" commands.
[sahlberg/ctdb.git] / doc / onnode.1
1 .\"     Title: onnode
2 .\"    Author: 
3 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
4 .\"      Date: 05/12/2009
5 .\"    Manual: 
6 .\"    Source: 
7 .\"
8 .TH "ONNODE" "1" "05/12/2009" "" ""
9 .\" disable hyphenation
10 .nh
11 .\" disable justification (adjust text to left margin only)
12 .ad l
13 .SH "NAME"
14 onnode - run commands on ctdb nodes
15 .SH "SYNOPSIS"
16 .HP 38
17 \fBonnode [OPTION] \.\.\. NODES COMMAND \.\.\.\fR
18 .SH "DESCRIPTION"
19 .PP
20 onnode is a utility to run commands on a specific node of a CTDB cluster, or on all nodes\.
21 .PP
22 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\.
23 .PP
24 The COMMAND can be any shell command\. The onnode utility uses ssh or rsh to connect to the remote nodes and run the command\.
25 .SH "DESCRIPTIVE NODE SPECIFICATIONS"
26 .PP
27 The following descriptive node specification can be used in place of numeric node numbers:
28 .PP
29 all
30 .RS 4
31 All nodes\.
32 .RE
33 .PP
34 ok | healthy
35 .RS 4
36 All nodes that are not disconnected, banned, disabled or unhealthy\.
37 .RE
38 .PP
39 con | connected
40 .RS 4
41 All nodes that are not disconnected\.
42 .RE
43 .PP
44 lvs | lvsmaster
45 .RS 4
46 The current LVS master\.
47 .RE
48 .PP
49 natgw | natgwlist
50 .RS 4
51 The current NAT gateway\.
52 .RE
53 .PP
54 rm | recmaster
55 .RS 4
56 The current recovery master\.
57 .RE
58 .SH "OPTIONS"
59 .PP
60 \-c
61 .RS 4
62 Execute COMMAND in the current working directory on the specified nodes\.
63 .RE
64 .PP
65 \-o <prefix>
66 .RS 4
67 Causes standard output from each node to be saved into a file with name <prefix>\.<ip>\.
68 .RE
69 .PP
70 \-p
71 .RS 4
72 Run COMMAND in parallel on the specified nodes\. The default is to run COMMAND sequentially on each node\.
73 .RE
74 .PP
75 \-q
76 .RS 4
77 Do not print node addresses\. Normally, onnode prints informational node addresses if more than one node is specified\. This overrides \-v\.
78 .RE
79 .PP
80 \-v
81 .RS 4
82 Print a node addresses even if only one node is specified\. Normally, onnode prints informational node addresses when more than one node is specified\.
83 .RE
84 .PP
85 \-h, \-\-help
86 .RS 4
87 Show a short usage guide\.
88 .RE
89 .SH "EXAMPLES"
90 .PP
91 The following command would show the process ID of ctdb on all nodes
92 .sp
93 .RS 4
94 .nf
95       onnode all pidof ctdbd
96     
97 .fi
98 .RE
99 .PP
100 The following command would show the last 5 lines of log on each node, preceded by the node\'s hostname
101 .sp
102 .RS 4
103 .nf
104       onnode all "hostname; tail \-5 /var/log/log\.ctdb"
105     
106 .fi
107 .RE
108 .PP
109 The following command would restart the ctdb service on all nodes\.
110 .sp
111 .RS 4
112 .nf
113       onnode all service ctdb restart
114     
115 .fi
116 .RE
117 .PP
118 The following command would run \./foo in the current working directory, in parallel, on nodes 0, 2, 3 and 4\.
119 .sp
120 .RS 4
121 .nf
122       onnode \-c \-p 0,2\-4 \./foo
123     
124 .fi
125 .RE
126 .SH "FILES"
127 .PP
128 /etc/ctdb/nodes
129 .RS 4
130 Contains a list of each node\'s IP address or hostname\.
131 .RE
132 .PP
133 /etc/ctdb/onnode\.conf
134 .RS 4
135 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\.
136 .RE
137 .SH "SEE ALSO"
138 .PP
139 ctdbd(1), ctdb(1),
140 \fI\%http://ctdb.samba.org/\fR
141 .SH "COPYRIGHT/LICENSE"
142 .sp
143 .RS 4
144 .nf
145 Copyright (C) Andrew Tridgell 2007
146 Copyright (C) Ronnie sahlberg 2007
147 Copyright (C) Martin Schwenke 2008
148
149 This program is free software; you can redistribute it and/or modify
150 it under the terms of the GNU General Public License as published by
151 the Free Software Foundation; either version 3 of the License, or (at
152 your option) any later version\.
153
154 This program is distributed in the hope that it will be useful, but
155 WITHOUT ANY WARRANTY; without even the implied warranty of
156 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\.  See the GNU
157 General Public License for more details\.
158
159 You should have received a copy of the GNU General Public License
160 along with this program; if not, see http://www\.gnu\.org/licenses/\.
161 .fi
162 .RE