1ONNODE(1)                CTDB - clustered TDB database               ONNODE(1)
2
3
4

NAME

6       onnode - run commands on CTDB cluster nodes
7

SYNOPSIS

9       onnode [OPTION...] {NODES} {COMMAND}
10

DESCRIPTION

12       onnode is a utility to run commands on a specific node of a CTDB
13       cluster, or on all nodes.
14
15       NODES specifies which node(s) to run a command on. See section NODES
16       SPECIFICATION for details.
17
18       COMMAND can be any shell command. The onnode utility uses ssh or rsh to
19       connect to the remote nodes and run the command.
20

OPTIONS

22       -c
23           Execute COMMAND in the current working directory on the specified
24           nodes.
25
26       -f FILENAME
27           Specify an alternative nodes FILENAME to use instead of the
28           default. This option overrides the CTDB_NODES_FILE environment
29           variable. See the discussion of /etc/ctdb/nodes in the FILES
30           section for more details.
31
32       -i
33           Keep standard input open, allowing data to be piped to onnode.
34           Normally onnode closes stdin to avoid surprises when scripting.
35           Note that this option is ignored when using -p or if SSH is set to
36           anything other than "ssh".
37
38       -n
39           Allow nodes to be specified by name rather than node numbers. These
40           nodes don't need to be listed in the nodes file. You can avoid the
41           nodes file entirely by combining this with -f /dev/null.
42
43       -o PREFIX
44           Causes standard output from each node to be saved into a file with
45           name PREFIX.IP.
46
47       -p
48           Run COMMAND in parallel on the specified nodes. The default is to
49           run COMMAND sequentially on each node.
50
51       -P
52           Push files to nodes. Names of files to push are specified rather
53           than the usual command. Quoting is fragile/broken - filenames with
54           whitespace in them are not supported.
55
56       -q
57           Do not print node addresses. Normally, onnode prints informational
58           node addresses if more than one node is specified. This overrides
59           -v.
60
61       -v
62           Print node addresses even if only one node is specified. Normally,
63           onnode prints informational node addresses when more than one node
64           is specified.
65
66       -h, --help
67           Show a short usage guide.
68

NODES SPECIFICATION

70       Nodes can be specified via numeric node numbers (from 0 to N-1) or
71       mnemonics. Multiple nodes are specified using lists of nodes, separated
72       by commas, and ranges of numeric node numbers, separated by dashes. If
73       nodes are specified multiple times then the command will be executed
74       multiple times on those nodes. The order of nodes is significant.
75
76       The following mnemonics are available:
77
78       all
79           All nodes.
80
81       any
82           A node where ctdbd is running. This semi-random but there is a bias
83           towards choosing a low numbered node.
84
85       ok | healthy
86           All nodes that are not disconnected, banned, disabled or unhealthy.
87
88       con | connected
89           All nodes that are not disconnected.
90
91       lvs | lvsmaster
92           The current LVS master.
93
94       natgw | natgwlist
95           The current NAT gateway.
96
97       rm | recmaster
98           The current recovery master.
99

EXAMPLES

101       The following command would show the process ID of ctdbd on all nodes
102
103                 onnode all ctdb getpid
104
105
106       The following command would show the last 5 lines of log on each node,
107       preceded by the node's hostname
108
109                 onnode all "hostname; tail -5 /var/log/log.ctdb"
110
111
112       The following command would restart the ctdb service on all nodes, in
113       parallel.
114
115                 onnode -p all service ctdb restart
116
117
118       The following command would run ./foo in the current working directory,
119       in parallel, on nodes 0, 2, 3 and 4.
120
121                 onnode -c -p 0,2-4 ./foo
122
123

ENVIRONMENT

125       CTDB_BASE
126           Directory containing CTDB configuration files. The default is
127           /etc/ctdb.
128
129       CTDB_NODES_FILE
130           Name of alternative nodes file to use instead of the default. See
131           the FILES section for more details.
132

FILES

134       /etc/ctdb/nodes
135           Default file containing a list of each node's IP address or
136           hostname.
137
138           Actually, the default is $CTDB_BASE/nodes, where CTDB_BASE defaults
139           to /etc/ctdb. If a relative path is given (via the -f option or
140           CTDB_BASE) and no corresponding file exists relative to the current
141           directory then the file is also searched for in the $CTDB_BASE
142           directory.
143
144       /etc/ctdb/onnode.conf
145           If this file exists it is sourced by onnode. The main purpose is to
146           allow the administrator to set SSH to something other than "ssh".
147           In this case the -t option is ignored. For example, the
148           administrator may choose to use use rsh instead of ssh.
149

SEE ALSO

151       ctdb(7), http://ctdb.samba.org/
152

AUTHOR

154       This documentation was written by Andrew Tridgell, Martin Schwenke
155
157       Copyright © 2007 Andrew Tridgell, Ronnie Sahlberg
158       Copyright © 2008 Martin Schwenke
159
160       This program is free software; you can redistribute it and/or modify it
161       under the terms of the GNU General Public License as published by the
162       Free Software Foundation; either version 3 of the License, or (at your
163       option) any later version.
164
165       This program is distributed in the hope that it will be useful, but
166       WITHOUT ANY WARRANTY; without even the implied warranty of
167       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
168       General Public License for more details.
169
170       You should have received a copy of the GNU General Public License along
171       with this program; if not, see http://www.gnu.org/licenses.
172
173
174
175
176ctdb                              11/27/2013                         ONNODE(1)
Impressum