Avoid floating point divide by 0 in ctdb_fetch.c's bench_fetch().
[sahlberg/ctdb.git] / doc / onnode.1
1 .\"     Title: onnode
2 .\"    Author: 
3 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
4 .\"      Date: 09/23/2008
5 .\"    Manual: 
6 .\"    Source: 
7 .\"
8 .TH "ONNODE" "1" "09/23/2008" "" ""
9 .\" disable hyphenation
10 .nh
11 .\" disable justification (adjust text to left margin only)
12 .ad l
13 .SH "NAME"
14 onnode - run commands on ctdb nodes
15 .SH "SYNOPSIS"
16 .HP 38
17 \fBonnode [OPTION] \.\.\. NODES COMMAND \.\.\.\fR
18 .SH "DESCRIPTION"
19 .PP
20 onnode is a utility to run commands on a specific node of a CTDB cluster, or on all nodes\.
21 .PP
22 The NODES option specifies which node to run a command on\. You can specify a numeric node number (from 0 to N\-1) or a descriptive node specification (see DESCRIPTIVE NODE SPECIFICATIONS below)\. You can also specify lists of nodes, separated by commas, and ranges of numeric node numbers, separated by dashes\. If nodes are specified multiple times then the command will be executed multiple times on those nodes\. The order of nodes is significant\.
23 .PP
24 The COMMAND can be any shell command\. The onnode utility uses ssh or rsh to connect to the remote nodes and run the command\.
25 .SH "DESCRIPTIVE NODE SPECIFICATIONS"
26 .PP
27 The following descriptive node specification can be used in place of numeric node numbers:
28 .PP
29 all
30 .RS 4
31 All nodes\.
32 .RE
33 .PP
34 ok | healthy
35 .RS 4
36 All nodes that are not disconnected, banned, disabled or unhealthy\.
37 .RE
38 .PP
39 con | connected
40 .RS 4
41 All nodes that are not disconnected\.
42 .RE
43 .PP
44 rm | recmaster
45 .RS 4
46 The current recovery master\.
47 .RE
48 .SH "OPTIONS"
49 .PP
50 \-c
51 .RS 4
52 Execute COMMAND in the current working directory on the specified nodes\.
53 .RE
54 .PP
55 \-p
56 .RS 4
57 Run COMMAND in parallel on the specified nodes\. The default is to run COMMAND sequentially on each node\.
58 .RE
59 .PP
60 \-q
61 .RS 4
62 Do not print node addresses\. Normally, onnode prints informational node addresses if more than one node is specified\. This overrides \-v\.
63 .RE
64 .PP
65 \-v
66 .RS 4
67 Print a node addresses even if only one node is specified\. Normally, onnode prints informational node addresses when more than one node is specified\.
68 .RE
69 .PP
70 \-h, \-\-help
71 .RS 4
72 Show a short usage guide\.
73 .RE
74 .SH "EXAMPLES"
75 .PP
76 The following command would show the process ID of ctdb on all nodes
77 .sp
78 .RS 4
79 .nf
80       onnode all pidof ctdbd
81     
82 .fi
83 .RE
84 .PP
85 The following command would show the last 5 lines of log on each node, preceded by the node\'s hostname
86 .sp
87 .RS 4
88 .nf
89       onnode all "hostname; tail \-5 /var/log/log\.ctdb"
90     
91 .fi
92 .RE
93 .PP
94 The following command would restart the ctdb service on all nodes\.
95 .sp
96 .RS 4
97 .nf
98       onnode all service ctdb restart
99     
100 .fi
101 .RE
102 .PP
103 The following command would run \./foo in the current working directory, in parallel, on nodes 0, 2, 3 and 4\.
104 .sp
105 .RS 4
106 .nf
107       onnode \-c \-p 0,2\-4 \./foo
108     
109 .fi
110 .RE
111 .SH "FILES"
112 .PP
113 /etc/ctdb/nodes
114 .RS 4
115 Contains a list of each node\'s IP address or hostname\.
116 .RE
117 .PP
118 /etc/ctdb/onnode\.conf
119 .RS 4
120 If this file exists it is sourced by onnode\. The main purpose is to allow the administrator to set $SSH to something other than "ssh"\. In this case the \-t option is ignored\. For example, the administrator may choose to use use rsh instead of ssh\.
121 .RE
122 .SH "SEE ALSO"
123 .PP
124 ctdbd(1), ctdb(1),
125 \fI\%http://ctdb.samba.org/\fR
126 .SH "COPYRIGHT/LICENSE"
127 .sp
128 .RS 4
129 .nf
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 .fi
147 .RE