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

NODES SPECIFICATION

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

EXAMPLES

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

FILES

115       /etc/ctdb/nodes
116           Default file containing a list of each node's IP address or
117           hostname.
118
119           As above, a file specified via the -f is given precedence. If a
120           relative path is specified and no corresponding file exists
121           relative to the current directory then the file is also searched
122           for in the CTDB configuration directory.
123
124           Otherwise the default is /etc/ctdb/nodes.
125
126       /etc/ctdb/onnode.conf
127           If this file exists it is sourced by onnode. The main purpose is to
128           allow the administrator to set ONNODE_SSH to something other than
129           "ssh". In this case the -t option is ignored.
130

SEE ALSO

132       ctdb(7), http://ctdb.samba.org/
133

AUTHOR

135       This documentation was written by Andrew Tridgell, Martin Schwenke
136
138       Copyright © 2007 Andrew Tridgell, Ronnie Sahlberg
139       Copyright © 2008 Martin Schwenke
140
141       This program is free software; you can redistribute it and/or modify it
142       under the terms of the GNU General Public License as published by the
143       Free Software Foundation; either version 3 of the License, or (at your
144       option) any later version.
145
146       This program is distributed in the hope that it will be useful, but
147       WITHOUT ANY WARRANTY; without even the implied warranty of
148       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
149       General Public License for more details.
150
151       You should have received a copy of the GNU General Public License along
152       with this program; if not, see http://www.gnu.org/licenses.
153
154
155
156
157ctdb                              05/28/2019                         ONNODE(1)
Impressum