1ONNODE(1)                                                            ONNODE(1)
2
3
4

NAME

6       onnode - run commands on ctdb 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       The NODES option specifies which node to run a command on. You can
16       specify a numeric node number (from 0 to N-1) or a descriptive node
17       specification (see DESCRIPTIVE NODE SPECIFICATIONS below). You can also
18       specify lists of nodes, separated by commas, and ranges of numeric node
19       numbers, separated by dashes. If nodes are specified multiple times
20       then the command will be executed multiple times on those nodes. The
21       order of nodes is significant.
22
23       The COMMAND can be any shell command. The onnode utility uses ssh or
24       rsh to connect to the remote nodes and run the command.
25

DESCRIPTIVE NODE SPECIFICATIONS

27       The following descriptive node specification can be used in place of
28       numeric node numbers:
29
30       all
31           All nodes.
32
33       any
34           A node where ctdbd is running. This semi-random but there is a bias
35           towards choosing a low numbered node.
36
37       ok | healthy
38           All nodes that are not disconnected, banned, disabled or unhealthy.
39
40       con | connected
41           All nodes that are not disconnected.
42
43       lvs | lvsmaster
44           The current LVS master.
45
46       natgw | natgwlist
47           The current NAT gateway.
48
49       rm | recmaster
50           The current recovery master.
51

OPTIONS

53       -c
54           Execute COMMAND in the current working directory on the specified
55           nodes.
56
57       -o <prefix>
58           Causes standard output from each node to be saved into a file with
59           name <prefix>.<ip>.
60
61       -p
62           Run COMMAND in parallel on the specified nodes. The default is to
63           run COMMAND sequentially on each node.
64
65       -q
66           Do not print node addresses. Normally, onnode prints informational
67           node addresses if more than one node is specified. This overrides
68           -v.
69
70       -n
71           Allow nodes to be specified by name rather than node numbers. These
72           nodes don´t need to be listed in the nodes file. You can avoid the
73           nodes file entirely by combining this with -f /dev/null.
74
75       -f <file>
76           Specify an alternative nodes file to use instead of
77           /etc/ctdb/nodes. This overrides the CTDB_NODES_FILE environment
78           variable.
79
80       -v
81           Print a node addresses even if only one node is specified.
82           Normally, onnode prints informational node addresses when more than
83           one node is specified.
84
85       -h, --help
86           Show a short usage guide.
87

EXAMPLES

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

ENVIRONMENT

112       CTDB_NODES_FILE
113           Name of alternative nodes file to use instead of /etc/ctdb/nodes.
114

FILES

116       /etc/ctdb/nodes
117           Default file containing a list of each node´s IP address or
118           hostname.
119
120       /etc/ctdb/onnode.conf
121           If this file exists it is sourced by onnode. The main purpose is to
122           allow the administrator to set $SSH to something other than "ssh".
123           In this case the -t option is ignored. For example, the
124           administrator may choose to use use rsh instead of ssh.
125

SEE ALSO

127       ctdbd(1), ctdb(1), http://ctdb.samba.org/
128

COPYRIGHT/LICENSE

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