1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
|
.\" Title: \fBndb_config\fR
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
.\" Date: 01/11/2008
.\" Manual: MySQL Database System
.\" Source: MySQL 5.0
.\"
.TH "\fBNDB_CONFIG\fR" "1" "01/11/2008" "MySQL 5.0" "MySQL Database System"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
ndb_config \- extract NDB configuration information
.SH "SYNOPSIS"
.HP 19
\fBndb_config \fR\fB\fIoptions\fR\fR
.SH "DESCRIPTION"
.PP
This tool extracts configuration information for data nodes, SQL nodes, and API nodes from a cluster management node (and possibly its
\fIconfig.ini\fR
file).
.PP
\fBUsage\fR:
.sp
.RS 3n
.nf
ndb_config \fIoptions\fR
.fi
.RE
.PP
The
\fIoptions\fR
available for this utility differ somewhat from those used with the other utilities, and so are listed in their entirety in the next section, followed by some examples.
.PP
\fBOptions\fR:
.TP 3n
\(bu
\fB\-\-usage\fR,
\fB\-\-help\fR, or
\fB\-?\fR
.sp
Causes
\fBndb_config\fR
to print a list of available options, and then exit.
.TP 3n
\(bu
\fB\-\-version\fR,
\fB\-V\fR
.sp
Causes
\fBndb_config\fR
to print a version information string, and then exit.
.TP 3n
\(bu
\fB\-\-ndb\-connectstring=\fR\fB\fIconnect_string\fR\fR
.sp
Specifies the connectstring to use in connecting to the management server. The format for the connectstring is the same as described in
Section\ 3.4.2, \(lqThe Cluster Connectstring\(rq, and defaults to
localhost:1186.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
\fBNote\fR
The use of
\fB\-c\fR
as a short version for this option is supported for
\fBndb_config\fR
beginning with MySQL 5.0.29.
.TP 3n
\(bu
\fB\-\-config\-file=\fR\fB\fIpath\-to\-file\fR\fR
.sp
Gives the path to the management server's configuration file (\fIconfig.ini\fR). This may be a relative or absolute path. If the management node resides on a different host from the one on which
\fBndb_config\fR
is invoked, then an absolute path must be used.
.TP 3n
\(bu
\fB\-\-query=\fR\fB\fIquery\-options\fR\fR,
\fB\-q\fR
\fIquery\-options\fR
.sp
This is a comma\-delimited list of
query options
\(em that is, a list of one or more node attributes to be returned. These include
id
(node ID), type (node type \(em that is,
ndbd,
mysqld, or
ndb_mgmd), and any configuration parameters whose values are to be obtained.
.sp
For example,
\fB\-\-query=id,type,indexmemory,datamemory\fR
would return the node ID, node type,
DataMemory, and
IndexMemory
for each node.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
\fBNote\fR
If a given parameter is not applicable to a certain type of node, than an empty string is returned for the corresponding value. See the examples later in this section for more information.
.TP 3n
\(bu
\fB\-\-host=\fR\fB\fIhostname\fR\fR
.sp
Specifies the hostname of the node for which configuration information is to be obtained.
.TP 3n
\(bu
\fB\-\-id=\fR\fB\fInode_id\fR\fR,
\fB\-\-nodeid=\fR\fB\fInode_id\fR\fR
.sp
Used to specify the node ID of the node for which configuration information is to be obtained.
.TP 3n
\(bu
\fB\-\-nodes\fR
.sp
(Tells
\fBndb_config\fR
to print information from parameters defined in
[ndbd]
sections only. Currently, using this option has no affect, since these are the only values checked, but it may become possible in future to query parameters set in
[tcp]
and other sections of cluster configuration files.)
.TP 3n
\(bu
\fB\-\-type=\fR\fB\fInode_type\fR\fR
.sp
Filters results so that only configuration values applying to nodes of the specified
\fInode_type\fR
(ndbd,
mysqld, or
ndb_mgmd) are returned.
.TP 3n
\(bu
\fB\-\-fields=\fR\fB\fIdelimiter\fR\fR,
\fB\-f\fR
\fIdelimiter\fR
.sp
Specifies a
\fIdelimiter\fR
string used to separate the fields in the result. The default is
\(lq,\(rq
(the comma character).
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
\fBNote\fR
If the
\fIdelimiter\fR
contains spaces or escapes (such as
\\n
for the linefeed character), then it must be quoted.
.TP 3n
\(bu
\fB\-\-rows=\fR\fB\fIseparator\fR\fR,
\fB\-r\fR
\fIseparator\fR
.sp
Specifies a
\fIseparator\fR
string used to separate the rows in the result. The default is a space character.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
\fBNote\fR
If the
\fIseparator\fR
contains spaces or escapes (such as
\\n
for the linefeed character), then it must be quoted.
.sp
.RE
.PP
\fBExamples\fR:
.TP 3n
1.
To obtain the node ID and type of each node in the cluster:
.sp
.RS 3n
.nf
shell> \fB./ndb_config \-\-query=id,type \-\-fields=':' \-\-rows='\\n'\fR
1:ndbd
2:ndbd
3:ndbd
4:ndbd
5:ndb_mgmd
6:mysqld
7:mysqld
8:mysqld
9:mysqld
.fi
.RE
In this example, we used the
\fB\-\-fields\fR
options to separate the ID and type of each node with a colon character (:), and the
\fB\-\-rows\fR
options to place the values for each node on a new line in the output.
.TP 3n
2.
To produce a connectstring that can be used by data, SQL, and API nodes to connect to the management server:
.sp
.RS 3n
.nf
shell> \fB./ndb_config \-\-config\-file=usr/local/mysql/cluster\-data/config.ini \-\-query=hostname,portnumber \-\-fields=: \-\-rows=, \-\-type=ndb_mgmd\fR
192.168.0.179:1186
.fi
.RE
.TP 3n
3.
This invocation of
\fBndb_config\fR
checks only data nodes (using the
\fB\-\-type\fR
option), and shows the values for each node's ID and hostname, and its
DataMemory,
IndexMemory, and
DataDir
parameters:
.sp
.RS 3n
.nf
shell> \fB./ndb_config \-\-type=ndbd \-\-query=id,host,datamemory,indexmemory,datadir \-f ' : ' \-r '\\n'\fR
1 : 192.168.0.193 : 83886080 : 18874368 : /usr/local/mysql/cluster\-data
2 : 192.168.0.112 : 83886080 : 18874368 : /usr/local/mysql/cluster\-data
3 : 192.168.0.176 : 83886080 : 18874368 : /usr/local/mysql/cluster\-data
4 : 192.168.0.119 : 83886080 : 18874368 : /usr/local/mysql/cluster\-data
.fi
.RE
In this example, we used the short options
\fB\-f\fR
and
\fB\-r\fR
for setting the field delimiter and row separator, respectively.
.TP 3n
4.
To exclude results from any host except one in particular, use the
\fB\-\-host\fR
option:
.sp
.RS 3n
.nf
shell> \fB./ndb_config \-\-host=192.168.0.176 \-f : \-r '\\n' \-q id,type\fR
3:ndbd
5:ndb_mgmd
.fi
.RE
In this example, we also used the short form
\fB\-q\fR
to determine the attributes to be queried.
.sp
Similarly, you can limit results to a node with a specific ID using the
\fB\-\-id\fR
or
\fB\-\-nodeid\fR
option.
.SH "COPYRIGHT"
.PP
Copyright 2007\-2008 MySQL AB
.PP
This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110\-1301 USA or see http://www.gnu.org/licenses/.
.SH "SEE ALSO"
For more information, please refer to the MySQL Reference Manual,
which may already be installed locally and which is also available
online at http://dev.mysql.com/doc/.
.SH AUTHOR
MySQL AB (http://www.mysql.com/).
|