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 and CTDB_NODES
29           variables. 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

EXAMPLES

92       The following command would show the process ID of ctdbd on all nodes
93
94                 onnode all ctdb getpid
95
96
97       The following command would show the last 5 lines of log on each node,
98       preceded by the node's hostname
99
100                 onnode all "hostname; tail -5 /var/log/log.ctdb"
101
102
103       The following command would restart the ctdb service on all nodes, in
104       parallel.
105
106                 onnode -p all service ctdb restart
107
108
109       The following command would run ./foo in the current working directory,
110       in parallel, on nodes 0, 2, 3 and 4.
111
112                 onnode -c -p 0,2-4 ./foo
113
114

ENVIRONMENT

116       CTDB_BASE
117           Directory containing CTDB configuration files. The default is
118           /etc/ctdb.
119
120       CTDB_NODES_FILE
121           Name of alternative nodes file to use instead of the default. See
122           the FILES section for more details.
123

FILES

125       /etc/ctdb/nodes
126           Default file containing a list of each node's IP address or
127           hostname.
128
129           As above, a file specified via the -f or CTDB_NODES_FILE is given
130           precedence. If a relative path is specified and no corresponding
131           file exists relative to the current directory then the file is also
132           searched for in the $CTDB_BASE directory.
133
134           If CTDB_NODES_FILE is not set and CTDB_NODES is set in
135           configuration then the file pointed to by CTDB_NODES is used.
136
137           Otherwise the default is $CTDB_BASE/nodes, where CTDB_BASE defaults
138           to /etc/ctdb.
139
140       /etc/ctdb/onnode.conf
141           If this file exists it is sourced by onnode. The main purpose is to
142           allow the administrator to set SSH to something other than "ssh".
143           In this case the -t option is ignored. For example, the
144           administrator may choose to use use rsh instead of ssh.
145

SEE ALSO

147       ctdb(7), http://ctdb.samba.org/
148

AUTHOR

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