.\" Title: \fBndb_config\fR
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.70.1
.\" Date: 05/02/2007
.\" Manual: MySQL Database System
.\" Source: MySQL 5.0
.\"
.TH "\fBNDB_CONFIG\fR" "1" "05/02/2007" "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\ 4.4.2, \(lqThe Cluster Connectstring\(rq, and defaults to
localhost:1186.
.sp
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
\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
\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
\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 1997\-2007 MySQL AB
.PP
This documentation is NOT distributed under a GPL license. Use of this documentation is subject to the following terms: You may create a printed copy of this documentation solely for your own personal use. Conversion to other formats is allowed as long as the actual content is not altered or edited in any way. You shall not publish or distribute this documentation in any form or on any media, except if you distribute the documentation in a manner similar to how MySQL disseminates it (that is, electronically for download on a Web site with the software) or on a CD\-ROM or similar medium, provided however that the documentation is disseminated together with the software on the same medium. Any other use, such as any dissemination of printed copies or use of this documentation, in whole or in part, in another publication, requires the prior written consent from an authorized representative of MySQL AB. MySQL AB reserves any and all rights to this documentation not expressly granted above.
.PP
Please email
for more information.
.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/).
This software comes with no warranty.