1 | '\" t
|
---|
2 | .\" Title: onnode
|
---|
3 | .\" Author:
|
---|
4 | .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
|
---|
5 | .\" Date: 01/27/2016
|
---|
6 | .\" Manual: CTDB - clustered TDB database
|
---|
7 | .\" Source: ctdb
|
---|
8 | .\" Language: English
|
---|
9 | .\"
|
---|
10 | .TH "ONNODE" "1" "01/27/2016" "ctdb" "CTDB \- clustered TDB database"
|
---|
11 | .\" -----------------------------------------------------------------
|
---|
12 | .\" * Define some portability stuff
|
---|
13 | .\" -----------------------------------------------------------------
|
---|
14 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
---|
15 | .\" http://bugs.debian.org/507673
|
---|
16 | .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
---|
17 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
---|
18 | .ie \n(.g .ds Aq \(aq
|
---|
19 | .el .ds Aq '
|
---|
20 | .\" -----------------------------------------------------------------
|
---|
21 | .\" * set default formatting
|
---|
22 | .\" -----------------------------------------------------------------
|
---|
23 | .\" disable hyphenation
|
---|
24 | .nh
|
---|
25 | .\" disable justification (adjust text to left margin only)
|
---|
26 | .ad l
|
---|
27 | .\" -----------------------------------------------------------------
|
---|
28 | .\" * MAIN CONTENT STARTS HERE *
|
---|
29 | .\" -----------------------------------------------------------------
|
---|
30 | .SH "NAME"
|
---|
31 | onnode \- run commands on CTDB cluster nodes
|
---|
32 | .SH "SYNOPSIS"
|
---|
33 | .HP \w'\fBonnode\fR\ 'u
|
---|
34 | \fBonnode\fR [\fIOPTION\fR...] {\fINODES\fR} {\fICOMMAND\fR}
|
---|
35 | .SH "DESCRIPTION"
|
---|
36 | .PP
|
---|
37 | onnode is a utility to run commands on a specific node of a CTDB cluster, or on all nodes\&.
|
---|
38 | .PP
|
---|
39 | \fINODES\fR
|
---|
40 | specifies which node(s) to run a command on\&. See section
|
---|
41 | NODES SPECIFICATION
|
---|
42 | for details\&.
|
---|
43 | .PP
|
---|
44 | \fICOMMAND\fR
|
---|
45 | can be any shell command\&. The onnode utility uses ssh or rsh to connect to the remote nodes and run the command\&.
|
---|
46 | .SH "OPTIONS"
|
---|
47 | .PP
|
---|
48 | \-c
|
---|
49 | .RS 4
|
---|
50 | Execute COMMAND in the current working directory on the specified nodes\&.
|
---|
51 | .RE
|
---|
52 | .PP
|
---|
53 | \-f \fIFILENAME\fR
|
---|
54 | .RS 4
|
---|
55 | Specify an alternative nodes FILENAME to use instead of the default\&. This option overrides the CTDB_NODES_FILE and CTDB_NODES variables\&. See the discussion of
|
---|
56 | /usr/local/etc/ctdb/nodes
|
---|
57 | in the FILES section for more details\&.
|
---|
58 | .RE
|
---|
59 | .PP
|
---|
60 | \-i
|
---|
61 | .RS 4
|
---|
62 | Keep standard input open, allowing data to be piped to onnode\&. Normally onnode closes stdin to avoid surprises when scripting\&. Note that this option is ignored when using
|
---|
63 | \fB\-p\fR
|
---|
64 | or if
|
---|
65 | \fBSSH\fR
|
---|
66 | is set to anything other than "ssh"\&.
|
---|
67 | .RE
|
---|
68 | .PP
|
---|
69 | \-n
|
---|
70 | .RS 4
|
---|
71 | Allow nodes to be specified by name rather than node numbers\&. These nodes don\*(Aqt need to be listed in the nodes file\&. You can avoid the nodes file entirely by combining this with
|
---|
72 | \-f /dev/null\&.
|
---|
73 | .RE
|
---|
74 | .PP
|
---|
75 | \-o \fIPREFIX\fR
|
---|
76 | .RS 4
|
---|
77 | Causes standard output from each node to be saved into a file with name PREFIX\&.\fIIP\fR\&.
|
---|
78 | .RE
|
---|
79 | .PP
|
---|
80 | \-p
|
---|
81 | .RS 4
|
---|
82 | Run COMMAND in parallel on the specified nodes\&. The default is to run COMMAND sequentially on each node\&.
|
---|
83 | .RE
|
---|
84 | .PP
|
---|
85 | \-P
|
---|
86 | .RS 4
|
---|
87 | Push files to nodes\&. Names of files to push are specified rather than the usual command\&. Quoting is fragile/broken \- filenames with whitespace in them are not supported\&.
|
---|
88 | .RE
|
---|
89 | .PP
|
---|
90 | \-q
|
---|
91 | .RS 4
|
---|
92 | Do not print node addresses\&. Normally, onnode prints informational node addresses if more than one node is specified\&. This overrides \-v\&.
|
---|
93 | .RE
|
---|
94 | .PP
|
---|
95 | \-v
|
---|
96 | .RS 4
|
---|
97 | Print node addresses even if only one node is specified\&. Normally, onnode prints informational node addresses when more than one node is specified\&.
|
---|
98 | .RE
|
---|
99 | .PP
|
---|
100 | \-h, \-\-help
|
---|
101 | .RS 4
|
---|
102 | Show a short usage guide\&.
|
---|
103 | .RE
|
---|
104 | .SH "NODES SPECIFICATION"
|
---|
105 | .PP
|
---|
106 | Nodes can be specified via numeric node numbers (from 0 to N\-1) or mnemonics\&. Multiple nodes are specified using 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\&.
|
---|
107 | .PP
|
---|
108 | The following mnemonics are available:
|
---|
109 | .PP
|
---|
110 | all
|
---|
111 | .RS 4
|
---|
112 | All nodes\&.
|
---|
113 | .RE
|
---|
114 | .PP
|
---|
115 | any
|
---|
116 | .RS 4
|
---|
117 | A node where ctdbd is running\&. This semi\-random but there is a bias towards choosing a low numbered node\&.
|
---|
118 | .RE
|
---|
119 | .PP
|
---|
120 | ok | healthy
|
---|
121 | .RS 4
|
---|
122 | All nodes that are not disconnected, banned, disabled or unhealthy\&.
|
---|
123 | .RE
|
---|
124 | .PP
|
---|
125 | con | connected
|
---|
126 | .RS 4
|
---|
127 | All nodes that are not disconnected\&.
|
---|
128 | .RE
|
---|
129 | .PP
|
---|
130 | lvs | lvsmaster
|
---|
131 | .RS 4
|
---|
132 | The current LVS master\&.
|
---|
133 | .RE
|
---|
134 | .PP
|
---|
135 | natgw | natgwlist
|
---|
136 | .RS 4
|
---|
137 | The current NAT gateway\&.
|
---|
138 | .RE
|
---|
139 | .PP
|
---|
140 | rm | recmaster
|
---|
141 | .RS 4
|
---|
142 | The current recovery master\&.
|
---|
143 | .RE
|
---|
144 | .SH "EXAMPLES"
|
---|
145 | .PP
|
---|
146 | The following command would show the process ID of ctdbd on all nodes
|
---|
147 | .sp
|
---|
148 | .if n \{\
|
---|
149 | .RS 4
|
---|
150 | .\}
|
---|
151 | .nf
|
---|
152 | onnode all ctdb getpid
|
---|
153 |
|
---|
154 | .fi
|
---|
155 | .if n \{\
|
---|
156 | .RE
|
---|
157 | .\}
|
---|
158 | .PP
|
---|
159 | The following command would show the last 5 lines of log on each node, preceded by the node\*(Aqs hostname
|
---|
160 | .sp
|
---|
161 | .if n \{\
|
---|
162 | .RS 4
|
---|
163 | .\}
|
---|
164 | .nf
|
---|
165 | onnode all "hostname; tail \-5 /usr/local/var/log/log\&.ctdb"
|
---|
166 |
|
---|
167 | .fi
|
---|
168 | .if n \{\
|
---|
169 | .RE
|
---|
170 | .\}
|
---|
171 | .PP
|
---|
172 | The following command would restart the ctdb service on all nodes, in parallel\&.
|
---|
173 | .sp
|
---|
174 | .if n \{\
|
---|
175 | .RS 4
|
---|
176 | .\}
|
---|
177 | .nf
|
---|
178 | onnode \-p all service ctdb restart
|
---|
179 |
|
---|
180 | .fi
|
---|
181 | .if n \{\
|
---|
182 | .RE
|
---|
183 | .\}
|
---|
184 | .PP
|
---|
185 | The following command would run \&./foo in the current working directory, in parallel, on nodes 0, 2, 3 and 4\&.
|
---|
186 | .sp
|
---|
187 | .if n \{\
|
---|
188 | .RS 4
|
---|
189 | .\}
|
---|
190 | .nf
|
---|
191 | onnode \-c \-p 0,2\-4 \&./foo
|
---|
192 |
|
---|
193 | .fi
|
---|
194 | .if n \{\
|
---|
195 | .RE
|
---|
196 | .\}
|
---|
197 | .SH "ENVIRONMENT"
|
---|
198 | .PP
|
---|
199 | \fBCTDB_BASE\fR
|
---|
200 | .RS 4
|
---|
201 | Directory containing CTDB configuration files\&. The default is
|
---|
202 | /usr/local/etc/ctdb\&.
|
---|
203 | .RE
|
---|
204 | .PP
|
---|
205 | \fBCTDB_NODES_FILE\fR
|
---|
206 | .RS 4
|
---|
207 | Name of alternative nodes file to use instead of the default\&. See the
|
---|
208 | FILES
|
---|
209 | section for more details\&.
|
---|
210 | .RE
|
---|
211 | .SH "FILES"
|
---|
212 | .PP
|
---|
213 | /usr/local/etc/ctdb/nodes
|
---|
214 | .RS 4
|
---|
215 | Default file containing a list of each node\*(Aqs IP address or hostname\&.
|
---|
216 | .sp
|
---|
217 | As above, a file specified via the
|
---|
218 | \fB\-f\fR
|
---|
219 | or
|
---|
220 | \fBCTDB_NODES_FILE\fR
|
---|
221 | is given precedence\&. If a relative path is specified and no corresponding file exists relative to the current directory then the file is also searched for in the
|
---|
222 | $CTDB_BASE
|
---|
223 | directory\&.
|
---|
224 | .sp
|
---|
225 | If
|
---|
226 | \fBCTDB_NODES_FILE\fR
|
---|
227 | is not set and
|
---|
228 | \fBCTDB_NODES\fR
|
---|
229 | is set in configuration then the file pointed to by
|
---|
230 | \fBCTDB_NODES\fR
|
---|
231 | is used\&.
|
---|
232 | .sp
|
---|
233 | Otherwise the default is
|
---|
234 | $CTDB_BASE/nodes, where
|
---|
235 | \fBCTDB_BASE\fR
|
---|
236 | defaults to
|
---|
237 | /usr/local/etc/ctdb\&.
|
---|
238 | .RE
|
---|
239 | .PP
|
---|
240 | /usr/local/etc/ctdb/onnode\&.conf
|
---|
241 | .RS 4
|
---|
242 | If this file exists it is sourced by onnode\&. The main purpose is to allow the administrator to set
|
---|
243 | \fBSSH\fR
|
---|
244 | 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\&.
|
---|
245 | .RE
|
---|
246 | .SH "SEE ALSO"
|
---|
247 | .PP
|
---|
248 | \fBctdb\fR(7),
|
---|
249 | \m[blue]\fB\%http://ctdb.samba.org/\fR\m[]
|
---|
250 | .SH "AUTHOR"
|
---|
251 | .br
|
---|
252 | .PP
|
---|
253 | This documentation was written by Andrew Tridgell, Martin Schwenke
|
---|
254 | .SH "COPYRIGHT"
|
---|
255 | .br
|
---|
256 | Copyright \(co 2007 Andrew Tridgell, Ronnie Sahlberg
|
---|
257 | .br
|
---|
258 | Copyright \(co 2008 Martin Schwenke
|
---|
259 | .br
|
---|
260 | .PP
|
---|
261 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version\&.
|
---|
262 | .PP
|
---|
263 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\&. See the GNU General Public License for more details\&.
|
---|
264 | .PP
|
---|
265 | You should have received a copy of the GNU General Public License along with this program; if not, see
|
---|
266 | \m[blue]\fB\%http://www.gnu.org/licenses\fR\m[]\&.
|
---|
267 | .sp
|
---|