Rechercher dans le manuel MySQL
This tool extracts current configuration information for data
nodes, SQL nodes, and API nodes from one of a number of sources:
an NDB Cluster management node, or its
config.ini
or my.cnf
file. By default, the management node is the source for the
configuration data; to override the default, execute ndb_config
with the --config-file
or
--mycnf
option. It is also
possible to use a data node as the source by specifying its node
ID with
--config_from_node=
.
node_id
ndb_config can also provide an offline dump
of all configuration parameters which can be used, along with
their default, maximum, and minimum values and other
information. The dump can be produced in either text or XML
format; for more information, see the discussion of the
--configinfo
and
--xml
options later in this
section).
You can filter the results by section (DB
,
SYSTEM
, or CONNECTIONS
)
using one of the options
--nodes
,
--system
, or
--connections
.
The following table includes options that are specific to ndb_config. Additional descriptions follow the table. For options common to most NDB Cluster programs (including ndb_config), see Section 22.4.31, “Options Common to NDB Cluster Programs — Options Common to NDB Cluster Programs”.
Table 22.339 Command-line options for the ndb_config program
Format | Description | Added, Deprecated, or Removed |
---|---|---|
Set the path to config.ini file | All NDB 8.0 releases |
|
Obtain configuration data from the node having this ID (must be a data node). | All NDB 8.0 releases |
|
Dumps information about all NDB configuration parameters in text format with default, maximum, and minimum values. Use with --xml to obtain XML output. | All NDB 8.0 releases |
|
Print connections information ([tcp], [tcp default], [sci], [sci default], [shm], or [shm default] sections of cluster configuration file) only. Cannot be used with --system or --nodes. | All NDB 8.0 releases |
|
Print only configuration parameters that have non-default values | All NDB 8.0 releases |
|
Field separator | All NDB 8.0 releases |
|
Specify host | All NDB 8.0 releases |
|
Read configuration data from my.cnf file | All NDB 8.0 releases |
|
Get configuration of node with this ID | All NDB 8.0 releases |
|
Print node information ([ndbd] or [ndbd default] section of cluster configuration file) only. Cannot be used with --system or --connections. | All NDB 8.0 releases |
|
Short form for --ndb-connectstring | All NDB 8.0 releases |
|
One or more query options (attributes) | All NDB 8.0 releases |
|
Dumps all parameters and values to a single comma-delimited string. | All NDB 8.0 releases |
|
Row separator | All NDB 8.0 releases |
|
Print SYSTEM section information only (see ndb_config --configinfo output). Cannot be used with --nodes or --connections. | All NDB 8.0 releases |
|
Specify node type | All NDB 8.0 releases |
|
Use --xml with --configinfo to obtain a dump of all NDB configuration parameters in XML format with default, maximum, and minimum values. | All NDB 8.0 releases |
The
--configinfo
option causes ndb_config to dump a list of each NDB Cluster configuration parameter supported by the NDB Cluster distribution of which ndb_config is a part, including the following information:A brief description of each parameter's purpose, effects, and usage
The section of the
config.ini
file where the parameter may be usedThe parameter's data type or unit of measurement
Where applicable, the parameter's default, minimum, and maximum values
NDB Cluster release version and build information
By default, this output is in text format. Part of this output is shown here:
shell> ndb_config --configinfo ****** SYSTEM ****** Name (String) Name of system (NDB Cluster) MANDATORY PrimaryMGMNode (Non-negative Integer) Node id of Primary ndb_mgmd(MGM) node Default: 0 (Min: 0, Max: 4294967039) ConfigGenerationNumber (Non-negative Integer) Configuration generation number Default: 0 (Min: 0, Max: 4294967039) ****** DB ****** MaxNoOfSubscriptions (Non-negative Integer) Max no of subscriptions (default 0 == MaxNoOfTables) Default: 0 (Min: 0, Max: 4294967039) MaxNoOfSubscribers (Non-negative Integer) Max no of subscribers (default 0 == 2 * MaxNoOfTables) Default: 0 (Min: 0, Max: 4294967039) …
Use this option together with the
--xml
option to obtain output in XML format.-
Property Value Command-Line Format --config-file=file_name
Type File name Default Value Gives the path to the management server's configuration file (
config.ini
). This may be a relative or absolute path. If the management node resides on a different host from the one on which ndb_config is invoked, then an absolute path must be used. -
Property Value Command-Line Format --config-from-node=#
Type Numeric Default Value none
Minimum Value 1
Maximum Value 48
Obtain the cluster's configuration data from the data node that has this ID.
If the node having this ID is not a data node, ndb_config fails with an error. (To obtain configuration data from the management node instead, simply omit this option.)
-
Property Value Command-Line Format --connections
Type Boolean Default Value FALSE
Tells ndb_config to print
CONNECTIONS
information only—that is, information about parameters found in the[tcp]
,[tcp default]
,[sci]
,[sci default]
,[shm]
, or[shm default]
sections of the cluster configuration file (see Section 22.3.3.10, “NDB Cluster TCP/IP Connections”, Section 22.3.3.13, “SCI Transport Connections in NDB Cluster”, and Section 22.3.3.12, “NDB Cluster Shared-Memory Connections”, for more information).This option is mutually exclusive with
--nodes
and--system
; only one of these 3 options can be used. -
Property Value Command-Line Format --diff-default
Type Boolean Default Value FALSE
Print only configuration parameters that have non-default values.
--fields=
,delimiter
-f
delimiter
Property Value Command-Line Format --fields=string
Type String Default Value Specifies a
delimiter
string used to separate the fields in the result. The default is,
(the comma character).NoteIf the
delimiter
contains spaces or escapes (such as\n
for the linefeed character), then it must be quoted.-
Property Value Command-Line Format --host=name
Type String Default Value Specifies the host name of the node for which configuration information is to be obtained.
NoteWhile the hostname
localhost
usually resolves to the IP address127.0.0.1
, this may not necessarily be true for all operating platforms and configurations. This means that it is possible, whenlocalhost
is used inconfig.ini
, for ndb_config--host=localhost
to fail if ndb_config is run on a different host wherelocalhost
resolves to a different address (for example, on some versions of SUSE Linux, this is127.0.0.2
). In general, for best results, you should use numeric IP addresses for all NDB Cluster configuration values relating to hosts, or verify that all NDB Cluster hosts handlelocalhost
in the same fashion. -
Property Value Command-Line Format --mycnf
Type Boolean Default Value FALSE
Read configuration data from the
my.cnf
file. --ndb-connectstring=
,connection_string
-c
connection_string
Property Value Command-Line Format --ndb-connectstring=connectstring
--connect-string=connectstring
Type String Default Value localhost:1186
Specifies the connection string to use in connecting to the management server. The format for the connection string is the same as described in Section 22.3.3.3, “NDB Cluster Connection Strings”, and defaults to
localhost:1186
.-
Property Value Command-Line Format --ndb-nodeid=#
Type Numeric Default Value 0
Specify the node ID of the node for which configuration information is to be obtained.
-
Property Value Command-Line Format --nodes
Type Boolean Default Value FALSE
Tells ndb_config to print information relating only to parameters defined in an
[ndbd]
or[ndbd default]
section of the cluster configuration file (see Section 22.3.3.6, “Defining NDB Cluster Data Nodes”).This option is mutually exclusive with
--connections
and--system
; only one of these 3 options can be used. --query=
,query-options
-q
query-options
Property Value Command-Line Format --query=string
Type String Default Value This is a comma-delimited list of query options—that is, a list of one or more node attributes to be returned. These include
nodeid
(node ID), type (node type—that is,ndbd
,mysqld
, orndb_mgmd
), and any configuration parameters whose values are to be obtained.For example,
--query=nodeid,type,datamemory,datadir
returns the node ID, node type,DataMemory
, andDataDir
for each node.NoteIf 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.
-
Property Value Command-Line Format --query-all
Type String Default Value Returns a comma-delimited list of all query options (node attributes; note that this list is a single string.
--rows=
,separator
-r
separator
Property Value Command-Line Format --rows=string
Type String Default Value Specifies a
separator
string used to separate the rows in the result. The default is a space character.NoteIf the
separator
contains spaces or escapes (such as\n
for the linefeed character), then it must be quoted.-
Property Value Command-Line Format --system
Type Boolean Default Value FALSE
Tells ndb_config to print
SYSTEM
information only. This consists of system variables that cannot be changed at run time; thus, there is no corresponding section of the cluster configuration file for them. They can be seen (prefixed with****** SYSTEM ******
) in the output of ndb_config--configinfo
.This option is mutually exclusive with
--nodes
and--connections
; only one of these 3 options can be used. -
Property Value Command-Line Format --type=name
Type Enumeration Default Value [none]
Valid Values ndbd
mysqld
ndb_mgmd
Filters results so that only configuration values applying to nodes of the specified
node_type
(ndbd
,mysqld
, orndb_mgmd
) are returned. -
Property Value Command-Line Format --help
--usage
Causes ndb_config to print a list of available options, and then exit.
-
Property Value Command-Line Format --version
Causes ndb_config to print a version information string, and then exit.
-
Property Value Command-Line Format --configinfo --xml
Type Boolean Default Value false
Cause ndb_config
--configinfo
to provide output as XML by adding this option. A portion of such output is shown in this example:shell> ndb_config --configinfo --xml <configvariables protocolversion="1" ndbversionstring="5.7.27-ndb-7.5.16" ndbversion="460032" ndbversionmajor="7" ndbversionminor="5" ndbversionbuild="0"> <section name="SYSTEM"> <param name="Name" comment="Name of system (NDB Cluster)" type="string" mandatory="true"/> <param name="PrimaryMGMNode" comment="Node id of Primary ndb_mgmd(MGM) node" type="unsigned" default="0" min="0" max="4294967039"/> <param name="ConfigGenerationNumber" comment="Configuration generation number" type="unsigned" default="0" min="0" max="4294967039"/> </section> <section name="MYSQLD" primarykeys="NodeId"> <param name="wan" comment="Use WAN TCP setting as default" type="bool" default="false"/> <param name="HostName" comment="Name of computer for this node" type="string" default=""/> <param name="Id" comment="NodeId" type="unsigned" mandatory="true" min="1" max="255" deprecated="true"/> <param name="NodeId" comment="Number identifying application node (mysqld(API))" type="unsigned" mandatory="true" min="1" max="255"/> <param name="ExecuteOnComputer" comment="HostName" type="string" deprecated="true"/> … </section> … </configvariables>
NoteNormally, the XML output produced by ndb_config
--configinfo
--xml
is formatted using one line per element; we have added extra whitespace in the previous example, as well as the next one, for reasons of legibility. This should not make any difference to applications using this output, since most XML processors either ignore nonessential whitespace as a matter of course, or can be instructed to do so.The XML output also indicates when changing a given parameter requires that data nodes be restarted using the
--initial
option. This is shown by the presence of aninitial="true"
attribute in the corresponding<param>
element. In addition, the restart type (system
ornode
) is also shown; if a given parameter requires a system restart, this is indicated by the presence of arestart="system"
attribute in the corresponding<param>
element. For example, changing the value set for theDiskless
parameter requires a system initial restart, as shown here (with therestart
andinitial
attributes highlighted for visibility):<param name="Diskless" comment="Run wo/ disk" type="bool" default="false" restart="system" initial="true"/>
Currently, no
initial
attribute is included in the XML output for<param>
elements corresponding to parameters which do not require initial restarts; in other words,initial="false"
is the default, and the valuefalse
should be assumed if the attribute is not present. Similarly, the default restart type isnode
(that is, an online or “rolling” restart of the cluster), but therestart
attribute is included only if the restart type issystem
(meaning that all cluster nodes must be shut down at the same time, then restarted).Deprecated parameters are indicated in the XML output by the
deprecated
attribute, as shown here:<param name="NoOfDiskPagesToDiskAfterRestartACC" comment="DiskCheckpointSpeed" type="unsigned" default="20" min="1" max="4294967039" deprecated="true"/>
In such cases, the
comment
refers to one or more parameters that supersede the deprecated parameter. Similarly toinitial
, thedeprecated
attribute is indicated only when the parameter is deprecated, withdeprecated="true"
, and does not appear at all for parameters which are not deprecated. (Bug #21127135)Beginning with NDB 7.5.0, parameters that are required are indicated with
mandatory="true"
, as shown here:<param name="NodeId" comment="Number identifying application node (mysqld(API))" type="unsigned" mandatory="true" min="1" max="255"/>
In much the same way that the
initial
ordeprecated
attribute is displayed only for a parameter that requires an intial restart or that is deprecated, themandatory
attribute is included only if the given parameter is actually required.ImportantThe
--xml
option can be used only with the--configinfo
option. Using--xml
without--configinfo
fails with an error.Unlike the options used with this program to obtain current configuration data,
--configinfo
and--xml
use information obtained from the NDB Cluster sources when ndb_config was compiled. For this reason, no connection to a running NDB Cluster or access to aconfig.ini
ormy.cnf
file is required for these two options.
Combining other ndb_config options (such as
--query
or
--type
) with
--configinfo
(with or without the
--xml
option is not supported. Currently, if
you attempt to do so, the usual result is that all other options
besides --configinfo
or --xml
are simply ignored. However, this behavior is not
guaranteed and is subject to change at any time. In
addition, since ndb_config, when used with
the --configinfo
option, does not access the
NDB Cluster or read any files, trying to specify additional
options such as --ndb-connectstring
or
--config-file
with
--configinfo
serves no purpose.
Examples
To obtain the node ID and type of each node in the cluster:
shell> ./ndb_config --query=nodeid,type --fields=':' --rows='\n' 1:ndbd 2:ndbd 3:ndbd 4:ndbd 5:ndb_mgmd 6:mysqld 7:mysqld 8:mysqld 9:mysqld
In this example, we used the
--fields
options to separate the ID and type of each node with a colon character (:
), and the--rows
options to place the values for each node on a new line in the output.To produce a connection string that can be used by data, SQL, and API nodes to connect to the management server:
shell> ./ndb_config --config-file=usr/local/mysql/cluster-data/config.ini \ --query=hostname,portnumber --fields=: --rows=, --type=ndb_mgmd 198.51.100.179:1186
This invocation of ndb_config checks only data nodes (using the
--type
option), and shows the values for each node's ID and host name, as well as the values set for itsDataMemory
andDataDir
parameters:shell> ./ndb_config --type=ndbd --query=nodeid,host,datamemory,datadir -f ' : ' -r '\n' 1 : 198.51.100.193 : 83886080 : /usr/local/mysql/cluster-data 2 : 198.51.100.112 : 83886080 : /usr/local/mysql/cluster-data 3 : 198.51.100.176 : 83886080 : /usr/local/mysql/cluster-data 4 : 198.51.100.119 : 83886080 : /usr/local/mysql/cluster-data
In this example, we used the short options
-f
and-r
for setting the field delimiter and row separator, respectively, as well as the short option-q
to pass a list of parameters to be obtained.To exclude results from any host except one in particular, use the
--host
option:shell> ./ndb_config --host=198.51.100.176 -f : -r '\n' -q id,type 3:ndbd 5:ndb_mgmd
In this example, we also used the short form
-q
to determine the attributes to be queried.Similarly, you can limit results to a node with a specific ID using the
--nodeid
option.
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 26/06/2006 gemaakt, de laatste keer de 26/10/2018 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/mysql-rf-mysql-cluster-programs-ndb-config.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.