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       -p
43           Run COMMAND in parallel on the specified nodes. The default is to
44           run COMMAND sequentially on each node.
45
46       -P
47           Push files to nodes. Names of files to push are specified rather
48           than the usual command. Quoting is fragile/broken - filenames with
49           whitespace in them are not supported.
50
51       -q
52           Do not print node addresses. Normally, onnode prints informational
53           node addresses if more than one node is specified. This overrides
54           -v.
55
56       -v
57           Print node addresses even if only one node is specified. Normally,
58           onnode prints informational node addresses when more than one node
59           is specified.
60
61       -h, --help
62           Show a short usage guide.
63

NODES SPECIFICATION

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

EXAMPLES

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

FILES

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

SEE ALSO

128       ctdb(7), http://ctdb.samba.org/
129

AUTHOR

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