Author: jstephens
Date: 2006-10-03 12:55:27 +0200 (Tue, 03 Oct 2006)
New Revision: 3524
Log:
Documenting ndb_config utility, with some examples.
Modified:
trunk/refman-4.1/mysql-cluster.xml
trunk/refman-5.0/mysql-cluster.xml
trunk/refman-5.1/mysql-cluster.xml
Modified: trunk/refman-4.1/mysql-cluster.xml
===================================================================
--- trunk/refman-4.1/mysql-cluster.xml 2006-10-02 21:11:31 UTC (rev 3523)
+++ trunk/refman-4.1/mysql-cluster.xml 2006-10-03 10:55:27 UTC (rev 3524)
Changed blocks: 5, Lines Added: 301, Lines Deleted: 14; 11904 bytes
@@ -12830,6 +12830,10 @@
</indexterm>
<indexterm>
+ <primary><command>ndb_config</command></primary>
+ </indexterm>
+
+ <indexterm>
<primary><command>ndb_delete_all</command></primary>
</indexterm>
@@ -12910,14 +12914,12 @@
<itemizedlist>
-<!--
<listitem>
<para>
<command>ndb_config</command>: Retrieves Cluster configuration
options.
</para>
</listitem>
--->
<listitem>
<para>
@@ -13093,10 +13095,11 @@
<para>
<emphasis role="bold">Note</emphasis>: All of these utilities
- (except for <command>ndb_size.pl</command>) can use the options
- discussed in <xref linkend="mysql-cluster-command-options"/>.
- Additional options specific to each utility program are discussed
- in the individual program listings.
+ (except for <command>ndb_size.pl</command> and
+ <command>ndb_config</command>) can use the options discussed in
+ <xref linkend="mysql-cluster-command-options"/>. Additional
+ options specific to each utility program are discussed in the
+ individual program listings.
</para>
<para>
@@ -13126,15 +13129,15 @@
</listitem>
</itemizedlist>
+<section id="mysql-cluster-utilities-ndb-config">
-<!--
- <section id="mysql-cluster-utilities-ndb-config">
-
<title><command>ndb_config</command></title>
<para>
- <emphasis role="bold">Description</emphasis>: Prints cluster
- configuration data.
+ <emphasis role="bold">Description</emphasis>: This tool extracts
+ configuration information for data nodes, SQL nodes, and API nodes
+ from a cluster management node (and possibly its
+ <filename>config.ini</filename> file).
</para>
<para>
@@ -13142,15 +13145,299 @@
</para>
<programlisting>
-
+ndb_config <replaceable>options</replaceable>
</programlisting>
+
+ <para>
+ The <replaceable>options</replaceable> available for this utility
+ differ somewhat from those used with the other utilities, and so
+ are listed in their entireity in the next section, followed by
+ some examples.
+ </para>
<para>
- <emphasis role="bold">Additional Options</emphasis>:
+ <emphasis role="bold">Options</emphasis>:
</para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ <option>--usage</option>, <option>--help</option>, or
+ <option>-?</option>
+ </para>
+
+ <para>
+ Causes <command>ndb_config</command> to print a list of
+ available options, and then exit.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--version</option>, <option>-V</option>
+ </para>
+
+ <para>
+ Causes <command>ndb_config</command> to print a version
+ information string, and then exit.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--ndb-connectstring=<replaceable>connect_string</replaceable></option>
+ </para>
+
+ <para>
+ Specifies the <literal>connectstring</literal> to use in
+ connecting to the management server. The format for the
+ connectstring is the same as described in
+ <xref linkend="mysql-cluster-connectstring"/>, and defaults to
+ <literal>localhost:1186</literal>.
+ </para>
+
+ <para>
+ <emphasis role="bold">Note</emphasis>: The use of
+ <option>-c</option> as a short version for this option is not
+ currently supported with <command>ndb_config</command>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--config-file=<replaceable>path-to-file</replaceable></option>
+ </para>
+
+ <para>
+ Gives the path to the management server's configuration file
+ (<filename>config.ini</filename>). This may be a relative or
+ absolute path. If the management node resides on a different
+ host from the one on which <command>ndb_config</command> is
+ invoked, then an absolute path must be used.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--query=<replaceable>query-options</replaceable></option>,
+ <option>-q</option> <replaceable>query-options</replaceable>
+ </para>
+
+ <para>
+ This is a comma-delimited list of <firstterm>query
+ options</firstterm> — that is, a list of one or more
+ node attributes to be returned. These include
+ <literal>id</literal> (node ID), type
+ (node type — that is, <literal>ndbd</literal>,
+ <literal>mysqld</literal>, or <literal>ndb_mgmd</literal>),
+ and any configuration parameters whose values are to be
+ obtained.
+ </para>
+
+ <para>
+ For example,
+ <option>--query=id,type,indexmemory,datamemory</option> would
+ return the node ID, node type, <literal>DataMemory</literal>,
+ and <literal>IndexMemory</literal> for each node.
+ </para>
+
+ <para>
+ <emphasis role="bold">Note</emphasis>: 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.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--host=<replaceable>hostname</replaceable></option>
+ </para>
+
+ <para>
+ Specifies the hostname of the node for which configuration
+ information is to be obtained.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--id=<replaceable>node_id</replaceable></option>,
+ <option>--nodeid=<replaceable>node_id</replaceable></option>
+ </para>
+
+ <para>
+ Used to specify the node ID of the node for which
+ configuration information is to be obtained.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--nodes</option>
+ </para>
+
+ <para>
+ (Tells <command>ndb_config</command> to print information from
+ parameters defined in <literal>[ndbd]</literal> 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 <literal>[tcp]</literal> and other
+ sections of cluster configuration files.)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--type=<replaceable>node_type</replaceable></option>
+ </para>
+
+ <para>
+ Filters results so that only configuration values applying to
+ nodes of the specified <replaceable>node_type</replaceable>
+ (<literal>ndbd</literal>, <literal>mysqld</literal>, or
+ <literal>ndb_mgmd</literal>) are returned.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--fields=<replaceable>delimiter</replaceable></option>,
+ <option>-f</option> <replaceable>delimiter</replaceable>
+ </para>
+
+ <para>
+ Specifies a <replaceable>delimiter</replaceable> string used
+ to separate the fields in the result. The default is
+ <quote><literal>,</literal></quote> (the comma character).
+ </para>
+
+ <para>
+ <emphasis role="bold">Note</emphasis>: If the
+ <replaceable>delimiter</replaceable> contains spaces or
+ escapes (such as <literal>\n</literal> for the linefeed
+ character), then it must be quoted.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--rows=<replaceable>separator</replaceable></option>,
+ <option>-r</option> <replaceable>separator</replaceable>
+ </para>
+
+ <para>
+ Specifies a <replaceable>separator</replaceable> string used
+ to separate the rows in the result. The default is a space
+ character.
+ </para>
+
+ <para>
+ <emphasis role="bold">Note</emphasis>: If the
+ <replaceable>separator</replaceable> contains spaces or
+ escapes (such as <literal>\n</literal> for the linefeed
+ character), then it must be quoted.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <para>
+ <emphasis role="bold">Examples</emphasis>:
+ </para>
+
+ <orderedlist>
+ <listitem>
+ <para>
+ To obtain the node ID and type of each node in the cluster:
+ </para>
+
+<programlisting>
+shell> <userinput>./ndb_config --query=id,type --fields=':' --rows='\n'</userinput>
+1:ndbd
+2:ndbd
+3:ndbd
+4:ndbd
+5:ndb_mgmd
+6:mysqld
+7:mysqld
+8:mysqld
+9:mysqld
+</programlisting>
+
+ <para>
+ In this example, we used the <option>--fields</option> options
+ to separate the ID and type of each node with a colon
+ character (<literal>:</literal>), and the
+ <option>--rows</option> options to place the values for each
+ node on a new line in the output.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ To produce a connectstring that can be used by data, SQL, and
+ API nodes to connect to the management server:
+ </para>
+
+<programlisting>
+shell> <userinput>./ndb_config --config-file=usr/local/mysql/cluster-data/config.ini --query=hostname,portnumber --fields=: --rows=, --type=ndb_mgmd</userinput>
+192.168.0.179:1186
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ This invocation of <command>ndb_config</command> checks only
+ data nodes (using the <option>--type</option> option), and
+ shows the values for each node's ID and hostname, and its
+ <literal>DataMemory</literal>, <literal>IndexMemory</literal>,
+ and <literal>DataDir</literal> parameters:
+ </para>
+
+<programlisting>
+shell> <userinput>./ndb_config --type=ndbd --query=id,host,datamemory,indexmemory,datadir -f ' : ' -r '\n'</userinput>
+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
+</programlisting>
+
+ <para>
+ In this example, we used the short options <option>-f</option>
+ and <option>-r</option> for setting the field delimiter and
+ row separator, respectively.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ To exclude results from any host except one in particular, use
+ the <option>--host</option> option:
+ </para>
+
+<programlisting>
+shell> ./ndb_config --host=192.168.0.176 -f : -r '\n' -q id,type
+3:ndbd
+5:ndb_mgmd
+</programlisting>
+
+ <para>
+ In this example, we also used the short form
+ <option>-q</option> to determine the attributes to be queried.
+ </para>
+
+ <para>
+ Similarly, you can limit results to a node with a specific ID
+ using the <option>--id</option> or <option>--nodeid</option>
+ option.
+ </para>
+ </listitem>
+ </orderedlist>
+
+
</section>
--->
<section id="mysql-cluster-utilities-ndb-delete-all">
Modified: trunk/refman-5.0/mysql-cluster.xml
===================================================================
--- trunk/refman-5.0/mysql-cluster.xml 2006-10-02 21:11:31 UTC (rev 3523)
+++ trunk/refman-5.0/mysql-cluster.xml 2006-10-03 10:55:27 UTC (rev 3524)
Changed blocks: 5, Lines Added: 301, Lines Deleted: 14; 11904 bytes
@@ -12874,6 +12874,10 @@
</indexterm>
<indexterm>
+ <primary><command>ndb_config</command></primary>
+ </indexterm>
+
+ <indexterm>
<primary><command>ndb_delete_all</command></primary>
</indexterm>
@@ -12954,14 +12958,12 @@
<itemizedlist>
-<!--
<listitem>
<para>
<command>ndb_config</command>: Retrieves Cluster configuration
options.
</para>
</listitem>
--->
<listitem>
<para>
@@ -13137,10 +13139,11 @@
<para>
<emphasis role="bold">Note</emphasis>: All of these utilities
- (except for <command>ndb_size.pl</command>) can use the options
- discussed in <xref linkend="mysql-cluster-command-options"/>.
- Additional options specific to each utility program are discussed
- in the individual program listings.
+ (except for <command>ndb_size.pl</command> and
+ <command>ndb_config</command>) can use the options discussed in
+ <xref linkend="mysql-cluster-command-options"/>. Additional
+ options specific to each utility program are discussed in the
+ individual program listings.
</para>
<para>
@@ -13170,15 +13173,15 @@
</listitem>
</itemizedlist>
+<section id="mysql-cluster-utilities-ndb-config">
-<!--
- <section id="mysql-cluster-utilities-ndb-config">
-
<title><command>ndb_config</command></title>
<para>
- <emphasis role="bold">Description</emphasis>: Prints cluster
- configuration data.
+ <emphasis role="bold">Description</emphasis>: This tool extracts
+ configuration information for data nodes, SQL nodes, and API nodes
+ from a cluster management node (and possibly its
+ <filename>config.ini</filename> file).
</para>
<para>
@@ -13186,15 +13189,299 @@
</para>
<programlisting>
-
+ndb_config <replaceable>options</replaceable>
</programlisting>
+
+ <para>
+ The <replaceable>options</replaceable> available for this utility
+ differ somewhat from those used with the other utilities, and so
+ are listed in their entireity in the next section, followed by
+ some examples.
+ </para>
<para>
- <emphasis role="bold">Additional Options</emphasis>:
+ <emphasis role="bold">Options</emphasis>:
</para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ <option>--usage</option>, <option>--help</option>, or
+ <option>-?</option>
+ </para>
+
+ <para>
+ Causes <command>ndb_config</command> to print a list of
+ available options, and then exit.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--version</option>, <option>-V</option>
+ </para>
+
+ <para>
+ Causes <command>ndb_config</command> to print a version
+ information string, and then exit.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--ndb-connectstring=<replaceable>connect_string</replaceable></option>
+ </para>
+
+ <para>
+ Specifies the <literal>connectstring</literal> to use in
+ connecting to the management server. The format for the
+ connectstring is the same as described in
+ <xref linkend="mysql-cluster-connectstring"/>, and defaults to
+ <literal>localhost:1186</literal>.
+ </para>
+
+ <para>
+ <emphasis role="bold">Note</emphasis>: The use of
+ <option>-c</option> as a short version for this option is not
+ currently supported with <command>ndb_config</command>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--config-file=<replaceable>path-to-file</replaceable></option>
+ </para>
+
+ <para>
+ Gives the path to the management server's configuration file
+ (<filename>config.ini</filename>). This may be a relative or
+ absolute path. If the management node resides on a different
+ host from the one on which <command>ndb_config</command> is
+ invoked, then an absolute path must be used.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--query=<replaceable>query-options</replaceable></option>,
+ <option>-q</option> <replaceable>query-options</replaceable>
+ </para>
+
+ <para>
+ This is a comma-delimited list of <firstterm>query
+ options</firstterm> — that is, a list of one or more
+ node attributes to be returned. These include
+ <literal>id</literal> (node ID), type
+ (node type — that is, <literal>ndbd</literal>,
+ <literal>mysqld</literal>, or <literal>ndb_mgmd</literal>),
+ and any configuration parameters whose values are to be
+ obtained.
+ </para>
+
+ <para>
+ For example,
+ <option>--query=id,type,indexmemory,datamemory</option> would
+ return the node ID, node type, <literal>DataMemory</literal>,
+ and <literal>IndexMemory</literal> for each node.
+ </para>
+
+ <para>
+ <emphasis role="bold">Note</emphasis>: 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.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--host=<replaceable>hostname</replaceable></option>
+ </para>
+
+ <para>
+ Specifies the hostname of the node for which configuration
+ information is to be obtained.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--id=<replaceable>node_id</replaceable></option>,
+ <option>--nodeid=<replaceable>node_id</replaceable></option>
+ </para>
+
+ <para>
+ Used to specify the node ID of the node for which
+ configuration information is to be obtained.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--nodes</option>
+ </para>
+
+ <para>
+ (Tells <command>ndb_config</command> to print information from
+ parameters defined in <literal>[ndbd]</literal> 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 <literal>[tcp]</literal> and other
+ sections of cluster configuration files.)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--type=<replaceable>node_type</replaceable></option>
+ </para>
+
+ <para>
+ Filters results so that only configuration values applying to
+ nodes of the specified <replaceable>node_type</replaceable>
+ (<literal>ndbd</literal>, <literal>mysqld</literal>, or
+ <literal>ndb_mgmd</literal>) are returned.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--fields=<replaceable>delimiter</replaceable></option>,
+ <option>-f</option> <replaceable>delimiter</replaceable>
+ </para>
+
+ <para>
+ Specifies a <replaceable>delimiter</replaceable> string used
+ to separate the fields in the result. The default is
+ <quote><literal>,</literal></quote> (the comma character).
+ </para>
+
+ <para>
+ <emphasis role="bold">Note</emphasis>: If the
+ <replaceable>delimiter</replaceable> contains spaces or
+ escapes (such as <literal>\n</literal> for the linefeed
+ character), then it must be quoted.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--rows=<replaceable>separator</replaceable></option>,
+ <option>-r</option> <replaceable>separator</replaceable>
+ </para>
+
+ <para>
+ Specifies a <replaceable>separator</replaceable> string used
+ to separate the rows in the result. The default is a space
+ character.
+ </para>
+
+ <para>
+ <emphasis role="bold">Note</emphasis>: If the
+ <replaceable>separator</replaceable> contains spaces or
+ escapes (such as <literal>\n</literal> for the linefeed
+ character), then it must be quoted.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <para>
+ <emphasis role="bold">Examples</emphasis>:
+ </para>
+
+ <orderedlist>
+ <listitem>
+ <para>
+ To obtain the node ID and type of each node in the cluster:
+ </para>
+
+<programlisting>
+shell> <userinput>./ndb_config --query=id,type --fields=':' --rows='\n'</userinput>
+1:ndbd
+2:ndbd
+3:ndbd
+4:ndbd
+5:ndb_mgmd
+6:mysqld
+7:mysqld
+8:mysqld
+9:mysqld
+</programlisting>
+
+ <para>
+ In this example, we used the <option>--fields</option> options
+ to separate the ID and type of each node with a colon
+ character (<literal>:</literal>), and the
+ <option>--rows</option> options to place the values for each
+ node on a new line in the output.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ To produce a connectstring that can be used by data, SQL, and
+ API nodes to connect to the management server:
+ </para>
+
+<programlisting>
+shell> <userinput>./ndb_config --config-file=usr/local/mysql/cluster-data/config.ini --query=hostname,portnumber --fields=: --rows=, --type=ndb_mgmd</userinput>
+192.168.0.179:1186
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ This invocation of <command>ndb_config</command> checks only
+ data nodes (using the <option>--type</option> option), and
+ shows the values for each node's ID and hostname, and its
+ <literal>DataMemory</literal>, <literal>IndexMemory</literal>,
+ and <literal>DataDir</literal> parameters:
+ </para>
+
+<programlisting>
+shell> <userinput>./ndb_config --type=ndbd --query=id,host,datamemory,indexmemory,datadir -f ' : ' -r '\n'</userinput>
+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
+</programlisting>
+
+ <para>
+ In this example, we used the short options <option>-f</option>
+ and <option>-r</option> for setting the field delimiter and
+ row separator, respectively.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ To exclude results from any host except one in particular, use
+ the <option>--host</option> option:
+ </para>
+
+<programlisting>
+shell> ./ndb_config --host=192.168.0.176 -f : -r '\n' -q id,type
+3:ndbd
+5:ndb_mgmd
+</programlisting>
+
+ <para>
+ In this example, we also used the short form
+ <option>-q</option> to determine the attributes to be queried.
+ </para>
+
+ <para>
+ Similarly, you can limit results to a node with a specific ID
+ using the <option>--id</option> or <option>--nodeid</option>
+ option.
+ </para>
+ </listitem>
+ </orderedlist>
+
+
</section>
--->
<section id="mysql-cluster-utilities-ndb-delete-all">
Modified: trunk/refman-5.1/mysql-cluster.xml
===================================================================
--- trunk/refman-5.1/mysql-cluster.xml 2006-10-02 21:11:31 UTC (rev 3523)
+++ trunk/refman-5.1/mysql-cluster.xml 2006-10-03 10:55:27 UTC (rev 3524)
Changed blocks: 5, Lines Added: 304, Lines Deleted: 16; 11923 bytes
@@ -12798,6 +12798,10 @@
</indexterm>
<indexterm>
+ <primary><command>ndb_config</command></primary>
+ </indexterm>
+
+ <indexterm>
<primary><command>ndb_delete_all</command></primary>
</indexterm>
@@ -12881,15 +12885,13 @@
</para>
<itemizedlist>
-
-<!--
+
<listitem>
<para>
<command>ndb_config</command>: Retrieves Cluster configuration
- options.
+ option values.
</para>
- </listitem>
--->
+ </listitem>
<listitem>
<para>
@@ -13065,10 +13067,11 @@
<para>
<emphasis role="bold">Note</emphasis>: All of these utilities
- (except for <command>ndb_size.pl</command>) can use the options
- discussed in <xref linkend="mysql-cluster-command-options"/>.
- Additional options specific to each utility program are discussed
- in the individual program listings.
+ (except for <command>ndb_size.pl</command> and
+ <command>ndb_config</command>) can use the options discussed in
+ <xref linkend="mysql-cluster-command-options"/>. Additional
+ options specific to each utility program are discussed in the
+ individual program listings.
</para>
<para>
@@ -13098,15 +13101,16 @@
</listitem>
</itemizedlist>
-
-<!--
+
<section id="mysql-cluster-utilities-ndb-config">
<title><command>ndb_config</command></title>
<para>
- <emphasis role="bold">Description</emphasis>: Prints cluster
- configuration data.
+ <emphasis role="bold">Description</emphasis>: This tool extracts
+ configuration information for data nodes, SQL nodes, and API nodes
+ from a cluster management node (and possibly its
+ <filename>config.ini</filename> file).
</para>
<para>
@@ -13114,15 +13118,299 @@
</para>
<programlisting>
-
+ndb_config <replaceable>options</replaceable>
</programlisting>
+
+ <para>
+ The <replaceable>options</replaceable> available for this utility
+ differ somewhat from those used with the other utilities, and so
+ are listed in their entireity in the next section, followed by
+ some examples.
+ </para>
<para>
- <emphasis role="bold">Additional Options</emphasis>:
+ <emphasis role="bold">Options</emphasis>:
</para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ <option>--usage</option>, <option>--help</option>, or
+ <option>-?</option>
+ </para>
+
+ <para>
+ Causes <command>ndb_config</command> to print a list of
+ available options, and then exit.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--version</option>, <option>-V</option>
+ </para>
+
+ <para>
+ Causes <command>ndb_config</command> to print a version
+ information string, and then exit.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--ndb-connectstring=<replaceable>connect_string</replaceable></option>
+ </para>
+
+ <para>
+ Specifies the <literal>connectstring</literal> to use in
+ connecting to the management server. The format for the
+ connectstring is the same as described in
+ <xref linkend="mysql-cluster-connectstring"/>, and defaults to
+ <literal>localhost:1186</literal>.
+ </para>
+
+ <para>
+ <emphasis role="bold">Note</emphasis>: The use of
+ <option>-c</option> as a short version for this option is not
+ currently supported with <command>ndb_config</command>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--config-file=<replaceable>path-to-file</replaceable></option>
+ </para>
+
+ <para>
+ Gives the path to the management server's configuration file
+ (<filename>config.ini</filename>). This may be a relative or
+ absolute path. If the management node resides on a different
+ host from the one on which <command>ndb_config</command> is
+ invoked, then an absolute path must be used.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--query=<replaceable>query-options</replaceable></option>,
+ <option>-q</option> <replaceable>query-options</replaceable>
+ </para>
+
+ <para>
+ This is a comma-delimited list of <firstterm>query
+ options</firstterm> — that is, a list of one or more
+ node attributes to be returned. These include
+ <literal>id</literal> (node ID), type
+ (node type — that is, <literal>ndbd</literal>,
+ <literal>mysqld</literal>, or <literal>ndb_mgmd</literal>),
+ and any configuration parameters whose values are to be
+ obtained.
+ </para>
+
+ <para>
+ For example,
+ <option>--query=id,type,indexmemory,datamemory</option> would
+ return the node ID, node type, <literal>DataMemory</literal>,
+ and <literal>IndexMemory</literal> for each node.
+ </para>
+
+ <para>
+ <emphasis role="bold">Note</emphasis>: 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.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--host=<replaceable>hostname</replaceable></option>
+ </para>
+
+ <para>
+ Specifies the hostname of the node for which configuration
+ information is to be obtained.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--id=<replaceable>node_id</replaceable></option>,
+ <option>--nodeid=<replaceable>node_id</replaceable></option>
+ </para>
+
+ <para>
+ Used to specify the node ID of the node for which
+ configuration information is to be obtained.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--nodes</option>
+ </para>
+
+ <para>
+ (Tells <command>ndb_config</command> to print information from
+ parameters defined in <literal>[ndbd]</literal> 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 <literal>[tcp]</literal> and other
+ sections of cluster configuration files.)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--type=<replaceable>node_type</replaceable></option>
+ </para>
+
+ <para>
+ Filters results so that only configuration values applying to
+ nodes of the specified <replaceable>node_type</replaceable>
+ (<literal>ndbd</literal>, <literal>mysqld</literal>, or
+ <literal>ndb_mgmd</literal>) are returned.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--fields=<replaceable>delimiter</replaceable></option>,
+ <option>-f</option> <replaceable>delimiter</replaceable>
+ </para>
+
+ <para>
+ Specifies a <replaceable>delimiter</replaceable> string used
+ to separate the fields in the result. The default is
+ <quote><literal>,</literal></quote> (the comma character).
+ </para>
+
+ <para>
+ <emphasis role="bold">Note</emphasis>: If the
+ <replaceable>delimiter</replaceable> contains spaces or
+ escapes (such as <literal>\n</literal> for the linefeed
+ character), then it must be quoted.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <option>--rows=<replaceable>separator</replaceable></option>,
+ <option>-r</option> <replaceable>separator</replaceable>
+ </para>
+
+ <para>
+ Specifies a <replaceable>separator</replaceable> string used
+ to separate the rows in the result. The default is a space
+ character.
+ </para>
+
+ <para>
+ <emphasis role="bold">Note</emphasis>: If the
+ <replaceable>separator</replaceable> contains spaces or
+ escapes (such as <literal>\n</literal> for the linefeed
+ character), then it must be quoted.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <para>
+ <emphasis role="bold">Examples</emphasis>:
+ </para>
+
+ <orderedlist>
+ <listitem>
+ <para>
+ To obtain the node ID and type of each node in the cluster:
+ </para>
+
+<programlisting>
+shell> <userinput>./ndb_config --query=id,type --fields=':' --rows='\n'</userinput>
+1:ndbd
+2:ndbd
+3:ndbd
+4:ndbd
+5:ndb_mgmd
+6:mysqld
+7:mysqld
+8:mysqld
+9:mysqld
+</programlisting>
+
+ <para>
+ In this example, we used the <option>--fields</option> options
+ to separate the ID and type of each node with a colon
+ character (<literal>:</literal>), and the
+ <option>--rows</option> options to place the values for each
+ node on a new line in the output.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ To produce a connectstring that can be used by data, SQL, and
+ API nodes to connect to the management server:
+ </para>
+
+<programlisting>
+shell> <userinput>./ndb_config --config-file=usr/local/mysql/cluster-data/config.ini --query=hostname,portnumber --fields=: --rows=, --type=ndb_mgmd</userinput>
+192.168.0.179:1186
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ This invocation of <command>ndb_config</command> checks only
+ data nodes (using the <option>--type</option> option), and
+ shows the values for each node's ID and hostname, and its
+ <literal>DataMemory</literal>, <literal>IndexMemory</literal>,
+ and <literal>DataDir</literal> parameters:
+ </para>
+
+<programlisting>
+shell> <userinput>./ndb_config --type=ndbd --query=id,host,datamemory,indexmemory,datadir -f ' : ' -r '\n'</userinput>
+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
+</programlisting>
+
+ <para>
+ In this example, we used the short options <option>-f</option>
+ and <option>-r</option> for setting the field delimiter and
+ row separator, respectively.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ To exclude results from any host except one in particular, use
+ the <option>--host</option> option:
+ </para>
+
+<programlisting>
+shell> ./ndb_config --host=192.168.0.176 -f : -r '\n' -q id,type
+3:ndbd
+5:ndb_mgmd
+</programlisting>
+
+ <para>
+ In this example, we also used the short form
+ <option>-q</option> to determine the attributes to be queried.
+ </para>
+
+ <para>
+ Similarly, you can limit results to a node with a specific ID
+ using the <option>--id</option> or <option>--nodeid</option>
+ option.
+ </para>
+ </listitem>
+ </orderedlist>
+
+
</section>
--->
<section id="mysql-cluster-utilities-ndb-delete-all">
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r3524 - in trunk: refman-4.1 refman-5.0 refman-5.1 | jon | 3 Oct |