Menu:
mysql-cluster-programs-ndb-waiter:: ndb_waiter -- Wait for NDB Cluster to Reach a Given Status
Using and managing an NDB Cluster requires several specialized programs, which we describe in this chapter. We discuss the purposes of these programs in an NDB Cluster, how to use the programs, and what startup options are available for each of them.
These programs include the NDB Cluster data, management, and SQL node processes (note 'ndbd': mysql-cluster-programs-ndbd, note 'ndbmtd': mysql-cluster-programs-ndbmtd, note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd, and note 'mysqld': mysqld.) and the management client (*note 'ndb_mgm': mysql-cluster-programs-ndb-mgm.).
For information about using note 'mysqld': mysqld. as an NDB Cluster process, see note mysql-cluster-mysqld::.
Other note 'NDB': mysql-cluster. utility, diagnostic, and example programs are included with the NDB Cluster distribution. These include note 'ndb_restore': mysql-cluster-programs-ndb-restore, note 'ndb_show_tables': mysql-cluster-programs-ndb-show-tables, and note 'ndb_config': mysql-cluster-programs-ndb-config. These programs are also covered in this section.
The final portion of this section contains tables of options that are common to all the various NDB Cluster programs.
File: manual.info.tmp, Node: mysql-cluster-programs-ndbd, Next: mysql-cluster-programs-ndbinfo-select-all, Prev: mysql-cluster-programs, Up: mysql-cluster-programs
The note 'ndbd': mysql-cluster-programs-ndbd. binary provides the single-threaded version of the process that is used to handle all the data in tables employing the 'NDBCLUSTER' storage engine. This data node process enables a data node to accomplish distributed transaction handling, node recovery, checkpointing to disk, online backup, and related tasks. In NDB 7.6.31 and later, when started, note 'ndbd': mysql-cluster-programs-ndbd. logs a warning similar to that shown here:
2024-05-28 13:32:16 [ndbd] WARNING -- Running ndbd with a single thread of
signal execution. For multi-threaded signal execution run the ndbmtd binary.
*note 'ndbmtd': mysql-cluster-programs-ndbmtd. is the multi-threaded version of this binary.
In an NDB Cluster, a set of *note 'ndbd': mysql-cluster-programs-ndbd. processes cooperate in handling data. These processes can execute on the same computer (host) or on different computers. The correspondences between data nodes and Cluster hosts is completely configurable.
Options that can be used with *note 'ndbd': mysql-cluster-programs-ndbd. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndbd
Format Description Added, Deprecated, or Removed
' --bind-address=name '
Local bind address (Supported in all NDB releases based on MySQL 5.7)
' --character-sets-dir=path '
Directory containing (Supported in all NDB character sets releases based on MySQL 5.7)
' --connect-delay=# '
Obsolete synonym for REMOVED: NDB 7.5.25, -connect-retry-delay, NDB 7.6.21 which should be used
instead of this option
' --connect-retries=# '
Set the number of (Supported in all NDB times to retry a releases based on connection before MySQL 5.7) giving up; 0 means 1
attempt only (and no retries); -1 means continue retrying indefinitely
' --connect-retry-delay=# '
Time to wait between (Supported in all NDB attempts to contact a releases based on management server, in MySQL 5.7) seconds; 0 means do
not wait between attempts
'--connect-string=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --core-file '
Write core file on (Supported in all NDB error; used in releases based on debugging MySQL 5.7)
'--daemon',
' -d '
Start ndbd as daemon (Supported in all NDB (default); override releases based on with -nodaemon MySQL 5.7)
' --defaults-extra-file=path '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
' --foreground '
Run ndbd in (Supported in all NDB foreground, provided releases based on for debugging purposes MySQL 5.7) (implies -nodaemon)
'--help',
' -? '
Display help text and (Supported in all NDB exit releases based on MySQL 5.7)
' --initial '
Perform initial start (Supported in all NDB of ndbd, including releases based on file system cleanup; MySQL 5.7) consult documentation
before using this option
' --initial-start '
Perform partial (Supported in all NDB initial start releases based on (requires MySQL 5.7) -nowait-nodes)
' --install[=name] '
Used to install data (Supported in all NDB node process as releases based on Windows service; does MySQL 5.7) not apply on other
platforms
' --logbuffer-size=# '
Control size of log ADDED: NDB 7.6.6 buffer; for use when
debugging with many log messages being generated; default is sufficient for normal operations
' --login-path=path '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
'--ndb-connectstring=connection_string',
' -c connection_string '
Set connect string for (Supported in all NDB connecting to releases based on ndb_mgmd. Syntax: MySQL 5.7) "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf
'--ndb-mgmd-host=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --ndb-nodeid=# '
Set node ID for this (Supported in all NDB node, overriding any releases based on ID set by MySQL 5.7) -ndb-connectstring
' --nodaemon '
Do not start ndbd as (Supported in all NDB daemon; provided for releases based on testing purposes MySQL 5.7)
' --no-defaults '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
'--nostart',
' -n '
Do not start ndbd (Supported in all NDB immediately; ndbd releases based on waits for command to MySQL 5.7) start from ndb_mgm
' --nowait-nodes=list '
Do not wait for these (Supported in all NDB data nodes to start releases based on (takes comma-separated MySQL 5.7) list of node IDs);
requires -ndb-nodeid
' --ndb-optimized-node-selection '
Enable optimizations (Supported in all NDB for selection of nodes releases based on for transactions. MySQL 5.7) Enabled by default;
use -skip-ndb-optimized-node-selection to disable
' --print-defaults '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
' --remove[=name] '
Used to remove data (Supported in all NDB node process that was releases based on previously installed MySQL 5.7) as Windows service;
does not apply on other platforms
'--usage',
' -? '
Display help text and (Supported in all NDB exit; same as -help releases based on MySQL 5.7)
'--verbose',
' -v '
Write extra debugging (Supported in all NDB information to node releases based on log MySQL 5.7)
'--version',
' -V '
Display version (Supported in all NDB information and exit releases based on MySQL 5.7)
Note:
All of these options also apply to the multithreaded version of this program (note 'ndbmtd': mysql-cluster-programs-ndbmtd.) and you may substitute 'note 'ndbmtd': mysql-cluster-programs-ndbmtd.' for '*note 'ndbd': mysql-cluster-programs-ndbd.' wherever the latter occurs in this section.
'--bind-address'
Command-Line Format
'--bind-address=name'
Type
String
Default Value
''
Causes *note 'ndbd': mysql-cluster-programs-ndbd. to bind to a specific network interface (host name or IP address). This option has no default value.
'--character-sets-dir'
Command-Line Format
'--character-sets-dir=path'
Directory containing character sets.
'--connect-delay=#'
Command-Line Format
'--connect-delay=#'
Deprecated
Yes (removed in 5.7.36-ndb-7.6.21)
Type
Numeric
Default Value
'5'
Minimum Value
'0'
Maximum Value
'3600'
Determines the time to wait between attempts to contact a management server when starting (the number of attempts is controlled by the '--connect-retries' option). The default is 5 seconds.
This option is deprecated, and is subject to removal in a future release of NDB Cluster. Use '--connect-retry-delay' instead.
'--connect-retries=#'
Command-Line Format
'--connect-retries=#'
Type
Numeric
Default Value
'12'
Minimum Value (≥ 5.7.36-ndb-7.6.21)
'-1'
Minimum Value (≥ 5.7.36-ndb-7.5.25)
'-1'
Minimum Value (<= 5.7.36-ndb-7.5.24)
'0'
Minimum Value (<= 5.7.36-ndb-7.6.20)
'0'
Minimum Value
'0'
Maximum Value
'65535'
Set the number of times to retry a connection before giving up; 0 means 1 attempt only (and no retries). The default is 12 attempts. The time to wait between attempts is controlled by the '--connect-retry-delay' option.
Beginning with NDB 7.5.25 and NDB 7.6.21, you can set this option to -1, in which case, the data node process continues indefinitely to try to connect.
'--connect-retry-delay=#'
Command-Line Format
'--connect-retry-delay=#'
Type
Numeric
Default Value
'5'
Minimum Value
'0'
Maximum Value
'4294967295'
Determines the time to wait between attempts to contact a management server when starting (the time between attempts is controlled by the '--connect-retries' option). The default is 5 seconds.
This option takes the place of the '--connect-delay' option, which is now deprecated and subject to removal in a future release of NDB Cluster.
The short form '-r' for this option is deprecated as of NDB 7.5.25 and NDB 7.6.21, and subject to removal in a future release of NDB Cluster. Use the long form instead.
'--connect-string'
Command-Line Format
'--connect-string=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--core-file'
Command-Line Format
'--core-file'
Write core file on error; used in debugging.
'--daemon', '-d'
Command-Line Format
'--daemon'
Instructs note 'ndbd': mysql-cluster-programs-ndbd. or note 'ndbmtd': mysql-cluster-programs-ndbmtd. to execute as a daemon process. This is the default behavior. '--nodaemon' can be used to prevent the process from running as a daemon.
This option has no effect when running note 'ndbd': mysql-cluster-programs-ndbd. or note 'ndbmtd': mysql-cluster-programs-ndbmtd. on Windows platforms.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--foreground'
Command-Line Format
'--foreground'
Causes note 'ndbd': mysql-cluster-programs-ndbd. or note 'ndbmtd': mysql-cluster-programs-ndbmtd. to execute as a foreground process, primarily for debugging purposes. This option implies the '--nodaemon' option.
This option has no effect when running note 'ndbd': mysql-cluster-programs-ndbd. or note 'ndbmtd': mysql-cluster-programs-ndbmtd. on Windows platforms.
'--help'
Command-Line Format
'--help'
Display help text and exit.
'--initial'
Command-Line Format
'--initial'
Instructs note 'ndbd': mysql-cluster-programs-ndbd. to perform an initial start. An initial start erases any files created for recovery purposes by earlier instances of note 'ndbd': mysql-cluster-programs-ndbd. It also re-creates recovery log files. On some operating systems, this process can take a substantial amount of time.
An '--initial' start is to be used only when starting the *note 'ndbd': mysql-cluster-programs-ndbd. process under very special circumstances; this is because this option causes all files to be removed from the NDB Cluster file system and all redo log files to be re-created. These circumstances are listed here:
* When performing a software upgrade which has changed the
contents of any files.
* When restarting the node with a new version of *note 'ndbd':
mysql-cluster-programs-ndbd.
* As a measure of last resort when for some reason the node
restart or system restart repeatedly fails. In this case, be
aware that this node can no longer be used to restore data due
to the destruction of the data files.
Warning:
To avoid the possibility of eventual data loss, it is recommended that you not use the '--initial' option together with 'StopOnError = 0'. Instead, set 'StopOnError' to 0 in 'config.ini' only after the cluster has been started, then restart the data nodes normally--that is, without the '--initial' option. See the description of the 'StopOnError' parameter for a detailed explanation of this issue. (Bug #24945638)
Use of this option prevents the 'StartPartialTimeout' and 'StartPartitionedTimeout' configuration parameters from having any effect.
Important:
This option does not affect either of the following types of files:
* Backup files that have already been created by the affected
node
* NDB Cluster Disk Data files (see *note
mysql-cluster-disk-data::).
This option also has no effect on recovery of data by a data node that is just starting (or restarting) from data nodes that are already running. This recovery of data occurs automatically, and requires no user intervention in an NDB Cluster that is running normally.
It is permissible to use this option when starting the cluster for the very first time (that is, before any data node files have been created); however, it is not necessary to do so.
'--initial-start'
Command-Line Format
'--initial-start'
This option is used when performing a partial initial start of the cluster. Each node should be started with this option, as well as '--nowait-nodes'.
Suppose that you have a 4-node cluster whose data nodes have the IDs 2, 3, 4, and 5, and you wish to perform a partial initial start using only nodes 2, 4, and 5--that is, omitting node 3:
$> ndbd --ndb-nodeid=2 --nowait-nodes=3 --initial-start
$> ndbd --ndb-nodeid=4 --nowait-nodes=3 --initial-start
$> ndbd --ndb-nodeid=5 --nowait-nodes=3 --initial-start
When using this option, you must also specify the node ID for the data node being started with the '--ndb-nodeid' option.
Important:
Do not confuse this option with the '--nowait-nodes' option for *note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd, which can be used to enable a cluster configured with multiple management servers to be started without all management servers being online.
'--install[=NAME]'
Command-Line Format
'--install[=name]'
Platform Specific
Windows
Type
String
Default Value
'ndbd'
Causes note 'ndbd': mysql-cluster-programs-ndbd. to be installed as a Windows service. Optionally, you can specify a name for the service; if not set, the service name defaults to 'ndbd'. Although it is preferable to specify other note 'ndbd': mysql-cluster-programs-ndbd. program options in a 'my.ini' or 'my.cnf' configuration file, it is possible to use together with '--install'. However, in such cases, the '--install' option must be specified first, before any other options are given, for the Windows service installation to succeed.
It is generally not advisable to use this option together with the '--initial' option, since this causes the data node file system to be wiped and rebuilt every time the service is stopped and started. Extreme care should also be taken if you intend to use any of the other *note 'ndbd': mysql-cluster-programs-ndbd. options that affect the starting of data nodes--including '--initial-start', '--nostart', and '--nowait-nodes'--together with '--install', and you should make absolutely certain you fully understand and allow for any possible consequences of doing so.
The '--install' option has no effect on non-Windows platforms.
'--logbuffer-size=#'
Command-Line Format
'--logbuffer-size=#'
Introduced
5.7.22-ndb-7.6.6
Type
Integer
Default Value
'32768'
Minimum Value
'2048'
Maximum Value
'4294967295'
Sets the size of the data node log buffer. When debugging with high amounts of extra logging, it is possible for the log buffer to run out of space if there are too many log messages, in which case some log messages can be lost. This should not occur during normal operations.
'--login-path'
Command-Line Format
'--login-path=path'
Type
String
Default Value
'[none]'
Read given path from login file.
'--ndb-connectstring'
Command-Line Format
'--ndb-connectstring=connection_string'
Type
String
Default Value
'[none]'
Set connect string for connecting to ndb_mgmd. Syntax: "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf.
'--ndb-mgmd-host'
Command-Line Format
'--ndb-mgmd-host=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--ndb-nodeid'
Command-Line Format
'--ndb-nodeid=#'
Type
Integer
Default Value
'[none]'
Set node ID for this node, overriding any ID set by '--ndb-connectstring'.
'--ndb-optimized-node-selection'
Command-Line Format
'--ndb-optimized-node-selection'
Enable optimizations for selection of nodes for transactions. Enabled by default; use '--skip-ndb-optimized-node-selection' to disable.
'--nodaemon'
Command-Line Format
'--nodaemon'
Prevents note 'ndbd': mysql-cluster-programs-ndbd. or note 'ndbmtd': mysql-cluster-programs-ndbmtd. from executing as a daemon process. This option overrides the '--daemon' option. This is useful for redirecting output to the screen when debugging the binary.
The default behavior for note 'ndbd': mysql-cluster-programs-ndbd. and note 'ndbmtd': mysql-cluster-programs-ndbmtd. on Windows is to run in the foreground, making this option unnecessary on Windows platforms, where it has no effect.
'--no-defaults'
Command-Line Format
'--no-defaults'
Do not read default options from any option file other than login file.
'--nostart', '-n'
Command-Line Format
'--nostart'
Instructs note 'ndbd': mysql-cluster-programs-ndbd. not to start automatically. When this option is used, note 'ndbd': mysql-cluster-programs-ndbd. connects to the management server, obtains configuration data from it, and initializes communication objects. However, it does not actually start the execution engine until specifically requested to do so by the management server. This can be accomplished by issuing the proper 'START' command in the management client (see *note mysql-cluster-mgm-client-commands::).
'--nowait-nodes=NODE_ID_1[, NODE_ID_2[, ...]]'
Command-Line Format
'--nowait-nodes=list'
Type
String
Default Value
''
This option takes a list of data nodes which for which the cluster does not wait for before starting.
This can be used to start the cluster in a partitioned state. For example, to start the cluster with only half of the data nodes (nodes 2, 3, 4, and 5) running in a 4-node cluster, you can start each *note 'ndbd': mysql-cluster-programs-ndbd. process with '--nowait-nodes=3,5'. In this case, the cluster starts as soon as nodes 2 and 4 connect, and does not wait 'StartPartitionedTimeout' milliseconds for nodes 3 and 5 to connect as it would otherwise.
If you wanted to start up the same cluster as in the previous example without one *note 'ndbd': mysql-cluster-programs-ndbd. (say, for example, that the host machine for node 3 has suffered a hardware failure) then start nodes 2, 4, and 5 with '--nowait-nodes=3'. Then the cluster starts as soon as nodes 2, 4, and 5 connect and does not wait for node 3 to start.
'--print-defaults'
Command-Line Format
'--print-defaults'
Print program argument list and exit.
'--remove[=NAME]'
Command-Line Format
'--remove[=name]'
Platform Specific
Windows
Type
String
Default Value
'ndbd'
Causes an *note 'ndbd': mysql-cluster-programs-ndbd. process that was previously installed as a Windows service to be removed. Optionally, you can specify a name for the service to be uninstalled; if not set, the service name defaults to 'ndbd'.
The '--remove' option has no effect on non-Windows platforms.
'--usage'
Command-Line Format
'--usage'
Display help text and exit; same as '--help'.
'--verbose', '-v'
Causes extra debug output to be written to the node log.
In NDB 7.6, you can also use 'NODELOG DEBUG ON' and 'NODELOG DEBUG OFF' to enable and disable this extra logging while the data node is running.
'--version'
Command-Line Format
'--version'
Display version information and exit.
*note 'ndbd': mysql-cluster-programs-ndbd. generates a set of log files which are placed in the directory specified by 'DataDir' in the 'config.ini' configuration file.
These log files are listed below. NODE_ID is and represents the node's unique identifier. For example, 'ndb_2_error.log' is the error log generated by the data node whose node ID is '2'.
'ndb_NODE_ID_error.log' is a file containing records of all crashes which the referenced *note 'ndbd': mysql-cluster-programs-ndbd. process has encountered. Each record in this file contains a brief error string and a reference to a trace file for this crash. A typical entry in this file might appear as shown here:
Date/Time: Saturday 30 July 2004 - 00:20:01
Type of error: error
Message: Internal program error (failed ndbrequire)
Fault ID: 2341
Problem data: DbtupFixAlloc.cpp
Object of reference: DBTUP (Line: 173)
ProgramName: NDB Kernel
ProcessID: 14909
TraceFile: ndb_2_trace.log.2
***EOM***
Listings of possible *note 'ndbd': mysql-cluster-programs-ndbd. exit codes and messages generated when a data node process shuts down prematurely can be found in Data Node Error Messages (https://dev.mysql.com/doc/ndb-internals/en/ndb-node-error-messages.html).
Important:
The last entry in the error log file is not necessarily the newest one (nor is it likely to be). Entries in the error log are not listed in chronological order; rather, they correspond to the order of the trace files as determined in the 'ndb_NODE_ID_trace.log.next' file (see below). Error log entries are thus overwritten in a cyclical and not sequential fashion.
'ndb_NODE_ID_trace.log.TRACE_ID' is a trace file describing exactly what happened just before the error occurred. This information is useful for analysis by the NDB Cluster development team.
It is possible to configure the number of these trace files that are created before old files are overwritten. TRACE_ID is a number which is incremented for each successive trace file.
'ndb_NODE_ID_trace.log.next' is the file that keeps track of the next trace file number to be assigned.
'ndb_NODE_ID_out.log' is a file containing any data output by the note 'ndbd': mysql-cluster-programs-ndbd. process. This file is created only if note 'ndbd': mysql-cluster-programs-ndbd. is started as a daemon, which is the default behavior.
'ndb_NODE_ID.pid' is a file containing the process ID of the *note 'ndbd': mysql-cluster-programs-ndbd. process when started as a daemon. It also functions as a lock file to avoid the starting of nodes with the same identifier.
'ndb_NODE_ID_signal.log' is a file used only in debug versions of note 'ndbd': mysql-cluster-programs-ndbd, where it is possible to trace all incoming, outgoing, and internal messages with their data in the note 'ndbd': mysql-cluster-programs-ndbd. process.
It is recommended not to use a directory mounted through NFS because in some environments this can cause problems whereby the lock on the '.pid' file remains in effect even after the process has terminated.
To start *note 'ndbd': mysql-cluster-programs-ndbd, it may also be necessary to specify the host name of the management server and the port on which it is listening. Optionally, one may also specify the node ID that the process is to use.
$> ndbd --connect-string="nodeid=2;host=ndb_mgmd.mysql.com:1186"
See note mysql-cluster-connection-strings::, for additional information about this issue. For more information about data node configuration parameters, see note mysql-cluster-ndbd-definition::.
When note 'ndbd': mysql-cluster-programs-ndbd. starts, it actually initiates two processes. The first of these is called the 'angel process'; its only job is to discover when the execution process has been completed, and then to restart the note 'ndbd': mysql-cluster-programs-ndbd. process if it is configured to do so. Thus, if you attempt to kill note 'ndbd': mysql-cluster-programs-ndbd. using the Unix note 'kill': kill. command, it is necessary to kill both processes, beginning with the angel process. The preferred method of terminating an *note 'ndbd': mysql-cluster-programs-ndbd. process is to use the management client and stop the process from there.
The execution process uses one thread for reading, writing, and scanning data, as well as all other activities. This thread is implemented asynchronously so that it can easily handle thousands of concurrent actions. In addition, a watch-dog thread supervises the execution thread to make sure that it does not hang in an endless loop. A pool of threads handles file I/O, with each thread able to handle one open file. Threads can also be used for transporter connections by the transporters in the note 'ndbd': mysql-cluster-programs-ndbd. process. In a multi-processor system performing a large number of operations (including updates), the note 'ndbd': mysql-cluster-programs-ndbd. process can consume up to 2 CPUs if permitted to do so.
For a machine with many CPUs it is possible to use several note 'ndbd': mysql-cluster-programs-ndbd. processes which belong to different node groups; however, such a configuration is still considered experimental and is not supported for MySQL 5.7 in a production setting. See note mysql-cluster-limitations::.
File: manual.info.tmp, Node: mysql-cluster-programs-ndbinfo-select-all, Next: mysql-cluster-programs-ndbmtd, Prev: mysql-cluster-programs-ndbd, Up: mysql-cluster-programs
note 'ndbinfo_select_all': mysql-cluster-programs-ndbinfo-select-all. is a client program that selects all rows and columns from one or more tables in the note 'ndbinfo': mysql-cluster-ndbinfo. database
Not all 'ndbinfo' tables available in the note 'mysql': mysql. client can be read by this program (see later in this section). In addition, note 'ndbinfo_select_all': mysql-cluster-programs-ndbinfo-select-all. can show information about some tables internal to 'ndbinfo' which cannot be accessed using SQL, including the 'tables' and 'columns' metadata tables.
To select from one or more 'ndbinfo' tables using *note 'ndbinfo_select_all': mysql-cluster-programs-ndbinfo-select-all, it is necessary to supply the names of the tables when invoking the program as shown here:
$> ndbinfo_select_all TABLE_NAME1 [TABLE_NAME2] [...]
For example:
$> ndbinfo_select_all logbuffers logspaces
== logbuffers ==
node_id log_type log_id log_part total used high
5 0 0 0 33554432 262144 0
6 0 0 0 33554432 262144 0
7 0 0 0 33554432 262144 0
8 0 0 0 33554432 262144 0
== logspaces ==
node_id log_type log_id log_part total used high
5 0 0 0 268435456 0 0
5 0 0 1 268435456 0 0
5 0 0 2 268435456 0 0
5 0 0 3 268435456 0 0
6 0 0 0 268435456 0 0
6 0 0 1 268435456 0 0
6 0 0 2 268435456 0 0
6 0 0 3 268435456 0 0
7 0 0 0 268435456 0 0
7 0 0 1 268435456 0 0
7 0 0 2 268435456 0 0
7 0 0 3 268435456 0 0
8 0 0 0 268435456 0 0
8 0 0 1 268435456 0 0
8 0 0 2 268435456 0 0
8 0 0 3 268435456 0 0
$>
Options that can be used with *note 'ndbinfo_select_all': mysql-cluster-programs-ndbinfo-select-all. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndbinfo_select_all
Format Description Added, Deprecated, or Removed
' --character-sets-dir=path '
Directory containing (Supported in all NDB character sets releases based on MySQL 5.7)
' --connect-retries=# '
Number of times to (Supported in all NDB retry connection releases based on before giving up MySQL 5.7)
' --connect-retry-delay=# '
Number of seconds to (Supported in all NDB wait between attempts releases based on to contact management MySQL 5.7) server
'--connect-string=connection-string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --core-file '
Write core file on (Supported in all NDB error; used in releases based on debugging MySQL 5.7)
'--database=db_name',
' -d '
Name of database where (Supported in all NDB table is located releases based on MySQL 5.7)
' --defaults-extra-file=path '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
' --delay=# '
Set delay in seconds (Supported in all NDB between loops releases based on MySQL 5.7)
'--help',
' -? '
Display help text and (Supported in all NDB exit releases based on MySQL 5.7)
' --login-path=path '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
'--loops=#',
' -l '
Set number of times to (Supported in all NDB perform select releases based on MySQL 5.7)
'--ndb-connectstring=connection-string',
' -c '
Set connect string for (Supported in all NDB connecting to releases based on ndb_mgmd. Syntax: MySQL 5.7) "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf
'--ndb-mgmd-host=connection-string',
' -c '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --ndb-nodeid=# '
Set node ID for this (Supported in all NDB node, overriding any releases based on ID set by MySQL 5.7) -ndb-connectstring
' --no-defaults '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
' --ndb-optimized-node-selection '
Enable optimizations (Supported in all NDB for selection of nodes releases based on for transactions. MySQL 5.7) Enabled by default;
use -skip-ndb-optimized-node-selection to disable
'--parallelism=#',
' -p '
Set degree of (Supported in all NDB parallelism releases based on MySQL 5.7)
' --print-defaults '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
'--usage',
' -? '
Display help text and (Supported in all NDB exit; same as -help releases based on MySQL 5.7)
'--version',
' -V '
Display version (Supported in all NDB information and exit releases based on MySQL 5.7)
'--character-sets-dir'
Command-Line Format
'--character-sets-dir=path'
Directory containing character sets.
'--connect-retries'
Command-Line Format
'--connect-retries=#'
Type
Integer
Default Value
'12'
Minimum Value
'0'
Maximum Value
'12'
Number of times to retry connection before giving up.
'--connect-retry-delay'
Command-Line Format
'--connect-retry-delay=#'
Type
Integer
Default Value
'5'
Minimum Value
'0'
Maximum Value
'5'
Number of seconds to wait between attempts to contact management server.
'--connect-string'
Command-Line Format
'--connect-string=connection-string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--core-file'
Command-Line Format
'--core-file'
Write core file on error; used in debugging.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--delay=seconds'
Command-Line Format
'--delay=#'
Type
Numeric
Default Value
'5'
Minimum Value
'0'
Maximum Value
'MAX_INT'
This option sets the number of seconds to wait between executing loops. Has no effect if '--loops' is set to 0 or 1.
'--help'
Command-Line Format
'--help'
Display help text and exit.
'--login-path'
Command-Line Format
'--login-path=path'
Type
String
Default Value
'[none]'
Read given path from login file.
'--loops=number', '-l NUMBER'
Command-Line Format
'--loops=#'
Type
Numeric
Default Value
'1'
Minimum Value
'0'
Maximum Value
'MAX_INT'
This option sets the number of times to execute the select. Use '--delay' to set the time between loops.
'--ndb-connectstring'
Command-Line Format
'--ndb-connectstring=connection-string'
Type
String
Default Value
'[none]'
Set connect string for connecting to ndb_mgmd. Syntax: "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf.
'--ndb-mgmd-host'
Command-Line Format
'--ndb-mgmd-host=connection-string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--ndb-nodeid'
Command-Line Format
'--ndb-nodeid=#'
Type
Integer
Default Value
'[none]'
Set node ID for this node, overriding any ID set by '--ndb-connectstring'.
'--ndb-optimized-node-selection'
Command-Line Format
'--ndb-optimized-node-selection'
Enable optimizations for selection of nodes for transactions. Enabled by default; use '--skip-ndb-optimized-node-selection' to disable.
'--no-defaults'
Command-Line Format
'--no-defaults'
Do not read default options from any option file other than login file.
'--print-defaults'
Command-Line Format
'--print-defaults'
Print program argument list and exit.
'--usage'
Command-Line Format
'--usage'
Display help text and exit; same as '--help'.
'--version'
Command-Line Format
'--version'
Display version information and exit.
*note 'ndbinfo_select_all': mysql-cluster-programs-ndbinfo-select-all. is unable to read the following tables:
*note 'arbitrator_validity_detail': mysql-cluster-ndbinfo-arbitrator-validity-detail.
*note 'arbitrator_validity_summary': mysql-cluster-ndbinfo-arbitrator-validity-summary.
*note 'cluster_locks': mysql-cluster-ndbinfo-cluster-locks.
*note 'cluster_operations': mysql-cluster-ndbinfo-cluster-operations.
*note 'cluster_transactions': mysql-cluster-ndbinfo-cluster-transactions.
*note 'disk_write_speed_aggregate_node': mysql-cluster-ndbinfo-disk-write-speed-aggregate-node.
*note 'locks_per_fragment': mysql-cluster-ndbinfo-locks-per-fragment.
*note 'memory_per_fragment': mysql-cluster-ndbinfo-memory-per-fragment.
*note 'memoryusage': mysql-cluster-ndbinfo-memoryusage.
*note 'operations_per_fragment': mysql-cluster-ndbinfo-operations-per-fragment.
*note 'server_locks': mysql-cluster-ndbinfo-server-locks.
*note 'server_operations': mysql-cluster-ndbinfo-server-operations.
*note 'server_transactions': mysql-cluster-ndbinfo-server-transactions.
*note 'table_info': mysql-cluster-ndbinfo-table-info.
File: manual.info.tmp, Node: mysql-cluster-programs-ndbmtd, Next: mysql-cluster-programs-ndb-mgmd, Prev: mysql-cluster-programs-ndbinfo-select-all, Up: mysql-cluster-programs
note 'ndbmtd': mysql-cluster-programs-ndbmtd. is a multithreaded version of note 'ndbd': mysql-cluster-programs-ndbd, the process that is used to handle all the data in tables using the note 'NDBCLUSTER': mysql-cluster. storage engine. note 'ndbmtd': mysql-cluster-programs-ndbmtd. is intended for use on host computers having multiple CPU cores. Except where otherwise noted, note 'ndbmtd': mysql-cluster-programs-ndbmtd. functions in the same way as note 'ndbd': mysql-cluster-programs-ndbd.; therefore, in this section, we concentrate on the ways in which note 'ndbmtd': mysql-cluster-programs-ndbmtd. differs from note 'ndbd': mysql-cluster-programs-ndbd, and you should consult *note mysql-cluster-programs-ndbd::, for additional information about running NDB Cluster data nodes that apply to both the single-threaded and multithreaded versions of the data node process.
Command-line options and configuration parameters used with note 'ndbd': mysql-cluster-programs-ndbd. also apply to note 'ndbmtd': mysql-cluster-programs-ndbmtd. For more information about these options and parameters, see note mysql-cluster-programs-ndbd::, and note mysql-cluster-ndbd-definition::, respectively.
note 'ndbmtd': mysql-cluster-programs-ndbmtd. is also file system-compatible with note 'ndbd': mysql-cluster-programs-ndbd. In other words, a data node running note 'ndbd': mysql-cluster-programs-ndbd. can be stopped, the binary replaced with note 'ndbmtd': mysql-cluster-programs-ndbmtd, and then restarted without any loss of data. (However, when doing this, you must make sure that 'MaxNoOfExecutionThreads' is set to an apppriate value before restarting the node if you wish for note 'ndbmtd': mysql-cluster-programs-ndbmtd. to run in multithreaded fashion.) Similarly, an note 'ndbmtd': mysql-cluster-programs-ndbmtd. binary can be replaced with note 'ndbd': mysql-cluster-programs-ndbd. simply by stopping the node and then starting note 'ndbd': mysql-cluster-programs-ndbd. in place of the multithreaded binary. It is not necessary when switching between the two to start the data node binary using '--initial'.
Using note 'ndbmtd': mysql-cluster-programs-ndbmtd. differs from using note 'ndbd': mysql-cluster-programs-ndbd. in two key respects:
Because note 'ndbmtd': mysql-cluster-programs-ndbmtd. runs by default in single-threaded mode (that is, it behaves like note 'ndbd': mysql-cluster-programs-ndbd.), you must configure it to use multiple threads. This can be done by setting an appropriate value in the 'config.ini' file for the 'MaxNoOfExecutionThreads' configuration parameter or the 'ThreadConfig' configuration parameter. Using 'MaxNoOfExecutionThreads' is simpler, but 'ThreadConfig' offers more flexibility. For more information about these configuration parameters and their use, see *note mysql-cluster-ndbd-definition-ndbmtd-parameters::.
Trace files are generated by critical errors in note 'ndbmtd': mysql-cluster-programs-ndbmtd. processes in a somewhat different fashion from how these are generated by note 'ndbd': mysql-cluster-programs-ndbd. failures. These differences are discussed in more detail in the next few paragraphs.
Like note 'ndbd': mysql-cluster-programs-ndbd, note 'ndbmtd': mysql-cluster-programs-ndbmtd. generates a set of log files which are placed in the directory specified by 'DataDir' in the 'config.ini' configuration file. Except for trace files, these are generated in the same way and have the same names as those generated by *note 'ndbd': mysql-cluster-programs-ndbd.
In the event of a critical error, note 'ndbmtd': mysql-cluster-programs-ndbmtd. generates trace files describing what happened just prior to the error' occurrence. These files, which can be found in the data node's 'DataDir', are useful for analysis of problems by the NDB Cluster Development and Support teams. One trace file is generated for each note 'ndbmtd': mysql-cluster-programs-ndbmtd. thread. The names of these files have the following pattern:
ndb_NODE_ID_trace.log.TRACE_ID_tTHREAD_ID,
In this pattern, NODE_ID stands for the data node's unique node ID in the cluster, TRACE_ID is a trace sequence number, and THREAD_ID is the thread ID. For example, in the event of the failure of an note 'ndbmtd': mysql-cluster-programs-ndbmtd. process running as an NDB Cluster data node having the node ID 3 and with 'MaxNoOfExecutionThreads' equal to 4, four trace files are generated in the data node's data directory. If the is the first time this node has failed, then these files are named 'ndb_3_trace.log.1_t1', 'ndb_3_trace.log.1_t2', 'ndb_3_trace.log.1_t3', and 'ndb_3_trace.log.1_t4'. Internally, these trace files follow the same format as note 'ndbd': mysql-cluster-programs-ndbd. trace files.
The note 'ndbd': mysql-cluster-programs-ndbd. exit codes and messages that are generated when a data node process shuts down prematurely are also used by note 'ndbmtd': mysql-cluster-programs-ndbmtd. See Data Node Error Messages (https://dev.mysql.com/doc/ndb-internals/en/ndb-node-error-messages.html), for a listing of these.
Note:
It is possible to use note 'ndbd': mysql-cluster-programs-ndbd. and note 'ndbmtd': mysql-cluster-programs-ndbmtd. concurrently on different data nodes in the same NDB Cluster. However, such configurations have not been tested extensively; thus, we cannot recommend doing so in a production setting at this time.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-mgmd, Next: mysql-cluster-programs-ndb-mgm, Prev: mysql-cluster-programs-ndbmtd, Up: mysql-cluster-programs
The management server is the process that reads the cluster configuration file and distributes this information to all nodes in the cluster that request it. It also maintains a log of cluster activities. Management clients can connect to the management server and check the cluster's status.
Options that can be used with *note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndb_mgmd
Format Description Added, Deprecated, or Removed
' --bind-address=host '
Local bind address (Supported in all NDB releases based on MySQL 5.7)
' --character-sets-dir=path '
Directory containing (Supported in all NDB character sets releases based on MySQL 5.7)
' --config-cache[=TRUE|FALSE] '
Enable management (Supported in all NDB server configuration releases based on cache; true by default MySQL 5.7)
'--config-file=file',
' -f file '
Specify cluster (Supported in all NDB configuration file; releases based on also specify -reload MySQL 5.7) or -initial to
override configuration cache if present
'--configdir=directory',
' --config-dir=directory '
Specify cluster (Supported in all NDB management server releases based on configuration cache MySQL 5.7) directory
' --connect-retries=# '
Number of times to (Supported in all NDB retry connection releases based on before giving up MySQL 5.7)
' --connect-retry-delay=# '
Number of seconds to (Supported in all NDB wait between attempts releases based on to contact management MySQL 5.7) server
'--connect-string=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --core-file '
Write core file on (Supported in all NDB error; used in releases based on debugging MySQL 5.7)
'--daemon',
' -d '
Run ndb_mgmd in daemon (Supported in all NDB mode (default) releases based on MySQL 5.7)
' --defaults-extra-file=path '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
'--help',
' -? '
Display help text and (Supported in all NDB exit releases based on MySQL 5.7)
' --initial '
Causes management (Supported in all NDB server to reload releases based on configuration data MySQL 5.7) from configuration
file, bypassing configuration cache
' --install[=name] '
Used to install (Supported in all NDB management server releases based on process as Windows MySQL 5.7) service; does not
apply on other platforms
' --interactive '
Run ndb_mgmd in (Supported in all NDB interactive mode (not releases based on officially supported MySQL 5.7) in production; for
testing purposes only)
' --log-name=name '
Name to use when (Supported in all NDB writing cluster log releases based on messages applying to MySQL 5.7) this node
' --login-path=path '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
' --mycnf '
Read cluster (Supported in all NDB configuration data releases based on from my.cnf file MySQL 5.7)
'--ndb-connectstring=connection_string',
' -c connection_string '
Set connect string for (Supported in all NDB connecting to releases based on ndb_mgmd. Syntax: MySQL 5.7) "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf
'--ndb-mgmd-host=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --ndb-nodeid=# '
Set node ID for this (Supported in all NDB node, overriding any releases based on ID set by MySQL 5.7) -ndb-connectstring
' --ndb-optimized-node-selection '
Enable optimizations (Supported in all NDB for selection of nodes releases based on for transactions. MySQL 5.7) Enabled by default;
use -skip-ndb-optimized-node-selection to disable
' --no-defaults '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
' --no-nodeid-checks '
Do not perform any (Supported in all NDB node ID checks releases based on MySQL 5.7)
' --nodaemon '
Do not run ndb_mgmd as (Supported in all NDB a daemon releases based on MySQL 5.7)
' --nowait-nodes=list '
Do not wait for (Supported in all NDB management nodes releases based on specified when MySQL 5.7) starting this
management server; requires -ndb-nodeid option
' --print-defaults '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
'--print-full-config',
' -P '
Print full (Supported in all NDB configuration and exit releases based on MySQL 5.7)
' --reload '
Causes management (Supported in all NDB server to compare releases based on configuration file MySQL 5.7) with configuration
cache
' --remove[=name] '
Used to remove (Supported in all NDB management server releases based on process that was MySQL 5.7) previously installed
as Windows service, optionally specifying name of service to be removed; does not apply on other platforms
' --skip-config-file '
Do not use (Supported in all NDB configuration file releases based on MySQL 5.7)
'--usage',
' -? '
Display help text and (Supported in all NDB exit; same as -help releases based on MySQL 5.7)
'--verbose',
' -v '
Write additional (Supported in all NDB information to log releases based on MySQL 5.7)
'--version',
' -V '
Display version (Supported in all NDB information and exit releases based on MySQL 5.7)
'--bind-address=HOST'
Command-Line Format
'--bind-address=host'
Type
String
Default Value
'[none]'
Causes the management server to bind to a specific network interface (host name or IP address). This option has no default value.
'--character-sets-dir'
Command-Line Format
'--character-sets-dir=path'
Directory containing character sets.
'--config-cache'
Command-Line Format
'--config-cache[=TRUE|FALSE]'
Type
Boolean
Default Value
'TRUE'
This option, whose default value is '1' (or 'TRUE', or 'ON'), can be used to disable the management server's configuration cache, so that it reads its configuration from 'config.ini' every time it starts (see note mysql-cluster-config-file::). You can do this by starting the note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. process with any one of the following options:
* '--config-cache=0'
* '--config-cache=FALSE'
* '--config-cache=OFF'
* '--skip-config-cache'
Using one of the options just listed is effective only if the management server has no stored configuration at the time it is started. If the management server finds any configuration cache files, then the '--config-cache' option or the '--skip-config-cache' option is ignored. Therefore, to disable configuration caching, the option should be used the first time that the management server is started. Otherwise--that is, if you wish to disable configuration caching for a management server that has already created a configuration cache--you must stop the management server, delete any existing configuration cache files manually, then restart the management server with '--skip-config-cache' (or with '--config-cache' set equal to 0, 'OFF', or 'FALSE').
Configuration cache files are normally created in a directory named 'mysql-cluster' under the installation directory (unless this location has been overridden using the '--configdir' option). Each time the management server updates its configuration data, it writes a new cache file. The files are named sequentially in order of creation using the following format:
ndb_NODE-ID_config.bin.SEQ-NUMBER
NODE-ID is the management server's node ID; SEQ-NUMBER is a sequence number, beginning with 1. For example, if the management server's node ID is 5, then the first three configuration cache files would, when they are created, be named 'ndb_5_config.bin.1', 'ndb_5_config.bin.2', and 'ndb_5_config.bin.3'.
If your intent is to purge or reload the configuration cache without actually disabling caching, you should start *note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. with one of the options '--reload' or '--initial' instead of '--skip-config-cache'.
To re-enable the configuration cache, simply restart the management server, but without the '--config-cache' or '--skip-config-cache' option that was used previously to disable the configuration cache.
*note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. does not check for the configuration directory ('--configdir') or attempts to create one when '--skip-config-cache' is used. (Bug #13428853)
'--config-file=FILENAME', '-f FILENAME'
Command-Line Format
'--config-file=file'
Disabled by
'skip-config-file'
Type
File name
Default Value
'[none]'
Instructs the management server as to which file it should use for its configuration file. By default, the management server looks for a file named 'config.ini' in the same directory as the *note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. executable; otherwise the file name and location must be specified explicitly.
This option has no default value, and is ignored unless the management server is forced to read the configuration file, either because *note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. was started with the '--reload' or '--initial' option, or because the management server could not find any configuration cache.
The '--config-file' option is also read if note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. was started with '--config-cache=OFF'. See note mysql-cluster-config-file::, for more information.
'--configdir=DIR_NAME'
Command-Line Format
'--configdir=directory' '--config-dir=directory'
Type
File name
Default Value
'$INSTALLDIR/mysql-cluster'
Specifies the cluster management server's configuration cache directory. '--config-dir' is an alias for this option.
'--connect-retries'
Command-Line Format
'--connect-retries=#'
Type
Integer
Default Value
'12'
Minimum Value
'0'
Maximum Value
'12'
Number of times to retry connection before giving up.
'--connect-retry-delay'
Command-Line Format
'--connect-retry-delay=#'
Type
Integer
Default Value
'5'
Minimum Value
'0'
Maximum Value
'5'
Number of seconds to wait between attempts to contact management server.
'--connect-string'
Command-Line Format
'--connect-string=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--core-file'
Command-Line Format
'--core-file'
Write core file on error; used in debugging.
'--daemon', '-d'
Command-Line Format
'--daemon'
Instructs *note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. to start as a daemon process. This is the default behavior.
This option has no effect when running *note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. on Windows platforms.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--help'
Command-Line Format
'--help'
Display help text and exit.
'--initial'
Command-Line Format
'--initial'
Configuration data is cached internally, rather than being read from the cluster global configuration file each time the management server is started (see *note mysql-cluster-config-file::). Using the '--initial' option overrides this behavior, by forcing the management server to delete any existing cache files, and then to re-read the configuration data from the cluster configuration file and to build a new cache.
This differs in two ways from the '--reload' option. First, '--reload' forces the server to check the configuration file against the cache and reload its data only if the contents of the file are different from the cache. Second, '--reload' does not delete any existing cache files.
If *note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. is invoked with '--initial' but cannot find a global configuration file, the management server cannot start.
When a management server starts, it checks for another management server in the same NDB Cluster and tries to use the other management server's configuration data. This behavior has implications when performing a rolling restart of an NDB Cluster with multiple management nodes. See *note mysql-cluster-rolling-restart::, for more information.
When used together with the '--config-file' option, the cache is cleared only if the configuration file is actually found.
'--install[=NAME]'
Command-Line Format
'--install[=name]'
Platform Specific
Windows
Type
String
Default Value
'ndb_mgmd'
Causes note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. to be installed as a Windows service. Optionally, you can specify a name for the service; if not set, the service name defaults to 'ndb_mgmd'. Although it is preferable to specify other note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. program options in a 'my.ini' or 'my.cnf' configuration file, it is possible to use them together with '--install'. However, in such cases, the '--install' option must be specified first, before any other options are given, for the Windows service installation to succeed.
It is generally not advisable to use this option together with the '--initial' option, since this causes the configuration cache to be wiped and rebuilt every time the service is stopped and started. Care should also be taken if you intend to use any other *note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. options that affect the starting of the management server, and you should make absolutely certain you fully understand and allow for any possible consequences of doing so.
The '--install' option has no effect on non-Windows platforms.
'--interactive'
Command-Line Format
'--interactive'
Starts note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. in interactive mode; that is, an note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. client session is started as soon as the management server is running. This option does not start any other NDB Cluster nodes.
'--login-path'
Command-Line Format
'--login-path=path'
Type
String
Default Value
'[none]'
Read given path from login file.
'--log-name=NAME'
Command-Line Format
'--log-name=name'
Type
String
Default Value
'MgmtSrvr'
Provides a name to be used for this node in the cluster log.
'--mycnf'
Command-Line Format
'--mycnf'
Read configuration data from the 'my.cnf' file.
'--ndb-connectstring'
Command-Line Format
'--ndb-connectstring=connection_string'
Type
String
Default Value
'[none]'
Set connection string. Syntax: '[nodeid=ID;][host=]HOSTNAME[:PORT]'. Overrides entries in 'NDB_CONNECTSTRING' and 'my.cnf'; ignored if '--config-file' is specified.
'--ndb-mgmd-host'
Command-Line Format
'--ndb-mgmd-host=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--ndb-nodeid'
Command-Line Format
'--ndb-nodeid=#'
Type
Integer
Default Value
'[none]'
Set node ID for this node, overriding any ID set by '--ndb-connectstring'.
'--ndb-optimized-node-selection'
Command-Line Format
'--ndb-optimized-node-selection'
Enable optimizations for selection of nodes for transactions. Enabled by default; use '--skip-ndb-optimized-node-selection' to disable.
'--no-defaults'
Command-Line Format
'--no-defaults'
Do not read default options from any option file other than login file.
'--no-nodeid-checks'
Command-Line Format
'--no-nodeid-checks'
Do not perform any checks of node IDs.
'--nodaemon'
Command-Line Format
'--nodaemon'
Instructs *note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. not to start as a daemon process.
The default behavior for *note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. on Windows is to run in the foreground, making this option unnecessary on Windows platforms.
'--nowait-nodes'
Command-Line Format
'--nowait-nodes=list'
Type
Numeric
Default Value
'[none]'
Minimum Value
'1'
Maximum Value
'255'
When starting an NDB Cluster is configured with two management nodes, each management server normally checks to see whether the other note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. is also operational and whether the other management server's configuration is identical to its own. However, it is sometimes desirable to start the cluster with only one management node (and perhaps to allow the other note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. to be started later). This option causes the management node to bypass any checks for any other management nodes whose node IDs are passed to this option, permitting the cluster to start as though configured to use only the management node that was started.
For purposes of illustration, consider the following portion of a 'config.ini' file (where we have omitted most of the configuration parameters that are not relevant to this example):
[ndbd]
NodeId = 1
HostName = 198.51.100.101
[ndbd]
NodeId = 2
HostName = 198.51.100.102
[ndbd]
NodeId = 3
HostName = 198.51.100.103
[ndbd]
NodeId = 4
HostName = 198.51.100.104
[ndb_mgmd]
NodeId = 10
HostName = 198.51.100.150
[ndb_mgmd]
NodeId = 11
HostName = 198.51.100.151
[api]
NodeId = 20
HostName = 198.51.100.200
[api]
NodeId = 21
HostName = 198.51.100.201
Assume that you wish to start this cluster using only the management server having node ID '10' and running on the host having the IP address 198.51.100.150. (Suppose, for example, that the host computer on which you intend to the other management server is temporarily unavailable due to a hardware failure, and you are waiting for it to be repaired.) To start the cluster in this way, use a command line on the machine at 198.51.100.150 to enter the following command:
$> ndb_mgmd --ndb-nodeid=10 --nowait-nodes=11
As shown in the preceding example, when using '--nowait-nodes', you must also use the '--ndb-nodeid' option to specify the node ID of this *note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. process.
You can then start each of the cluster's data nodes in the usual way. If you wish to start and use the second management server in addition to the first management server at a later time without restarting the data nodes, you must start each data node with a connection string that references both management servers, like this:
$> ndbd -c 198.51.100.150,198.51.100.151
The same is true with regard to the connection string used with any note 'mysqld': mysqld. processes that you wish to start as NDB Cluster SQL nodes connected to this cluster. See note mysql-cluster-connection-strings::, for more information.
When used with note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd, this option affects the behavior of the management node with regard to other management nodes only. Do not confuse it with the '--nowait-nodes' option used with note 'ndbd': mysql-cluster-programs-ndbd. or *note 'ndbmtd': mysql-cluster-programs-ndbmtd. to permit a cluster to start with fewer than its full complement of data nodes; when used with data nodes, this option affects their behavior only with regard to other data nodes.
Multiple management node IDs may be passed to this option as a comma-separated list. Each node ID must be no less than 1 and no greater than 255. In practice, it is quite rare to use more than two management servers for the same NDB Cluster (or to have any need for doing so); in most cases you need to pass to this option only the single node ID for the one management server that you do not wish to use when starting the cluster.
Note:
When you later start the 'missing' management server, its configuration must match that of the management server that is already in use by the cluster. Otherwise, it fails the configuration check performed by the existing management server, and does not start.
'--print-defaults'
Command-Line Format
'--print-defaults'
Print program argument list and exit.
'--print-full-config', '-P'
Command-Line Format
'--print-full-config'
Shows extended information regarding the configuration of the cluster. With this option on the command line the *note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. process prints information about the cluster setup including an extensive list of the cluster configuration sections as well as parameters and their values. Normally used together with the '--config-file' ('-f') option.
'--reload'
Command-Line Format
'--reload'
NDB Cluster configuration data is stored internally rather than being read from the cluster global configuration file each time the management server is started (see *note mysql-cluster-config-file::). Using this option forces the management server to check its internal data store against the cluster configuration file and to reload the configuration if it finds that the configuration file does not match the cache. Existing configuration cache files are preserved, but not used.
This differs in two ways from the '--initial' option. First, '--initial' causes all cache files to be deleted. Second, '--initial' forces the management server to re-read the global configuration file and construct a new cache.
If the management server cannot find a global configuration file, then the '--reload' option is ignored.
When '--reload' is used, the management server must be able to communicate with data nodes and any other management servers in the cluster before it attempts to read the global configuration file; otherwise, the management server fails to start. This can happen due to changes in the networking environment, such as new IP addresses for nodes or an altered firewall configuration. In such cases, you must use '--initial' instead to force the exsiting cached configuration to be discarded and reloaded from the file. See *note mysql-cluster-rolling-restart::, for additional information.
'--remove{=name]'
Command-Line Format
'--remove[=name]'
Platform Specific
Windows
Type
String
Default Value
'ndb_mgmd'
Remove a management server process that has been installed as a Windows service, optionally specifying the name of the service to be removed. Applies only to Windows platforms.
'--skip-config-file'
Command-Line Format
'--skip-config-file'
Do not read cluster configuration file; ignore '--initial' and '--reload' options if specified.
'--usage'
Command-Line Format
'--usage'
Display help text and exit; same as '--help'.
'--verbose', '-v'
Command-Line Format
'--verbose'
Remove a management server process that has been installed as a Windows service, optionally specifying the name of the service to be removed. Applies only to Windows platforms.
'--version'
Command-Line Format
'--version'
Display version information and exit.
It is not strictly necessary to specify a connection string when starting the management server. However, if you are using more than one management server, a connection string should be provided and each node in the cluster should specify its node ID explicitly.
See note mysql-cluster-connection-strings::, for information about using connection strings. note mysql-cluster-programs-ndb-mgmd::, describes other options for *note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd.
The following files are created or used by *note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. in its starting directory, and are placed in the 'DataDir' as specified in the 'config.ini' configuration file. In the list that follows, NODE_ID is the unique node identifier.
'config.ini' is the configuration file for the cluster as a whole. This file is created by the user and read by the management server. *note mysql-cluster-configuration::, discusses how to set up this file.
'ndb_NODE_ID_cluster.log' is the cluster events log file. Examples of such events include checkpoint startup and completion, node startup events, node failures, and levels of memory usage. A complete listing of cluster events with descriptions may be found in *note mysql-cluster-management::.
By default, when the size of the cluster log reaches one million bytes, the file is renamed to 'ndb_NODE_ID_cluster.log.SEQ_ID', where SEQ_ID is the sequence number of the cluster log file. (For example: If files with the sequence numbers 1, 2, and 3 already exist, the next log file is named using the number '4'.) You can change the size and number of files, and other characteristics of the cluster log, using the 'LogDestination' configuration parameter.
'ndb_NODE_ID_out.log' is the file used for 'stdout' and 'stderr' when running the management server as a daemon.
'ndb_NODE_ID.pid' is the process ID file used when running the management server as a daemon.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-mgm, Next: mysql-cluster-programs-ndb-blob-tool, Prev: mysql-cluster-programs-ndb-mgmd, Up: mysql-cluster-programs
The note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. management client process is actually not needed to run the cluster. Its value lies in providing a set of commands for checking the cluster's status, starting backups, and performing other administrative functions. The management client accesses the management server using a C API. Advanced users can also employ this API for programming dedicated management processes to perform tasks similar to those performed by note 'ndb_mgm': mysql-cluster-programs-ndb-mgm.
To start the management client, it is necessary to supply the host name and port number of the management server:
$> ndb_mgm [HOST_NAME [PORT_NUM]]
For example:
$> ndb_mgm ndb_mgmd.mysql.com 1186
The default host name and port number are 'localhost' and 1186, respectively.
Options that can be used with *note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndb_mgm
Format Description Added, Deprecated, or Removed
' --character-sets-dir=path '
Directory containing (Supported in all NDB character sets releases based on MySQL 5.7)
' --connect-retry-delay=# '
Number of seconds to (Supported in all NDB wait between attempts releases based on to contact management MySQL 5.7) server
'--connect-string=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --core-file '
Write core file on (Supported in all NDB error; used in releases based on debugging MySQL 5.7)
' --defaults-extra-file=path '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
'--execute=command',
' -e command '
Execute command and (Supported in all NDB exit releases based on MySQL 5.7)
'--help',
' -? '
Display help text and (Supported in all NDB exit releases based on MySQL 5.7)
' --login-path=path '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
'--ndb-connectstring=connection_string',
' -c connection_string '
Set connect string for (Supported in all NDB connecting to releases based on ndb_mgmd. Syntax: MySQL 5.7) "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf
'--ndb-mgmd-host=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --ndb-nodeid=# '
Set node ID for this (Supported in all NDB node, overriding any releases based on ID set by MySQL 5.7) -ndb-connectstring
' --ndb-optimized-node-selection '
Enable optimizations (Supported in all NDB for selection of nodes releases based on for transactions. MySQL 5.7) Enabled by default;
use -skip-ndb-optimized-node-selection to disable
' --no-defaults '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
' --print-defaults '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
'--try-reconnect=#',
' -t # '
Set number of times to (Supported in all NDB retry connection releases based on before giving up; MySQL 5.7) synonym for
-connect-retries
'--usage',
' -? '
Display help text and (Supported in all NDB exit; same as -help releases based on MySQL 5.7)
'--version',
' -V '
Display version (Supported in all NDB information and exit releases based on MySQL 5.7)
'--character-sets-dir'
Command-Line Format
'--character-sets-dir=path'
Directory containing character sets.
'--connect-retries=#'
Command-Line Format
'--connect-retries=#'
Type
Numeric
Default Value
'3'
Minimum Value
'0'
Maximum Value
'4294967295'
This option specifies the number of times following the first attempt to retry a connection before giving up (the client always tries the connection at least once). The length of time to wait per attempt is set using '--connect-retry-delay'.
This option is synonymous with the '--try-reconnect' option, which is now deprecated.
'--connect-retry-delay'
Command-Line Format
'--connect-retry-delay=#'
Type
Integer
Default Value
'5'
Minimum Value
'0'
Maximum Value
'5'
Number of seconds to wait between attempts to contact management server.
'--connect-string'
Command-Line Format
'--connect-string=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--core-file'
Command-Line Format
'--core-file'
Write core file on error; used in debugging.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--execute=command', '-e command'
Command-Line Format
'--execute=command'
This option can be used to send a command to the NDB Cluster management client from the system shell. For example, either of the following is equivalent to executing 'SHOW' in the management client:
$> ndb_mgm -e "SHOW"
$> ndb_mgm --execute="SHOW"
This is analogous to how the '--execute' or '-e' option works with the note 'mysql': mysql. command-line client. See note command-line-options::.
Note:
If the management client command to be passed using this option contains any space characters, then the command must be enclosed in quotation marks. Either single or double quotation marks may be used. If the management client command contains no space characters, the quotation marks are optional.
'--help'
Command-Line Format
'--help'
Display help text and exit.
'--login-path'
Command-Line Format
'--login-path=path'
Type
String
Default Value
'[none]'
Read given path from login file.
'--ndb-connectstring'
Command-Line Format
'--ndb-connectstring=connection_string'
Type
String
Default Value
'[none]'
Set connect string for connecting to *note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. Syntax: ['nodeid=ID;']['host=']'HOSTNAME'[':PORT']. Overrides entries in 'NDB_CONNECTSTRING' and 'my.cnf'.
'--ndb-mgmd-host'
Command-Line Format
'--ndb-mgmd-host=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--ndb-nodeid'
Command-Line Format
'--ndb-nodeid=#'
Type
Integer
Default Value
'[none]'
Set node ID for this node, overriding any ID set by '--ndb-connectstring'.
'--ndb-optimized-node-selection'
Command-Line Format
'--ndb-optimized-node-selection'
Enable optimizations for selection of nodes for transactions. Enabled by default; use '--skip-ndb-optimized-node-selection' to disable.
'--no-defaults'
Command-Line Format
'--no-defaults'
Do not read default options from any option file other than login file.
'--print-defaults'
Command-Line Format
'--print-defaults'
Print program argument list and exit.
'--try-reconnect=NUMBER'
Command-Line Format
'--try-reconnect=#'
Deprecated
Yes
Type (≥ 5.7.10-ndb-7.5.0)
Numeric
Type
Integer
Default Value (≥ 5.7.10-ndb-7.5.0)
'12'
Default Value
'3'
Minimum Value
'0'
Maximum Value
'4294967295'
If the connection to the management server is broken, the node tries to reconnect to it every 5 seconds until it succeeds. By using this option, it is possible to limit the number of attempts to NUMBER before giving up and reporting an error instead.
This option is deprecated and subject to removal in a future release. Use '--connect-retries', instead.
'--usage'
Command-Line Format
'--usage'
Display help text and exit; same as '--help'.
'--version'
Command-Line Format
'--version'
Display version information and exit.
Additional information about using note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. can be found in note mysql-cluster-mgm-client-commands::.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-blob-tool, Next: mysql-cluster-programs-ndb-config, Prev: mysql-cluster-programs-ndb-mgm, Up: mysql-cluster-programs
This tool can be used to check for and remove orphaned BLOB column parts from note 'NDB': mysql-cluster. tables, as well as to generate a file listing any orphaned parts. It is sometimes useful in diagnosing and repairing corrupted or damaged 'NDB' tables containing note 'BLOB': blob. or *note 'TEXT': blob. columns.
The basic syntax for *note 'ndb_blob_tool': mysql-cluster-programs-ndb-blob-tool. is shown here:
ndb_blob_tool [OPTIONS] TABLE [COLUMN, ...]
Unless you use the '--help' option, you must specify an action to be performed by including one or more of the options '--check-orphans', '--delete-orphans', or '--dump-file'. These options cause *note 'ndb_blob_tool': mysql-cluster-programs-ndb-blob-tool. to check for orphaned BLOB parts, remove any orphaned BLOB parts, and generate a dump file listing orphaned BLOB parts, respectively, and are described in more detail later in this section.
You must also specify the name of a table when invoking note 'ndb_blob_tool': mysql-cluster-programs-ndb-blob-tool. In addition, you can optionally follow the table name with the (comma-separated) names of one or more note 'BLOB': blob. or note 'TEXT': blob. columns from that table. If no columns are listed, the tool works on all of the table's note 'BLOB': blob. and *note 'TEXT': blob. columns. If you need to specify a database, use the '--database' ('-d') option.
The '--verbose' option provides additional information in the output about the tool's progress.
Options that can be used with *note 'ndb_blob_tool': mysql-cluster-programs-ndb-blob-tool. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndb_blob_tool
Format Description Added, Deprecated, or Removed
' --add-missing '
Write dummy blob parts ADDED: NDB 7.5.18, NDB to take place of those 7.6.14 which are missing
' --character-sets-dir=path '
Directory containing (Supported in all NDB character sets releases based on MySQL 5.7)
' --check-missing '
Check for blobs having ADDED: NDB 7.5.18, NDB inline parts but 7.6.14 missing one or more
parts from parts table
' --check-orphans '
Check for blob parts (Supported in all NDB having no releases based on corresponding inline MySQL 5.7) parts
' --connect-retries=# '
Number of times to (Supported in all NDB retry connection releases based on before giving up MySQL 5.7)
' --connect-retry-delay=# '
Number of seconds to (Supported in all NDB wait between attempts releases based on to contact management MySQL 5.7) server
'--connect-string=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --core-file '
Write core file on (Supported in all NDB error; used in releases based on debugging MySQL 5.7)
'--database=name',
' -d name '
Database to find the (Supported in all NDB table in releases based on MySQL 5.7)
' --defaults-extra-file=path '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
' --delete-orphans '
Delete blob parts (Supported in all NDB having no releases based on corresponding inline MySQL 5.7) parts
' --dump-file=file '
Write orphan keys to (Supported in all NDB specified file releases based on MySQL 5.7)
'--help',
' -? '
Display help text and (Supported in all NDB exit releases based on MySQL 5.7)
' --login-path=path '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
'--ndb-connectstring=connection_string',
' -c connection_string '
Set connect string for (Supported in all NDB connecting to releases based on ndb_mgmd. Syntax: MySQL 5.7) "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf
'--ndb-mgmd-host=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --ndb-nodeid=# '
Set node ID for this (Supported in all NDB node, overriding any releases based on ID set by MySQL 5.7) -ndb-connectstring
' --ndb-optimized-node-selection '
Enable optimizations (Supported in all NDB for selection of nodes releases based on for transactions. MySQL 5.7) Enabled by default;
use -skip-ndb-optimized-node-selection to disable
' --no-defaults '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
' --print-defaults '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
'--usage',
' -? '
Display help text and (Supported in all NDB exit; same as -help releases based on MySQL 5.7)
'--verbose',
' -v '
Verbose output (Supported in all NDB releases based on MySQL 5.7)
'--version',
' -V '
Display version (Supported in all NDB information and exit releases based on MySQL 5.7)
'--add-missing'
Command-Line Format
'--add-missing'
Introduced
5.7.29-ndb-7.6.14
For each inline part in NDB Cluster tables which has no corresponding BLOB part, write a dummy BLOB part of the required length, consisting of spaces.
'--character-sets-dir'
Command-Line Format
'--character-sets-dir=path'
Directory containing character sets.
'--check-missing'
Command-Line Format
'--check-missing'
Introduced
5.7.29-ndb-7.6.14
Check for inline parts in NDB Cluster tables which have no corresponding BLOB parts.
'--check-orphans'
Command-Line Format
'--check-orphans'
Check for BLOB parts in NDB Cluster tables which have no corresponding inline parts.
'--connect-retries'
Command-Line Format
'--connect-retries=#'
Type
Integer
Default Value
'12'
Minimum Value
'0'
Maximum Value
'12'
Number of times to retry connection before giving up.
'--connect-retry-delay'
Command-Line Format
'--connect-retry-delay=#'
Type
Integer
Default Value
'5'
Minimum Value
'0'
Maximum Value
'5'
Number of seconds to wait between attempts to contact management server.
'--connect-string'
Command-Line Format
'--connect-string=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--core-file'
Command-Line Format
'--core-file'
Write core file on error; used in debugging.
'--database=DB_NAME', '-d'
Command-Line Format
'--database=name'
Type
String
Default Value
'[none]'
Specify the database to find the table in.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--delete-orphans'
Command-Line Format
'--delete-orphans'
Remove BLOB parts from NDB Cluster tables which have no corresponding inline parts.
'--dump-file=FILE'
Command-Line Format
'--dump-file=file'
Type
File name
Default Value
'[none]'
Writes a list of orphaned BLOB column parts to FILE. The information written to the file includes the table key and BLOB part number for each orphaned BLOB part.
'--help'
Command-Line Format
'--help'
Display help text and exit.
'--login-path'
Command-Line Format
'--login-path=path'
Type
String
Default Value
'[none]'
Read given path from login file.
'--ndb-connectstring'
Command-Line Format
'--ndb-connectstring=connection_string'
Type
String
Default Value
'[none]'
Set connect string for connecting to ndb_mgmd. Syntax: "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf.
'--ndb-mgmd-host'
Command-Line Format
'--ndb-mgmd-host=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--ndb-nodeid'
Command-Line Format
'--ndb-nodeid=#'
Type
Integer
Default Value
'[none]'
Set node ID for this node, overriding any ID set by '--ndb-connectstring'.
'--ndb-optimized-node-selection'
Command-Line Format
'--ndb-optimized-node-selection'
Enable optimizations for selection of nodes for transactions. Enabled by default; use '--skip-ndb-optimized-node-selection' to disable.
'--no-defaults'
Command-Line Format
'--no-defaults'
Do not read default options from any option file other than login file.
'--print-defaults'
Command-Line Format
'--print-defaults'
Print program argument list and exit.
'--usage'
Command-Line Format
'--usage'
Display help text and exit; same as '--help'.
'--verbose'
Command-Line Format
'--verbose'
Provide extra information in the tool's output regarding its progress.
'--version'
Command-Line Format
'--version'
Display version information and exit.
Example
First we create an 'NDB' table in the 'test' database, using the *note 'CREATE TABLE': create-table. statement shown here:
USE test;
CREATE TABLE btest (
c0 BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
c1 TEXT,
c2 BLOB
) ENGINE=NDB;
Then we insert a few rows into this table, using a series of statements similar to this one:
INSERT INTO btest VALUES (NULL, 'x', REPEAT('x', 1000));
When run with '--check-orphans' against this table, *note 'ndb_blob_tool': mysql-cluster-programs-ndb-blob-tool. generates the following output:
$> ndb_blob_tool --check-orphans --verbose -d test btest
connected
processing 2 blobs
processing blob #0 c1 NDB$BLOB_19_1
NDB$BLOB_19_1: nextResult: res=1
total parts: 0
orphan parts: 0
processing blob #1 c2 NDB$BLOB_19_2
NDB$BLOB_19_2: nextResult: res=0
NDB$BLOB_19_2: nextResult: res=0
NDB$BLOB_19_2: nextResult: res=0
NDB$BLOB_19_2: nextResult: res=0
NDB$BLOB_19_2: nextResult: res=0
NDB$BLOB_19_2: nextResult: res=0
NDB$BLOB_19_2: nextResult: res=0
NDB$BLOB_19_2: nextResult: res=0
NDB$BLOB_19_2: nextResult: res=0
NDB$BLOB_19_2: nextResult: res=0
NDB$BLOB_19_2: nextResult: res=1
total parts: 10
orphan parts: 0
disconnected
NDBT_ProgramExit: 0 - OK
The tool reports that there are no 'NDB' BLOB column parts associated with column 'c1', even though 'c1' is a note 'TEXT': blob. column. This is due to the fact that, in an note 'NDB': mysql-cluster. table, only the first 256 bytes of a note 'BLOB': blob. or note 'TEXT': blob. column value are stored inline, and only the excess, if any, is stored separately; thus, if there are no values using more than 256 bytes in a given column of one of these types, no 'BLOB' column parts are created by 'NDB' for this column. See *note storage-requirements::, for more information.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-config, Next: mysql-cluster-programs-ndb-cpcd, Prev: mysql-cluster-programs-ndb-blob-tool, Up: mysql-cluster-programs
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'.
*note 'ndb_config': mysql-cluster-programs-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'.
Options that can be used with *note 'ndb_config': mysql-cluster-programs-ndb-config. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndb_config
Format Description Added, Deprecated, or Removed
' --character-sets-dir=path '
Directory containing (Supported in all NDB character sets releases based on MySQL 5.7)
' --config-file=file_name '
Set the path to (Supported in all NDB config.ini file releases based on MySQL 5.7)
' --config-from-node=# '
Obtain configuration (Supported in all NDB data from the node releases based on having this ID (must MySQL 5.7) be a data node)
' --configinfo '
Dumps information (Supported in all NDB about all NDB releases based on configuration MySQL 5.7) parameters in text
format with default, maximum, and minimum values. Use with -xml to obtain XML output
' --connections '
Print information only (Supported in all NDB about connections releases based on specified in [tcp], MySQL 5.7) [tcp default], [sci],
[sci default], [shm], or [shm default] sections of cluster configuration file. Cannot be used with -system or -nodes
' --connect-retries=# '
Number of times to (Supported in all NDB retry connection releases based on before giving up MySQL 5.7)
' --connect-retry-delay=# '
Number of seconds to (Supported in all NDB wait between attempts releases based on to contact management MySQL 5.7) server
'--connect-string=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --core-file '
Write core file on (Supported in all NDB error; used in releases based on debugging MySQL 5.7)
' --defaults-extra-file=path '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
' --diff-default '
Print only ADDED: NDB 7.5.7, NDB configuration 7.6.3 parameters that have
non-default values
'--fields=string',
' -f '
Field separator (Supported in all NDB releases based on MySQL 5.7)
'--help',
' -? '
Display help text and (Supported in all NDB exit releases based on MySQL 5.7)
' --host=name '
Specify host (Supported in all NDB releases based on MySQL 5.7)
' --login-path=path '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
' --mycnf '
Read configuration (Supported in all NDB data from my.cnf file releases based on MySQL 5.7)
'--ndb-connectstring=connection_string',
' -c connection_string '
Set connect string for (Supported in all NDB connecting to releases based on ndb_mgmd. Syntax: MySQL 5.7) "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf
'--ndb-mgmd-host=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --ndb-nodeid=# '
Set node ID for this (Supported in all NDB node, overriding any releases based on ID set by MySQL 5.7) -ndb-connectstring
' --ndb-optimized-node-selection '
Enable optimizations (Supported in all NDB for selection of nodes releases based on for transactions. MySQL 5.7) Enabled by default;
use -skip-ndb-optimized-node-selection to disable
' --no-defaults '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
' --nodeid=# '
Get configuration of (Supported in all NDB node with this ID releases based on MySQL 5.7)
' --nodes '
Print node information (Supported in all NDB ([ndbd] or [ndbd releases based on default] section of MySQL 5.7) cluster configuration
file) only. Cannot be used with -system or -connections
'--query=string',
' -q string '
One or more query (Supported in all NDB options (attributes) releases based on MySQL 5.7)
'--query-all',
' -a '
Dumps all parameters ADDED: NDB 7.4.16, NDB and values to a single 7.5.7 comma-delimited string
' --print-defaults '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
'--rows=string',
' -r string '
Row separator (Supported in all NDB releases based on MySQL 5.7)
' --system '
Print SYSTEM section (Supported in all NDB information only (see releases based on ndb_config -configinfo MySQL 5.7) output). Cannot be
used with -nodes or -connections
' --type=name '
Specify node type (Supported in all NDB releases based on MySQL 5.7)
'--usage',
' -? '
Display help text and (Supported in all NDB exit; same as -help releases based on MySQL 5.7)
'--version',
' -V '
Display version (Supported in all NDB information and exit releases based on MySQL 5.7)
' --configinfo --xml '
Use -xml with (Supported in all NDB -configinfo to obtain releases based on a dump of all NDB MySQL 5.7) configuration parameters in XML format with default, maximum, and minimum values
'--character-sets-dir'
Command-Line Format
'--character-sets-dir=path'
Directory containing character sets.
'--configinfo'
The '--configinfo' option causes note 'ndb_config': mysql-cluster-programs-ndb-config. to dump a list of each NDB Cluster configuration parameter supported by the NDB Cluster distribution of which note 'ndb_config': mysql-cluster-programs-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 used
* The 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:
$> 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.
'--config-file=PATH-TO-FILE'
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 *note 'ndb_config': mysql-cluster-programs-ndb-config. is invoked, then an absolute path must be used.
'--config_from_node=#'
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, *note 'ndb_config': mysql-cluster-programs-ndb-config. fails with an error. (To obtain configuration data from the management node instead, simply omit this option.)
'--connections'
Command-Line Format
'--connections'
Tells note 'ndb_config': mysql-cluster-programs-ndb-config. to print 'CONNECTIONS' information only--that is, information about parameters found in the '[tcp]', '[tcp default]', '[shm]', or '[shm default]' sections of the cluster configuration file (see note mysql-cluster-tcp-definition::, and *note mysql-cluster-shm-definition::, for more information).
This option is mutually exclusive with '--nodes' and '--system'; only one of these 3 options can be used.
'--connect-retries'
Command-Line Format
'--connect-retries=#'
Type
Integer
Default Value
'12'
Minimum Value
'0'
Maximum Value
'12'
Number of times to retry connection before giving up.
'--connect-retry-delay'
Command-Line Format
'--connect-retry-delay=#'
Type
Integer
Default Value
'5'
Minimum Value
'0'
Maximum Value
'5'
Number of seconds to wait between attempts to contact management server.
'--connect-string'
Command-Line Format
'--connect-string=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--core-file'
Command-Line Format
'--core-file'
Write core file on error; used in debugging.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--diff-default'
Command-Line Format
'--diff-default'
Introduced
5.7.18-ndb-7.6.3
Print only configuration parameters that have non-default values.
'--fields=DELIMITER', '-f' DELIMITER
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).
Note:
If the DELIMITER contains spaces or escapes (such as '' for the linefeed character), then it must be quoted.
'--help'
Command-Line Format
'--help'
Display help text and exit.
'--host=HOSTNAME'
Command-Line Format
'--host=name'
Type
String
Default Value
''
Specifies the host name of the node for which configuration information is to be obtained.
Note:
While the hostname 'localhost' usually resolves to the IP address '127.0.0.1', this may not necessarily be true for all operating platforms and configurations. This means that it is possible, when 'localhost' is used in 'config.ini', for note 'ndb_config --host=localhost': mysql-cluster-programs-ndb-config. to fail if note 'ndb_config': mysql-cluster-programs-ndb-config. is run on a different host where 'localhost' resolves to a different address (for example, on some versions of SUSE Linux, this is '127.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 handle 'localhost' in the same fashion.
'--login-path'
Command-Line Format
'--login-path=path'
Type
String
Default Value
'[none]'
Read given path from login file.
'--mycnf'
Command-Line Format
'--mycnf'
Read configuration data from the 'my.cnf' file.
'--ndb-connectstring=CONNECTION_STRING', '-c CONNECTION_STRING'
Command-Line Format
'--ndb-connectstring=connection_string'
Type
String
Default Value
'[none]'
Specifies the connection string to use in connecting to the management server. The format for the connection string is the same as described in *note mysql-cluster-connection-strings::, and defaults to 'localhost:1186'.
'--ndb-mgmd-host'
Command-Line Format
'--ndb-mgmd-host=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--ndb-nodeid'
Command-Line Format
'--ndb-nodeid=#'
Type
Integer
Default Value
'[none]'
Set node ID for this node, overriding any ID set by '--ndb-connectstring'.
'--ndb-optimized-node-selection'
Command-Line Format
'--ndb-optimized-node-selection'
Enable optimizations for selection of nodes for transactions. Enabled by default; use '--skip-ndb-optimized-node-selection' to disable.
'--no-defaults'
Command-Line Format
'--no-defaults'
Do not read default options from any option file other than login file.
'--nodeid=NODE_ID'
Command-Line Format
'--ndb-nodeid=#'
Type
Integer
Default Value
'[none]'
Specify the node ID of the node for which configuration information is to be obtained. Formerly, '--id' could be used as a synonym for this option; in NDB 7.5 and later, the only form accepted is '--nodeid'.
'--nodes'
Command-Line Format
'--nodes'
Tells note 'ndb_config': mysql-cluster-programs-ndb-config. to print information relating only to parameters defined in an '[ndbd]' or '[ndbd default]' section of the cluster configuration file (see note mysql-cluster-ndbd-definition::).
This option is mutually exclusive with '--connections' and '--system'; only one of these 3 options can be used.
'--query=QUERY-OPTIONS', '-q' QUERY-OPTIONS
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', or 'ndb_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', and 'DataDir' for each node.
Formerly, 'id' was accepted as a synonym for 'nodeid', but has been removed in NDB 7.5 and later.
Note:
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.
'--query-all', '-a'
Command-Line Format
'--query-all'
Introduced
5.7.18-ndb-7.5.7
Type
String
Default Value
''
Returns a comma-delimited list of all query options (node attributes; note that this list is a single string.
This option was introduced in NDB 7.5.7 (Bug #60095, Bug #11766869).
'--print-defaults'
Command-Line Format
'--print-defaults'
Print program argument list and exit.
'--rows=SEPARATOR', '-r' SEPARATOR
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.
Note:
If the SEPARATOR contains spaces or escapes (such as '' for the linefeed character), then it must be quoted.
'--system'
Command-Line Format
'--system'
Tells note 'ndb_config': mysql-cluster-programs-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 *note 'ndb_config': mysql-cluster-programs-ndb-config. '--configinfo'.
This option is mutually exclusive with '--nodes' and '--connections'; only one of these 3 options can be used.
'--type=NODE_TYPE'
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', or 'ndb_mgmd') are returned.
'--usage', '--help', or '-?'
Command-Line Format
'--help'
Causes *note 'ndb_config': mysql-cluster-programs-ndb-config. to print a list of available options, and then exit. Synonym for '--help'.
'--version', '-V'
Command-Line Format
'--version'
Causes *note 'ndb_config': mysql-cluster-programs-ndb-config. to print a version information string, and then exit.
'--configinfo' '--xml'
Command-Line Format
'--configinfo --xml'
Cause *note 'ndb_config': mysql-cluster-programs-ndb-config. '--configinfo' to provide output as XML by adding this option. A portion of such output is shown in this example:
$> ndb_config --configinfo --xml
<configvariables protocolversion="1" ndbversionstring="5.7.44-ndb-7.5.36"
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>
Note:
Normally, the XML output produced by *note 'ndb_config': mysql-cluster-programs-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 an 'initial="true"' attribute in the corresponding '' element. In addition, the restart type ('system' or 'node') is also shown; if a given parameter requires a system restart, this is indicated by the presence of a 'restart="system"' attribute in the corresponding '' element. For example, changing the value set for the 'Diskless' parameter requires a system initial restart, as shown here (with the 'restart' and 'initial' 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 '' elements corresponding to parameters which do not require initial restarts; in other words, 'initial="false"' is the default, and the value 'false' should be assumed if the attribute is not present. Similarly, the default restart type is 'node' (that is, an online or 'rolling' restart of the cluster), but the 'restart' attribute is included only if the restart type is 'system' (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 to 'initial', the 'deprecated' attribute is indicated only when the parameter is deprecated, with 'deprecated="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' or 'deprecated' attribute is displayed only for a parameter that requires an intial restart or that is deprecated, the 'mandatory' attribute is included only if the given parameter is actually required.
Important:
The '--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 *note 'ndb_config': mysql-cluster-programs-ndb-config. was compiled. For this reason, no connection to a running NDB Cluster or access to a 'config.ini' or 'my.cnf' file is required for these two options.
Combining other note 'ndb_config': mysql-cluster-programs-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 note 'ndb_config': mysql-cluster-programs-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:
$> ./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:
$> ./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 *note 'ndb_config': mysql-cluster-programs-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 its 'DataMemory' and 'DataDir' parameters:
$> ./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:
$> ./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.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-cpcd, Next: mysql-cluster-programs-ndb-delete-all, Prev: mysql-cluster-programs-ndb-config, Up: mysql-cluster-programs
A utility having this name was formerly part of an internal automated test framework used in testing and debugging NDB Cluster. It is no longer included in NDB Cluster distributions provided by Oracle.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-delete-all, Next: mysql-cluster-programs-ndb-desc, Prev: mysql-cluster-programs-ndb-cpcd, Up: mysql-cluster-programs
note 'ndb_delete_all': mysql-cluster-programs-ndb-delete-all. deletes all rows from the given note 'NDB': mysql-cluster. table. In some cases, this can be much faster than note 'DELETE': delete. or even note 'TRUNCATE TABLE': truncate-table.
Usage
ndb_delete_all -c CONNECTION_STRING TBL_NAME -d DB_NAME
This deletes all rows from the table named TBL_NAME in the database named DB_NAME. It is exactly equivalent to executing 'TRUNCATE DB_NAME.TBL_NAME' in MySQL.
Options that can be used with *note 'ndb_delete_all': mysql-cluster-programs-ndb-delete-all. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndb_delete_all
Format Description Added, Deprecated, or Removed
' --character-sets-dir=path '
Directory containing (Supported in all NDB character sets releases based on MySQL 5.7)
' --connect-retries=# '
Number of times to (Supported in all NDB retry connection releases based on before giving up MySQL 5.7)
' --connect-retry-delay=# '
Number of seconds to (Supported in all NDB wait between attempts releases based on to contact management MySQL 5.7) server
'--connect-string=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --core-file '
Write core file on (Supported in all NDB error; used in releases based on debugging MySQL 5.7)
'--database=name',
'-d name'
Name of the database (Supported in all NDB in which the table is releases based on found MySQL 5.7)
' --defaults-extra-file=path '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
'--diskscan'
Perform disk scan (Supported in all NDB releases based on MySQL 5.7)
'--help',
' -? '
Display help text and (Supported in all NDB exit releases based on MySQL 5.7)
' --login-path=path '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
'--ndb-connectstring=connection_string',
' -c connection_string '
Set connect string for (Supported in all NDB connecting to releases based on ndb_mgmd. Syntax: MySQL 5.7) "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf
'--ndb-mgmd-host=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --ndb-nodeid=# '
Set node ID for this (Supported in all NDB node, overriding any releases based on ID set by MySQL 5.7) -ndb-connectstring
' --ndb-optimized-node-selection '
Enable optimizations (Supported in all NDB for selection of nodes releases based on for transactions. MySQL 5.7) Enabled by default;
use -skip-ndb-optimized-node-selection to disable
' --no-defaults '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
' --print-defaults '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
'--transactional',
' -t '
Perform delete in one (Supported in all NDB single transaction; releases based on possible to run out of MySQL 5.7) operations when used
'--tupscan'
Perform tuple scan (Supported in all NDB releases based on MySQL 5.7)
'--usage',
' -? '
Display help text and (Supported in all NDB exit; same as -help releases based on MySQL 5.7)
'--version',
' -V '
Display version (Supported in all NDB information and exit releases based on MySQL 5.7)
'--character-sets-dir'
Command-Line Format
'--character-sets-dir=path'
Directory containing character sets.
'--connect-retries'
Command-Line Format
'--connect-retries=#'
Type
Integer
Default Value
'12'
Minimum Value
'0'
Maximum Value
'12'
Number of times to retry connection before giving up.
'--connect-retry-delay'
Command-Line Format
'--connect-retry-delay=#'
Type
Integer
Default Value
'5'
Minimum Value
'0'
Maximum Value
'5'
Number of seconds to wait between attempts to contact management server.
'--connect-string'
Command-Line Format
'--connect-string=connection_string'
Type
String
Default Value
'[none]'
Same as -ndb-connectstring.
'--core-file'
Command-Line Format
'--core-file'
Write core file on error; used in debugging.
'--database', '-d'
Command-Line Format
'--database=name'
Type
String
Default Value
'TEST_DB'
Name of the database containing the table to delete from.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--diskscan'
Command-Line Format
'--diskscan'
Run a disk scan.
'--help'
Command-Line Format
'--help'
Display help text and exit.
'--login-path'
Command-Line Format
'--login-path=path'
Type
String
Default Value
'[none]'
Read given path from login file.
'--ndb-connectstring'
Command-Line Format
'--ndb-connectstring=connection_string'
Type
String
Default Value
'[none]'
Set connect string for connecting to ndb_mgmd. Syntax: "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf.
'--ndb-mgmd-host'
Command-Line Format
'--ndb-mgmd-host=connection_string'
Type
String
Default Value
'[none]'
Same as -ndb-connectstring.
'--ndb-nodeid'
Command-Line Format
'--ndb-nodeid=#'
Type
Integer
Default Value
'[none]'
Set node ID for this node, overriding any ID set by -ndb-connectstring.
'--ndb-optimized-node-selection'
Command-Line Format
'--ndb-optimized-node-selection'
Enable optimizations for selection of nodes for transactions. Enabled by default; use '--skip-ndb-optimized-node-selection' to disable.
'--no-defaults'
Command-Line Format
'--no-defaults'
Do not read default options from any option file other than login file.
'--print-defaults'
Command-Line Format
'--print-defaults'
Print program argument list and exit.
'--transactional', '-t'
Use of this option causes the delete operation to be performed as a single transaction.
Warning:
With very large tables, using this option may cause the number of operations available to the cluster to be exceeded.
'--tupscan'
Run a tuple scan.
'--usage'
Command-Line Format
'--usage'
Display help text and exit; same as -help.
'--version'
Command-Line Format
'--version'
Display version information and exit.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-desc, Next: mysql-cluster-programs-ndb-drop-index, Prev: mysql-cluster-programs-ndb-delete-all, Up: mysql-cluster-programs
note 'ndb_desc': mysql-cluster-programs-ndb-desc. provides a detailed description of one or more note 'NDB': mysql-cluster. tables.
Usage
ndb_desc -c CONNECTION_STRING TBL_NAME -d DB_NAME [OPTIONS]
ndb_desc -c CONNECTION_STRING INDEX_NAME -d DB_NAME -t TBL_NAME
Additional options that can be used with *note 'ndb_desc': mysql-cluster-programs-ndb-desc. are listed later in this section.
Sample Output
MySQL table creation and population statements:
USE test;
CREATE TABLE fish (
id INT(11) NOT NULL AUTO_INCREMENT,
name VARCHAR(20) NOT NULL,
length_mm INT(11) NOT NULL,
weight_gm INT(11) NOT NULL,
PRIMARY KEY pk (id),
UNIQUE KEY uk (name)
) ENGINE=NDB;
INSERT INTO fish VALUES
(NULL, 'guppy', 35, 2), (NULL, 'tuna', 2500, 150000),
(NULL, 'shark', 3000, 110000), (NULL, 'manta ray', 1500, 50000),
(NULL, 'grouper', 900, 125000), (NULL ,'puffer', 250, 2500);
Output from *note 'ndb_desc': mysql-cluster-programs-ndb-desc.:
$> ./ndb_desc -c localhost fish -d test -p
-- fish --
Version: 2
Fragment type: HashMapPartition
K Value: 6
Min load factor: 78
Max load factor: 80
Temporary table: no
Number of attributes: 4
Number of primary keys: 1
Length of frm data: 337
Max Rows: 0
Row Checksum: 1
Row GCI: 1
SingleUserMode: 0
ForceVarPart: 1
PartitionCount: 2
FragmentCount: 2
PartitionBalance: FOR_RP_BY_LDM
ExtraRowGciBits: 0
ExtraRowAuthorBits: 0
TableStatus: Retrieved
Table options:
HashMap: DEFAULT-HASHMAP-3840-2
-- Attributes --
id Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR
name Varchar(20;latin1_swedish_ci) NOT NULL AT=SHORT_VAR ST=MEMORY DYNAMIC
length_mm Int NOT NULL AT=FIXED ST=MEMORY DYNAMIC
weight_gm Int NOT NULL AT=FIXED ST=MEMORY DYNAMIC
-- Indexes --
PRIMARY KEY(id) - UniqueHashIndex
PRIMARY(id) - OrderedIndex
uk(name) - OrderedIndex
uk$unique(name) - UniqueHashIndex
-- Per partition info --
Partition Row count Commit count Frag fixed memory Frag varsized memory Extent_space Free extent_space
0 2 2 32768 32768 0 0
1 4 4 32768 32768 0 0
NDBT_ProgramExit: 0 - OK
Information about multiple tables can be obtained in a single invocation of *note 'ndb_desc': mysql-cluster-programs-ndb-desc. by using their names, separated by spaces. All of the tables must be in the same database.
You can obtain additional information about a specific index using the '--table' (short form: '-t') option and supplying the name of the index as the first argument to *note 'ndb_desc': mysql-cluster-programs-ndb-desc, as shown here:
$> ./ndb_desc uk -d test -t fish
-- uk --
Version: 2
Base table: fish
Number of attributes: 1
Logging: 0
Index type: OrderedIndex
Index status: Retrieved
-- Attributes --
name Varchar(20;latin1_swedish_ci) NOT NULL AT=SHORT_VAR ST=MEMORY
-- IndexTable 10/uk --
Version: 2
Fragment type: FragUndefined
K Value: 6
Min load factor: 78
Max load factor: 80
Temporary table: yes
Number of attributes: 2
Number of primary keys: 1
Length of frm data: 0
Max Rows: 0
Row Checksum: 1
Row GCI: 1
SingleUserMode: 2
ForceVarPart: 0
PartitionCount: 2
FragmentCount: 2
FragmentCountType: ONE_PER_LDM_PER_NODE
ExtraRowGciBits: 0
ExtraRowAuthorBits: 0
TableStatus: Retrieved
Table options:
-- Attributes --
name Varchar(20;latin1_swedish_ci) NOT NULL AT=SHORT_VAR ST=MEMORY
NDB$TNODE Unsigned [64] PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
-- Indexes --
PRIMARY KEY(NDB$TNODE) - UniqueHashIndex
NDBT_ProgramExit: 0 - OK
When an index is specified in this way, the '--extra-partition-info' and '--extra-node-info' options have no effect.
The 'Version' column in the output contains the table's schema object version. For information about interpreting this value, see NDB Schema Object Versions (https://dev.mysql.com/doc/ndb-internals/en/ndb-internals-schema-object-versions.html).
Three of the table properties that can be set using 'NDB_TABLE' comments embedded in note 'CREATE TABLE': create-table. and note 'ALTER TABLE': alter-table. statements are also visible in note 'ndb_desc': mysql-cluster-programs-ndb-desc. output. The table's 'FRAGMENT_COUNT_TYPE' is always shown in the 'FragmentCountType' column. 'READ_ONLY' and 'FULLY_REPLICATED', if set to 1, are shown in the 'Table options' column. You can see this after executing the following note 'ALTER TABLE': alter-table. statement in the *note 'mysql': mysql. client:
mysql> ALTER TABLE fish COMMENT='NDB_TABLE=READ_ONLY=1,FULLY_REPLICATED=1';
1 row in set, 1 warning (0.00 sec)
mysql> SHOW WARNINGS\G
+---------+------+---------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+---------------------------------------------------------------------------------------------------------+
| Warning | 1296 | Got error 4503 'Table property is FRAGMENT_COUNT_TYPE=ONE_PER_LDM_PER_NODE but not in comment' from NDB |
+---------+------+---------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
The warning is issued because 'READ_ONLY=1' requires that the table's fragment count type is (or be set to) 'ONE_PER_LDM_PER_NODE_GROUP'; 'NDB' sets this automatically in such cases. You can check that the 'ALTER TABLE' statement has the desired effect using *note 'SHOW CREATE TABLE': show-create-table.:
mysql> SHOW CREATE TABLE fish\G
*************************** 1. row ***************************
Table: fish
Create Table: CREATE TABLE `fish` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL,
`length_mm` int(11) NOT NULL,
`weight_gm` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uk` (`name`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
COMMENT='NDB_TABLE=READ_BACKUP=1,FULLY_REPLICATED=1'
1 row in set (0.01 sec)
Because 'FRAGMENT_COUNT_TYPE' was not set explicitly, its value is not shown in the comment text printed by 'SHOW CREATE TABLE'. *note 'ndb_desc': mysql-cluster-programs-ndb-desc, however, displays the updated value for this attribute. The 'Table options' column shows the binary properties just enabled. You can see this in the output shown here (emphasized text):
$> ./ndb_desc -c localhost fish -d test -p
-- fish --
Version: 4
Fragment type: HashMapPartition
K Value: 6
Min load factor: 78
Max load factor: 80
Temporary table: no
Number of attributes: 4
Number of primary keys: 1
Length of frm data: 380
Max Rows: 0
Row Checksum: 1
Row GCI: 1
SingleUserMode: 0
ForceVarPart: 1
PartitionCount: 1
FragmentCount: 1
_FragmentCountType: ONE_PER_LDM_PER_NODE_GROUP_
ExtraRowGciBits: 0
ExtraRowAuthorBits: 0
TableStatus: Retrieved
_Table options: readbackup, fullyreplicated_
HashMap: DEFAULT-HASHMAP-3840-1
-- Attributes --
id Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR
name Varchar(20;latin1_swedish_ci) NOT NULL AT=SHORT_VAR ST=MEMORY DYNAMIC
length_mm Int NOT NULL AT=FIXED ST=MEMORY DYNAMIC
weight_gm Int NOT NULL AT=FIXED ST=MEMORY DYNAMIC
-- Indexes --
PRIMARY KEY(id) - UniqueHashIndex
PRIMARY(id) - OrderedIndex
uk(name) - OrderedIndex
uk$unique(name) - UniqueHashIndex
-- Per partition info --
Partition Row count Commit count Frag fixed memory Frag varsized memory Extent_space Free extent_space
NDBT_ProgramExit: 0 - OK
For more information about these table properties, see *note create-table-ndb-comment-options::.
The 'Extent_space' and 'Free extent_space' columns are applicable only to 'NDB' tables having columns on disk; for tables having only in-memory columns, these columns always contain the value '0'.
To illustrate their use, we modify the previous example. First, we must create the necessary Disk Data objects, as shown here:
CREATE LOGFILE GROUP lg_1
ADD UNDOFILE 'undo_1.log'
INITIAL_SIZE 16M
UNDO_BUFFER_SIZE 2M
ENGINE NDB;
ALTER LOGFILE GROUP lg_1
ADD UNDOFILE 'undo_2.log'
INITIAL_SIZE 12M
ENGINE NDB;
CREATE TABLESPACE ts_1
ADD DATAFILE 'data_1.dat'
USE LOGFILE GROUP lg_1
INITIAL_SIZE 32M
ENGINE NDB;
ALTER TABLESPACE ts_1
ADD DATAFILE 'data_2.dat'
INITIAL_SIZE 48M
ENGINE NDB;
(For more information on the statements just shown and the objects created by them, see note mysql-cluster-disk-data-objects::, as well as note create-logfile-group::, and *note create-tablespace::.)
Now we can create and populate a version of the 'fish' table that stores 2 of its columns on disk (deleting the previous version of the table first, if it already exists):
CREATE TABLE fish (
id INT(11) NOT NULL AUTO_INCREMENT,
name VARCHAR(20) NOT NULL,
length_mm INT(11) NOT NULL,
weight_gm INT(11) NOT NULL,
PRIMARY KEY pk (id),
UNIQUE KEY uk (name)
) TABLESPACE ts_1 STORAGE DISK
ENGINE=NDB;
INSERT INTO fish VALUES
(NULL, 'guppy', 35, 2), (NULL, 'tuna', 2500, 150000),
(NULL, 'shark', 3000, 110000), (NULL, 'manta ray', 1500, 50000),
(NULL, 'grouper', 900, 125000), (NULL ,'puffer', 250, 2500);
When run against this version of the table, *note 'ndb_desc': mysql-cluster-programs-ndb-desc. displays the following output:
$> ./ndb_desc -c localhost fish -d test -p
-- fish --
Version: 1
Fragment type: HashMapPartition
K Value: 6
Min load factor: 78
Max load factor: 80
Temporary table: no
Number of attributes: 4
Number of primary keys: 1
Length of frm data: 346
Max Rows: 0
Row Checksum: 1
Row GCI: 1
SingleUserMode: 0
ForceVarPart: 1
PartitionCount: 2
FragmentCount: 2
FragmentCountType: ONE_PER_LDM_PER_NODE
ExtraRowGciBits: 0
ExtraRowAuthorBits: 0
TableStatus: Retrieved
Table options:
HashMap: DEFAULT-HASHMAP-3840-2
-- Attributes --
id Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR
name Varchar(20;latin1_swedish_ci) NOT NULL AT=SHORT_VAR ST=MEMORY
length_mm Int NOT NULL AT=FIXED ST=DISK
weight_gm Int NOT NULL AT=FIXED ST=DISK
-- Indexes --
PRIMARY KEY(id) - UniqueHashIndex
PRIMARY(id) - OrderedIndex
uk(name) - OrderedIndex
uk$unique(name) - UniqueHashIndex
-- Per partition info --
Partition Row count Commit count Frag fixed memory Frag varsized memory Extent_space Free extent_space
0 2 2 32768 32768 1048576 1044440
1 4 4 32768 32768 1048576 1044400
NDBT_ProgramExit: 0 - OK
This means that 1048576 bytes are allocated from the tablespace for this table on each partition, of which 1044440 bytes remain free for additional storage. In other words, 1048576 - 1044440 = 4136 bytes per partition is currently being used to store the data from this table's disk-based columns. The number of bytes shown as 'Free extent_space' is available for storing on-disk column data from the 'fish' table only; for this reason, it is not visible when selecting from the Information Schema *note 'FILES': information-schema-files-table. table.
For fully replicated tables, note 'ndb_desc': mysql-cluster-programs-ndb-desc. shows only the nodes holding primary partition fragment replicas; nodes with copy fragment replicas (only) are ignored. Beginning with NDB 7.5.4, you can obtain such information, using the note 'mysql': mysql. client, from the note 'table_distribution_status': mysql-cluster-ndbinfo-table-distribution-status, note 'table_fragments': mysql-cluster-ndbinfo-table-fragments, note 'table_info': mysql-cluster-ndbinfo-table-info, and note 'table_replicas': mysql-cluster-ndbinfo-table-replicas. tables in the *note 'ndbinfo': mysql-cluster-ndbinfo. database.
Options that can be used with *note 'ndb_desc': mysql-cluster-programs-ndb-desc. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndb_desc
Format Description Added, Deprecated, or Removed
'--auto-inc',
' -a '
Show next value for ADDED: NDB 7.6.14 AUTO_INCREMENT oolumn
if table has one
'--blob-info',
' -b '
Include partition (Supported in all NDB information for BLOB releases based on tables in output. MySQL 5.7) Requires that the -p
option also be used
' --character-sets-dir=path '
Directory containing (Supported in all NDB character sets releases based on MySQL 5.7)
' --connect-retries=# '
Number of times to (Supported in all NDB retry connection releases based on before giving up MySQL 5.7)
' --connect-retry-delay=# '
Number of seconds to (Supported in all NDB wait between attempts releases based on to contact management MySQL 5.7) server
'--connect-string=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
'--context',
' -x '
Show extra information ADDED: NDB 7.6.14 for table such as
database, schema, name, and internal ID
' --core-file '
Write core file on (Supported in all NDB error; used in releases based on debugging MySQL 5.7)
'--database=name',
' -d name '
Name of database (Supported in all NDB containing table releases based on MySQL 5.7)
' --defaults-extra-file=path '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
'--extra-node-info',
' -n '
Include (Supported in all NDB partition-to-data-node releases based on mappings in output; MySQL 5.7) requires
-extra-partition-info
'--extra-partition-info',
' -p '
Display information (Supported in all NDB about partitions releases based on MySQL 5.7)
'--help',
' -? '
Display help text and (Supported in all NDB exit releases based on MySQL 5.7)
' --login-path=path '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
'--ndb-connectstring=connection_string',
' -c connection_string '
Set connect string for (Supported in all NDB connecting to releases based on ndb_mgmd. Syntax: MySQL 5.7) "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf
'--ndb-mgmd-host=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --ndb-nodeid=# '
Set node ID for this (Supported in all NDB node, overriding any releases based on ID set by MySQL 5.7) -ndb-connectstring
' --ndb-optimized-node-selection '
Enable optimizations (Supported in all NDB for selection of nodes releases based on for transactions. MySQL 5.7) Enabled by default;
use -skip-ndb-optimized-node-selection to disable
' --no-defaults '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
' --print-defaults '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
'--retries=#',
' -r # '
Number of times to (Supported in all NDB retry the connection releases based on (once per second) MySQL 5.7)
'--table=name',
' -t name '
Specify the table in (Supported in all NDB which to find an releases based on index. When this MySQL 5.7) option is used, -p and
-n have no effect and are ignored
'--unqualified',
' -u '
Use unqualified table (Supported in all NDB names releases based on MySQL 5.7)
'--usage',
' -? '
Display help text and (Supported in all NDB exit; same as -help releases based on MySQL 5.7)
'--version',
' -V '
Display version (Supported in all NDB information and exit releases based on MySQL 5.7)
'--auto-inc', '-a'
Show the next value for a table's 'AUTO_INCREMENT' column, if it has one.
'--blob-info', '-b'
Include information about subordinate note 'BLOB': blob. and note 'TEXT': blob. columns.
Use of this option also requires the use of the '--extra-partition-info' ('-p') option.
'--character-sets-dir'
Command-Line Format
'--character-sets-dir=path'
Directory containing character sets.
'--connect-retries'
Command-Line Format
'--connect-retries=#'
Type
Integer
Default Value
'12'
Minimum Value
'0'
Maximum Value
'12'
Number of times to retry connection before giving up.
'--connect-retry-delay'
Command-Line Format
'--connect-retry-delay=#'
Type
Integer
Default Value
'5'
Minimum Value
'0'
Maximum Value
'5'
Number of seconds to wait between attempts to contact management server.
'--connect-string'
Command-Line Format
'--connect-string=connection_string'
Type
String
Default Value
'[none]'
Same as -ndb-connectstring.
'--context', '-x'
Show additional contextual information for the table such as schema, database name, table name, and the table's internal ID.
'--core-file'
Command-Line Format
'--core-file'
Write core file on error; used in debugging.
'--database=DB_NAME', '-d'
Specify the database in which the table should be found.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--extra-node-info', '-n'
Include information about the mappings between table partitions and the data nodes upon which they reside. This information can be useful for verifying distribution awareness mechanisms and supporting more efficient application access to the data stored in NDB Cluster.
Use of this option also requires the use of the '--extra-partition-info' ('-p') option.
'--extra-partition-info', '-p'
Print additional information about the table's partitions.
'--help'
Command-Line Format
'--help'
Display help text and exit.
'--login-path'
Command-Line Format
'--login-path=path'
Type
String
Default Value
'[none]'
Read given path from login file.
'--ndb-connectstring'
Command-Line Format
'--ndb-connectstring=connection_string'
Type
String
Default Value
'[none]'
Set connect string for connecting to ndb_mgmd. Syntax: "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf.
'--ndb-mgmd-host'
Command-Line Format
'--ndb-mgmd-host=connection_string'
Type
String
Default Value
'[none]'
Same as -ndb-connectstring.
'--ndb-nodeid'
Command-Line Format
'--ndb-nodeid=#'
Type
Integer
Default Value
'[none]'
Set node ID for this node, overriding any ID set by -ndb-connectstring.
'--ndb-optimized-node-selection'
Command-Line Format
'--ndb-optimized-node-selection'
Enable optimizations for selection of nodes for transactions. Enabled by default; use '--skip-ndb-optimized-node-selection' to disable.
'--no-defaults'
Command-Line Format
'--no-defaults'
Do not read default options from any option file other than login file.
'--print-defaults'
Command-Line Format
'--print-defaults'
Print program argument list and exit.
'--retries=#', '-r'
Try to connect this many times before giving up. One connect attempt is made per second.
'--table=TBL_NAME', '-t'
Specify the table in which to look for an index.
'--unqualified', '-u'
Use unqualified table names.
'--usage'
Command-Line Format
'--usage'
Display help text and exit; same as -help.
'--version'
Command-Line Format
'--version'
Display version information and exit.
In NDB 7.5.3 and later, table indexes listed in the output are ordered by ID. Previously, this was not deterministic and could vary between platforms. (Bug #81763, Bug #23547742)
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-drop-index, Next: mysql-cluster-programs-ndb-drop-table, Prev: mysql-cluster-programs-ndb-desc, Up: mysql-cluster-programs
note 'ndb_drop_index': mysql-cluster-programs-ndb-drop-index. drops the specified index from an note 'NDB': mysql-cluster. table. It is recommended that you use this utility only as an example for writing NDB API applications--see the Warning later in this section for details.
Usage
ndb_drop_index -c CONNECTION_STRING TABLE_NAME INDEX -d DB_NAME
The statement shown above drops the index named INDEX from the TABLE in the DATABASE.
Options that can be used with *note 'ndb_drop_index': mysql-cluster-programs-ndb-drop-index. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndb_drop_index
Format Description Added, Deprecated, or Removed
' --character-sets-dir=path '
Directory containing (Supported in all NDB character sets releases based on MySQL 5.7)
' --connect-retries=# '
Number of times to (Supported in all NDB retry connection releases based on before giving up MySQL 5.7)
' --connect-retry-delay=# '
Number of seconds to (Supported in all NDB wait between attempts releases based on to contact management MySQL 5.7) server
'--connect-string=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --core-file '
Write core file on (Supported in all NDB error; used in releases based on debugging MySQL 5.7)
'--database=name',
'-d name'
Name of database in (Supported in all NDB which table is found releases based on MySQL 5.7)
' --defaults-extra-file=path '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
'--help',
' -? '
Display help text and (Supported in all NDB exit releases based on MySQL 5.7)
' --login-path=path '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
'--ndb-connectstring=connection_string',
' -c connection_string '
Set connect string for (Supported in all NDB connecting to releases based on ndb_mgmd. Syntax: MySQL 5.7) "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf
'--ndb-mgmd-host=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --ndb-nodeid=# '
Set node ID for this (Supported in all NDB node, overriding any releases based on ID set by MySQL 5.7) -ndb-connectstring
' --ndb-optimized-node-selection '
Enable optimizations (Supported in all NDB for selection of nodes releases based on for transactions. MySQL 5.7) Enabled by default;
use -skip-ndb-optimized-node-selection to disable
' --no-defaults '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
' --print-defaults '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
'--usage',
' -? '
Display help text and (Supported in all NDB exit; same as -help releases based on MySQL 5.7)
'--version',
' -V '
Display version (Supported in all NDB information and exit releases based on MySQL 5.7)
'--character-sets-dir'
Command-Line Format
'--character-sets-dir=path'
Directory containing character sets.
'--connect-retries'
Command-Line Format
'--connect-retries=#'
Type
Integer
Default Value
'12'
Minimum Value
'0'
Maximum Value
'12'
Number of times to retry connection before giving up.
'--connect-retry-delay'
Command-Line Format
'--connect-retry-delay=#'
Type
Integer
Default Value
'5'
Minimum Value
'0'
Maximum Value
'5'
Number of seconds to wait between attempts to contact management server.
'--connect-string'
Command-Line Format
'--connect-string=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--core-file'
Command-Line Format
'--core-file'
Write core file on error; used in debugging.
'--database', '-d'
Command-Line Format
'--database=name'
Type
String
Default Value
'TEST_DB'
Name of the database in which the table resides.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--help'
Command-Line Format
'--help'
Display help text and exit.
'--login-path'
Command-Line Format
'--login-path=path'
Type
String
Default Value
'[none]'
Read given path from login file.
'--ndb-connectstring'
Command-Line Format
'--ndb-connectstring=connection_string'
Type
String
Default Value
'[none]'
Set connect string for connecting to ndb_mgmd. Syntax: "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf.
'--ndb-mgmd-host'
Command-Line Format
'--ndb-mgmd-host=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--ndb-nodeid'
Command-Line Format
'--ndb-nodeid=#'
Type
Integer
Default Value
'[none]'
Set node ID for this node, overriding any ID set by '--ndb-connectstring'.
'--ndb-optimized-node-selection'
Command-Line Format
'--ndb-optimized-node-selection'
Enable optimizations for selection of nodes for transactions. Enabled by default; use '--skip-ndb-optimized-node-selection' to disable.
'--no-defaults'
Command-Line Format
'--no-defaults'
Do not read default options from any option file other than login file.
'--print-defaults'
Command-Line Format
'--print-defaults'
Print program argument list and exit.
'--usage'
Command-Line Format
'--usage'
Display help text and exit; same as '--help'.
'--version'
Command-Line Format
'--version'
Display version information and exit.
Warning:
Operations performed on Cluster table indexes using the NDB API are not visible to MySQL and make the table unusable by a MySQL server. If you use this program to drop an index, then try to access the table from an SQL node, an error results, as shown here:
$> ./ndb_drop_index -c localhost dogs ix -d ctest1
Dropping index dogs/idx...OK
NDBT_ProgramExit: 0 - OK
$> ./mysql -u jon -p ctest1
Enter password: *******
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 5.7.44-ndb-7.5.36
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> SHOW TABLES;
+------------------+
| Tables_in_ctest1 |
+------------------+
| a |
| bt1 |
| bt2 |
| dogs |
| employees |
| fish |
+------------------+
6 rows in set (0.00 sec)
mysql> SELECT * FROM dogs;
ERROR 1296 (HY000): Got error 4243 'Index not found' from NDBCLUSTER
In such a case, your only option for making the table available to MySQL again is to drop the table and re-create it. You can use either the SQL statementnote 'DROP TABLE': drop-table. or the note 'ndb_drop_table': mysql-cluster-programs-ndb-drop-table. utility (see *note mysql-cluster-programs-ndb-drop-table::) to drop the table.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-drop-table, Next: mysql-cluster-programs-ndb-error-reporter, Prev: mysql-cluster-programs-ndb-drop-index, Up: mysql-cluster-programs
note 'ndb_drop_table': mysql-cluster-programs-ndb-drop-table. drops the specified note 'NDB': mysql-cluster. table. (If you try to use this on a table created with a storage engine other than note 'NDB': mysql-cluster, the attempt fails with the error '723: No such table exists'.) This operation is extremely fast; in some cases, it can be an order of magnitude faster than using a MySQL note 'DROP TABLE': drop-table. statement on an *note 'NDB': mysql-cluster. table.
Usage
ndb_drop_table -c CONNECTION_STRING TBL_NAME -d DB_NAME
Options that can be used with *note 'ndb_drop_table': mysql-cluster-programs-ndb-drop-table. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndb_drop_table
Format Description Added, Deprecated, or Removed
' --character-sets-dir=path '
Directory containing (Supported in all NDB character sets releases based on MySQL 5.7)
' --connect-retries=# '
Number of times to (Supported in all NDB retry connection releases based on before giving up MySQL 5.7)
' --connect-retry-delay=# '
Number of seconds to (Supported in all NDB wait between attempts releases based on to contact management MySQL 5.7) server
'--connect-string=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --core-file '
Write core file on (Supported in all NDB error; used in releases based on debugging MySQL 5.7)
'--database=name',
'-d name'
Name of database in (Supported in all NDB which table is found releases based on MySQL 5.7)
' --defaults-extra-file=path '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
'--help',
' -? '
Display help text and (Supported in all NDB exit releases based on MySQL 5.7)
' --login-path=path '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
'--ndb-connectstring=connection_string',
' -c connection_string '
Set connect string for (Supported in all NDB connecting to releases based on ndb_mgmd. Syntax: MySQL 5.7) "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf
'--ndb-mgmd-host=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --ndb-nodeid=# '
Set node ID for this (Supported in all NDB node, overriding any releases based on ID set by MySQL 5.7) -ndb-connectstring
' --ndb-optimized-node-selection '
Enable optimizations (Supported in all NDB for selection of nodes releases based on for transactions. MySQL 5.7) Enabled by default;
use -skip-ndb-optimized-node-selection to disable
' --no-defaults '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
' --print-defaults '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
'--usage',
' -? '
Display help text and (Supported in all NDB exit; same as -help releases based on MySQL 5.7)
'--version',
' -V '
Display version (Supported in all NDB information and exit releases based on MySQL 5.7)
'--character-sets-dir'
Command-Line Format
'--character-sets-dir=path'
Directory containing character sets.
'--connect-retries'
Command-Line Format
'--connect-retries=#'
Type
Integer
Default Value
'12'
Minimum Value
'0'
Maximum Value
'12'
Number of times to retry connection before giving up.
'--connect-retry-delay'
Command-Line Format
'--connect-retry-delay=#'
Type
Integer
Default Value
'5'
Minimum Value
'0'
Maximum Value
'5'
Number of seconds to wait between attempts to contact management server.
'--connect-string'
Command-Line Format
'--connect-string=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--core-file'
Command-Line Format
'--core-file'
Write core file on error; used in debugging.
'--database', '-d'
Command-Line Format
'--database=name'
Type
String
Default Value
'TEST_DB'
Name of the database in which the table resides.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--help'
Command-Line Format
'--help'
Display help text and exit.
'--login-path'
Command-Line Format
'--login-path=path'
Type
String
Default Value
'[none]'
Read given path from login file.
'--ndb-connectstring'
Command-Line Format
'--ndb-connectstring=connection_string'
Type
String
Default Value
'[none]'
Set connect string for connecting to ndb_mgmd. Syntax: "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf.
'--ndb-mgmd-host'
Command-Line Format
'--ndb-mgmd-host=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--ndb-nodeid'
Command-Line Format
'--ndb-nodeid=#'
Type
Integer
Default Value
'[none]'
Set node ID for this node, overriding any ID set by '--ndb-connectstring'.
'--ndb-optimized-node-selection'
Command-Line Format
'--ndb-optimized-node-selection'
Enable optimizations for selection of nodes for transactions. Enabled by default; use '--skip-ndb-optimized-node-selection' to disable.
'--no-defaults'
Command-Line Format
'--no-defaults'
Do not read default options from any option file other than login file.
'--print-defaults'
Command-Line Format
'--print-defaults'
Print program argument list and exit.
'--usage'
Command-Line Format
'--usage'
Display help text and exit; same as '--help'.
'--version'
Command-Line Format
'--version'
Display version information and exit.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-error-reporter, Next: mysql-cluster-programs-ndb-import, Prev: mysql-cluster-programs-ndb-drop-table, Up: mysql-cluster-programs
*note 'ndb_error_reporter': mysql-cluster-programs-ndb-error-reporter. creates an archive from data node and management node log files that can be used to help diagnose bugs or other problems with a cluster. It is highly recommended that you make use of this utility when filing reports of bugs in NDB Cluster.
Options that can be used with *note 'ndb_error_reporter': mysql-cluster-programs-ndb-error-reporter. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndb_error_reporter
Format Description Added, Deprecated, or Removed
' --connection-timeout=# '
Number of seconds to (Supported in all NDB wait when connecting releases based on to nodes before timing MySQL 5.7) out
' --dry-scp '
Disable scp with (Supported in all NDB remote hosts; used in releases based on testing only MySQL 5.7)
' --fs '
Include file system (Supported in all NDB data in error report; releases based on can use a large amount MySQL 5.7) of disk space
'--help',
' -? '
Display help text and (Supported in all NDB exit releases based on MySQL 5.7)
' --skip-nodegroup=# '
Skip all nodes in the (Supported in all NDB node group having this releases based on ID MySQL 5.7)
Usage
ndb_error_reporter PATH/TO/CONFIG-FILE [USERNAME] [OPTIONS]
This utility is intended for use on a management node host, and requires the path to the management host configuration file (usually named 'config.ini'). Optionally, you can supply the name of a user that is able to access the cluster's data nodes using SSH, to copy the data node log files. *note 'ndb_error_reporter': mysql-cluster-programs-ndb-error-reporter. then includes all of these files in archive that is created in the same directory in which it is run. The archive is named 'ndb_error_report_YYYYMMDDHHMMSS.tar.bz2', where YYYYMMDDHHMMSS is a datetime string.
*note 'ndb_error_reporter': mysql-cluster-programs-ndb-error-reporter. also accepts the options listed here:
'--connection-timeout=TIMEOUT'
Command-Line Format
'--connection-timeout=#'
Type
Integer
Default Value
'0'
Wait this many seconds when trying to connect to nodes before timing out.
'--dry-scp'
Command-Line Format
'--dry-scp'
Run *note 'ndb_error_reporter': mysql-cluster-programs-ndb-error-reporter. without using scp from remote hosts. Used for testing only.
'--fs'
Command-Line Format
'--fs'
Copy the data node file systems to the management host and include them in the archive.
Because data node file systems can be extremely large, even after being compressed, we ask that you please do not send archives created using this option to Oracle unless you are specifically requested to do so.
'--help'
Command-Line Format
'--help'
Display help text and exit.
'--skip-nodegroup=NODEGROUP_ID'
Command-Line Format
'--connection-timeout=#'
Type
Integer
Default Value
'0'
Skip all nodes belong to the node group having the supplied node group ID.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-import, Next: mysql-cluster-programs-ndb-index-stat, Prev: mysql-cluster-programs-ndb-error-reporter, Up: mysql-cluster-programs
note 'ndb_import': mysql-cluster-programs-ndb-import. imports CSV-formatted data, such as that produced by note 'mysqldump': mysqldump. '--tab', directly into 'NDB' using the NDB API. note 'ndb_import': mysql-cluster-programs-ndb-import. requires a connection to an NDB management server (note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd.) to function; it does not require a connection to a MySQL Server.
Usage
ndb_import DB_NAME FILE_NAME OPTIONS
note 'ndb_import': mysql-cluster-programs-ndb-import. requires two arguments. DB_NAME is the name of the database where the table into which to import the data is found; FILE_NAME is the name of the CSV file from which to read the data; this must include the path to this file if it is not in the current directory. The name of the file must match that of the table; the file's extension, if any, is not taken into consideration. Options supported by note 'ndb_import': mysql-cluster-programs-ndb-import. include those for specifying field separators, escapes, and line terminators, and are described later in this section.
*note 'ndb_import': mysql-cluster-programs-ndb-import. rejects any empty lines read from the CSV file.
*note 'ndb_import': mysql-cluster-programs-ndb-import. must be able to connect to an NDB Cluster management server; for this reason, there must be an unused '[api]' slot in the cluster 'config.ini' file.
To duplicate an existing table that uses a different storage engine, such as note 'InnoDB': innodb-storage-engine, as an 'NDB' table, use the note 'mysql': mysql. client to perform a note 'SELECT INTO OUTFILE': select-into. statement to export the existing table to a CSV file, then to execute a note 'CREATE TABLE LIKE': create-table-like. statement to create a new table having the same structure as the existing table, then perform note 'ALTER TABLE ... ENGINE=NDB': alter-table. on the new table; after this, from the system shell, invoke note 'ndb_import': mysql-cluster-programs-ndb-import. to load the data into the new 'NDB' table. For example, an existing 'InnoDB' table named 'myinnodb_table' in a database named 'myinnodb' can be exported into an 'NDB' table named 'myndb_table' in a database named 'myndb' as shown here, assuming that you are already logged in as a MySQL user with the appropriate privileges:
In the *note 'mysql': mysql. client:
mysql> USE myinnodb;
mysql> SELECT * INTO OUTFILE '/tmp/myndb_table.csv'
> FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\'
> LINES TERMINATED BY '\n'
> FROM myinnodbtable;
mysql> CREATE DATABASE myndb;
mysql> USE myndb;
mysql> CREATE TABLE myndb_table LIKE myinnodb.myinnodb_table;
mysql> ALTER TABLE myndb_table ENGINE=NDB;
mysql> EXIT;
Bye
$>
Once the target database and table have been created, a running note 'mysqld': mysqld. is no longer required. You can stop it using note 'mysqladmin shutdown': mysqladmin. or another method before proceeding, if you wish.
In the system shell:
# if you are not already in the MySQL bin directory:
$> cd PATH-TO-MYSQL-BIN-DIR
$> ndb_import myndb /tmp/myndb_table.csv --fields-optionally-enclosed-by='"' \
--fields-terminated-by="," --fields-escaped-by='\\'
The output should resemble what is shown here:
job-1 import myndb.myndb_table from /tmp/myndb_table.csv
job-1 [running] import myndb.myndb_table from /tmp/myndb_table.csv
job-1 [success] import myndb.myndb_table from /tmp/myndb_table.csv
job-1 imported 19984 rows in 0h0m9s at 2277 rows/s
jobs summary: defined: 1 run: 1 with success: 1 with failure: 0
$>
Options that can be used with *note 'ndb_import': mysql-cluster-programs-ndb-import. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndb_import
Format Description Added, Deprecated, or Removed
' --abort-on-error '
Dump core on any fatal ADDED: NDB 7.6.2 error; used for
debugging
' --ai-increment=# '
For table with hidden ADDED: NDB 7.6.2 PK, specify
autoincrement increment. See mysqld
' --ai-offset=# '
For table with hidden ADDED: NDB 7.6.2 PK, specify
autoincrement offset. See mysqld
' --ai-prefetch-sz=# '
For table with hidden ADDED: NDB 7.6.2 PK, specify number of
autoincrement values that are prefetched. See mysqld
' --character-sets-dir=path '
Directory containing ADDED: NDB 7.6.2 character sets
' --connect-retries=# '
Number of times to (Supported in all NDB retry connection releases based on before giving up MySQL 5.7)
' --connect-retry-delay=# '
Number of seconds to ADDED: NDB 7.6.2 wait between attempts
to contact management server
'--connect-string=connection_string',
' -c connection_string '
Same as ADDED: NDB 7.6.2 -ndb-connectstring
' --connections=# '
Number of cluster ADDED: NDB 7.6.2 connections to create
' --continue '
When job fails, ADDED: NDB 7.6.2 continue to next job
' --core-file '
Write core file on ADDED: NDB 7.6.2 error; used in
debugging
' --csvopt=opts '
Shorthand option for ADDED: NDB 7.6.2 setting typical CSV
option values. See documentation for syntax and other information
' --db-workers=# '
Number of threads, per ADDED: NDB 7.6.2 data node, executing
database operations
' --defaults-extra-file=path '
Read given file after ADDED: NDB 7.6.2 global files are read
' --defaults-file=path '
Read default options ADDED: NDB 7.6.2 from given file only
' --defaults-group-suffix=string '
Also read groups with ADDED: NDB 7.6.2 concat(group, suffix)
' --errins-type=name '
Error insert type, for ADDED: NDB 7.6.2 testing purposes; use
"list" to obtain all possible values
' --errins-delay=# '
Error insert delay in ADDED: NDB 7.6.2 milliseconds; random
variation is added
' --fields-enclosed-by=char '
Same as FIELDS ADDED: NDB 7.6.2 ENCLOSED BY option for
LOAD DATA statements. For CSV input this is same as using -fields-optionally-enclosed-by
' --fields-escaped-by=char '
Same as FIELDS ESCAPED ADDED: NDB 7.6.2 BY option for LOAD
DATA statements
' --fields-optionally-enclosed-by=char '
Same as FIELDS ADDED: NDB 7.6.2 OPTIONALLY ENCLOSED BY
option for LOAD DATA statements
' --fields-terminated-by=char '
Same as FIELDS ADDED: NDB 7.6.2 TERMINATED BY option
for LOAD DATA statements
'--help',
' -? '
Display help text and ADDED: NDB 7.6.2 exit
' --idlesleep=# '
Number of milliseconds ADDED: NDB 7.6.2 to sleep waiting for
more to do
' --idlespin=# '
Number of times to ADDED: NDB 7.6.2 retry before idlesleep
' --ignore-lines=# '
Ignore first # lines ADDED: NDB 7.6.2 in input file. Used
to skip a non-data header
' --input-type=name '
Input type: random or ADDED: NDB 7.6.2 csv
' --input-workers=# '
Number of threads ADDED: NDB 7.6.2 processing input.
Must be 2 or more if -input-type is csv
' --keep-state '
State files (except ADDED: NDB 7.6.4 non-empty *.rej files)
are normally removed on job completion. Using this option causes all state files to be preserved instead
' --lines-terminated-by=char '
Same as LINES ADDED: NDB 7.6.2 TERMINATED BY option
for LOAD DATA statements
' --login-path=path '
Read given path from ADDED: NDB 7.6.2 login file
' --max-rows=# '
Import only this ADDED: NDB 7.6.2 number of input data
rows; default is 0, which imports all rows
' --monitor=# '
Periodically print ADDED: NDB 7.6.2 status of running job
if something has changed (status, rejected rows, temporary errors). Value 0 disables. Value 1 prints any change seen. Higher values reduce status printing exponentially up to some pre-defined limit
'--ndb-connectstring=connection_string',
' -c connection_string '
Set connect string for ADDED: NDB 7.6.2 connecting to
ndb_mgmd. Syntax: "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf
'--ndb-mgmd-host=connection_string',
' -c connection_string '
Same as ADDED: NDB 7.6.2 -ndb-connectstring
' --ndb-nodeid=# '
Set node ID for this ADDED: NDB 7.6.2 node, overriding any
ID set by -ndb-connectstring
' --ndb-optimized-node-selection '
Enable optimizations (Supported in all NDB for selection of nodes releases based on for transactions. MySQL 5.7) Enabled by default;
use -skip-ndb-optimized-node-selection to disable
' --no-asynch '
Run database ADDED: NDB 7.6.2 operations as batches,
in single transactions
' --no-defaults '
Do not read default ADDED: NDB 7.6.2 options from any
option file other than login file
' --no-hint '
Tells transaction ADDED: NDB 7.6.2 coordinator not to use
distribution key hint when selecting data node
' --opbatch=# '
A db execution batch ADDED: NDB 7.6.2 is a set of
transactions and operations sent to NDB kernel. This option limits NDB operations (including blob operations) in a db execution batch. Therefore it also limits number of asynch transactions. Value 0 is not valid
' --opbytes=# '
Limit bytes in ADDED: NDB 7.6.2 execution batch
(default 0 = no limit)
' --output-type=name '
Output type: ndb is ADDED: NDB 7.6.2 default, null used for
testing
' --output-workers=# '
Number of threads ADDED: NDB 7.6.2 processing output or
relaying database operations
' --pagesize=# '
Align I/O buffers to ADDED: NDB 7.6.2 given size
' --pagecnt=# '
Size of I/O buffers as ADDED: NDB 7.6.2 multiple of page size.
CSV input worker allocates double-sized buffer
' --polltimeout=# '
Timeout per poll for ADDED: NDB 7.6.2 completed asynchonous
transactions; polling continues until all polls are completed, or error occurs
' --print-defaults '
Print program argument ADDED: NDB 7.6.2 list and exit
' --rejects=# '
Limit number of ADDED: NDB 7.6.2 rejected rows (rows
with permanent error) in data load. Default is 0 which means that any rejected row causes a fatal error. The row exceeding the limit is also added to *.rej
' --resume '
If job aborted ADDED: NDB 7.6.2 (temporary error, user
interrupt), resume with rows not yet processed
' --rowbatch=# '
Limit rows in row ADDED: NDB 7.6.2 queues (default 0 = no
limit); must be 1 or more if -input-type is random
' --rowbytes=# '
Limit bytes in row ADDED: NDB 7.6.2 queues (0 = no limit)
' --state-dir=path '
Where to write state ADDED: NDB 7.6.2 files; currect
directory is default
' --stats '
Save performance ADDED: NDB 7.6.4 related options and
internal statistics in .sto and .stt files. These files are kept on successful completion even if -keep-state is not used
' --tempdelay=# '
Number of milliseconds ADDED: NDB 7.6.2 to sleep between
temporary errors
' --temperrors=# '
Number of times a ADDED: NDB 7.6.2 transaction can fail
due to a temporary error, per execution batch; 0 means any temporary error is fatal. Such errors do not cause any rows to be written to .rej file
'--usage',
' -? '
Display help text and ADDED: NDB 7.6.2 exit; same as -help
'--verbose[=#]',
' -v [#] '
Enable verbose output ADDED: NDB 7.6.2
'--version',
' -V '
Display version ADDED: NDB 7.6.2 information and exit
'--abort-on-error'
Command-Line Format
'--abort-on-error'
Introduced
5.7.18-ndb-7.6.2
Dump core on any fatal error; used for debugging only.
'--ai-increment'=#
Command-Line Format
'--ai-increment=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'1'
Minimum Value
'1'
Maximum Value
'4294967295'
For a table with a hidden primary key, specify the autoincrement increment, like the 'auto_increment_increment' system variable does in the MySQL Server.
'--ai-offset'=#
Command-Line Format
'--ai-offset=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'1'
Minimum Value
'1'
Maximum Value
'4294967295'
For a table with hidden primary key, specify the autoincrement offset. Similar to the 'auto_increment_offset' system variable.
'--ai-prefetch-sz'=#
Command-Line Format
'--ai-prefetch-sz=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'1024'
Minimum Value
'1'
Maximum Value
'4294967295'
For a table with a hidden primary key, specify the number of autoincrement values that are prefetched. Behaves like the 'ndb_autoincrement_prefetch_sz' system variable does in the MySQL Server.
'--character-sets-dir'
Command-Line Format
'--character-sets-dir=path'
Introduced
5.7.18-ndb-7.6.2
Directory containing character sets.
'--connect-retries'
Command-Line Format
'--connect-retries=#'
Type
Integer
Default Value
'12'
Minimum Value
'0'
Maximum Value
'12'
Number of times to retry connection before giving up.
'--connect-retry-delay'
Command-Line Format
'--connect-retry-delay=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'5'
Minimum Value
'0'
Maximum Value
'5'
Number of seconds to wait between attempts to contact management server.
'--connections'=#
Command-Line Format
'--connections=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'1'
Minimum Value
'1'
Maximum Value
'4294967295'
Number of cluster connections to create.
'--connect-string'
Command-Line Format
'--connect-string=connection_string'
Introduced
5.7.18-ndb-7.6.2
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--continue'
Command-Line Format
'--continue'
Introduced
5.7.18-ndb-7.6.2
When a job fails, continue to the next job.
'--core-file'
Command-Line Format
'--core-file'
Introduced
5.7.18-ndb-7.6.2
Write core file on error; used in debugging.
'--csvopt'=STRING
Command-Line Format
'--csvopt=opts'
Introduced
5.7.18-ndb-7.6.2
Type
String
Default Value
'[none]'
Provides a shortcut method for setting typical CSV import options. The argument to this option is a string consisting of one or more of the following parameters:
* 'c': Fields terminated by comma
* 'd': Use defaults, except where overridden by another
parameter
* 'n': Lines terminated by '\n'
* 'q': Fields optionally enclosed by double quote characters
('"')
* 'r': Line terminated by '\r'
The order of the parameters makes no difference, except that if both 'n' and 'r' are specified, the one occurring last is the parameter which takes effect.
This option is intended for use in testing under conditions in which it is difficult to transmit escapes or quotation marks.
'--db-workers'=#
Command-Line Format
'--db-workers=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value (≥ 5.7.20-ndb-7.6.4)
'4'
Default Value (≥ 5.7.18-ndb-7.6.2, <= 5.7.18-ndb-7.6.3)
'1'
Minimum Value
'1'
Maximum Value
'4294967295'
Number of threads, per data node, executing database operations.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Introduced
5.7.18-ndb-7.6.2
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Introduced
5.7.18-ndb-7.6.2
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Introduced
5.7.18-ndb-7.6.2
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--errins-type'=NAME
Command-Line Format
'--errins-type=name'
Introduced
5.7.18-ndb-7.6.2
Type
Enumeration
Default Value
'[none]'
Valid Values
'stopjob' 'stopall' 'sighup' 'sigint' 'list'
Error insert type; use 'list' as the NAME value to obtain all possible values. This option is used for testing purposes only.
'--errins-delay'=#
Command-Line Format
'--errins-delay=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'1000'
Minimum Value
'0'
Maximum Value
'4294967295'
Unit
ms
Error insert delay in milliseconds; random variation is added. This option is used for testing purposes only.
'--fields-enclosed-by'=CHAR
Command-Line Format
'--fields-enclosed-by=char'
Introduced
5.7.18-ndb-7.6.2
Type
String
Default Value
'[none]'
This works in the same way as the 'FIELDS ENCLOSED BY' option does for the *note 'LOAD DATA': load-data. statement, specifying a character to be interpeted as quoting field values. For CSV input, this is the same as '--fields-optionally-enclosed-by'.
'--fields-escaped-by'=NAME
Command-Line Format
'--fields-escaped-by=char'
Introduced
5.7.18-ndb-7.6.2
Type
String
Default Value
''
Specify an escape character in the same way as the 'FIELDS ESCAPED BY' option does for the SQL *note 'LOAD DATA': load-data. statement.
'--fields-optionally-enclosed-by'=CHAR
Command-Line Format
'--fields-optionally-enclosed-by=char'
Introduced
5.7.18-ndb-7.6.2
Type
String
Default Value
'[none]'
This works in the same way as the 'FIELDS OPTIONALLY ENCLOSED BY' option does for the *note 'LOAD DATA': load-data. statement, specifying a character to be interpeted as optionally quoting field values. For CSV input, this is the same as '--fields-enclosed-by'.
'--fields-terminated-by'=CHAR
Command-Line Format
'--fields-terminated-by=char'
Introduced
5.7.18-ndb-7.6.2
Type
String
Default Value
''
This works in the same way as the 'FIELDS TERMINATED BY' option does for the *note 'LOAD DATA': load-data. statement, specifying a character to be interpeted as the field separator.
'--help'
Command-Line Format
'--help'
Introduced
5.7.18-ndb-7.6.2
Display help text and exit.
'--idlesleep'=#
Command-Line Format
'--idlesleep=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'1'
Minimum Value
'1'
Maximum Value
'4294967295'
Unit
ms
Number of milliseconds to sleep waiting for more work to perform.
'--idlespin'=#
Command-Line Format
'--idlespin=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'0'
Minimum Value
'0'
Maximum Value
'4294967295'
Number of times to retry before sleeping.
'--ignore-lines'=#
Command-Line Format
'--ignore-lines=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'0'
Minimum Value
'0'
Maximum Value
'4294967295'
Cause ndb_import to ignore the first # lines of the input file. This can be employed to skip a file header that does not contain any data.
'--input-type'=NAME
Command-Line Format
'--input-type=name'
Introduced
5.7.18-ndb-7.6.2
Type
Enumeration
Default Value
'csv'
Valid Values
'random' 'csv'
Set the type of input type. The default is 'csv'; 'random' is intended for testing purposes only. .
'--input-workers'=#
Command-Line Format
'--input-workers=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value (≥ 5.7.20-ndb-7.6.4)
'4'
Default Value (≥ 5.7.18-ndb-7.6.2, <= 5.7.18-ndb-7.6.3)
'2'
Minimum Value
'1'
Maximum Value
'4294967295'
Set the number of threads processing input.
'--keep-state'
Command-Line Format
'--keep-state'
Introduced
5.7.20-ndb-7.6.4
By default, ndb_import removes all state files (except non-empty '*.rej' files) when it completes a job. Specify this option (nor argument is required) to force the program to retain all state files instead.
'--lines-terminated-by'=NAME
Command-Line Format
'--lines-terminated-by=char'
Introduced
5.7.18-ndb-7.6.2
Type
String
Default Value
''
This works in the same way as the 'LINES TERMINATED BY' option does for the *note 'LOAD DATA': load-data. statement, specifying a character to be interpeted as end-of-line.
'--login-path'
Command-Line Format
'--login-path=path'
Introduced
5.7.18-ndb-7.6.2
Type
String
Default Value
'[none]'
Read given path from login file.
'--log-level'=#
Command-Line Format
'--log-level=#'
Type
Integer
Default Value
'0'
Minimum Value
'0'
Maximum Value
'2'
Performs internal logging at the given level. This option is intended primarily for internal and development use.
In debug builds of NDB only, the logging level can be set using this option to a maximum of 4.
'--max-rows'=#
Command-Line Format
'--max-rows=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'0'
Minimum Value
'0'
Maximum Value
'4294967295'
Unit
bytes
Import only this number of input data rows; the default is 0, which imports all rows.
'--monitor'=#
Command-Line Format
'--monitor=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'2'
Minimum Value
'0'
Maximum Value
'4294967295'
Unit
bytes
Periodically print the status of a running job if something has changed (status, rejected rows, temporary errors). Set to 0 to disable this reporting. Setting to 1 prints any change that is seen. Higher values reduce the frequency of this status reporting.
'--ndb-connectstring'
Command-Line Format
'--ndb-connectstring=connection_string'
Introduced
5.7.18-ndb-7.6.2
Type
String
Default Value
'[none]'
Set connect string for connecting to ndb_mgmd. Syntax: "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf.
'--ndb-mgmd-host'
Command-Line Format
'--ndb-mgmd-host=connection_string'
Introduced
5.7.18-ndb-7.6.2
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--ndb-nodeid'
Command-Line Format
'--ndb-nodeid=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'[none]'
Set node ID for this node, overriding any ID set by '--ndb-connectstring'.
'--ndb-optimized-node-selection'
Command-Line Format
'--ndb-optimized-node-selection'
Enable optimizations for selection of nodes for transactions. Enabled by default; use '--skip-ndb-optimized-node-selection' to disable.
'--no-asynch'
Command-Line Format
'--no-asynch'
Introduced
5.7.18-ndb-7.6.2
Run database operations as batches, in single transactions.
'--no-defaults'
Command-Line Format
'--no-defaults'
Introduced
5.7.18-ndb-7.6.2
Do not read default options from any option file other than login file.
'--no-hint'
Command-Line Format
'--no-hint'
Introduced
5.7.18-ndb-7.6.2
Do not use distribution key hinting to select a data node.
'--opbatch'=#
Command-Line Format
'--opbatch=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'256'
Minimum Value
'1'
Maximum Value
'4294967295'
Unit
bytes
Set a limit on the number of operations (including blob operations), and thus the number of asynchronous transactions, per execution batch.
'--opbytes'=#
Command-Line Format
'--opbytes=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'0'
Minimum Value
'0'
Maximum Value
'4294967295'
Unit
bytes
Set a limit on the number of bytes per execution batch. Use 0 for no limit.
'--output-type'=NAME
Command-Line Format
'--output-type=name'
Introduced
5.7.18-ndb-7.6.2
Type
Enumeration
Default Value
'ndb'
Valid Values
'null'
Set the output type. 'ndb' is the default. 'null' is used only for testing.
'--output-workers'=#
Command-Line Format
'--output-workers=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'2'
Minimum Value
'1'
Maximum Value
'4294967295'
Set the number of threads processing output or relaying database operations.
'--pagesize'=#
Command-Line Format
'--pagesize=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'4096'
Minimum Value
'1'
Maximum Value
'4294967295'
Unit
bytes
Align I/O buffers to the given size.
'--pagecnt'=#
Command-Line Format
'--pagecnt=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'64'
Minimum Value
'1'
Maximum Value
'4294967295'
Set the size of I/O buffers as multiple of page size. The CSV input worker allocates buffer that is doubled in size.
'--polltimeout'=#
Command-Line Format
'--polltimeout=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'1000'
Minimum Value
'1'
Maximum Value
'4294967295'
Unit
ms
Set a timeout per poll for completed asynchonous transactions; polling continues until all polls are completed, or until an error occurs.
'--print-defaults'
Command-Line Format
'--print-defaults'
Introduced
5.7.18-ndb-7.6.2
Print program argument list and exit.
'--rejects'=#
Command-Line Format
'--rejects=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'0'
Minimum Value
'0'
Maximum Value
'4294967295'
Limit the number of rejected rows (rows with permanent errors) in the data load. The default is 0, which means that any rejected row causes a fatal error. Any rows causing the limit to be exceeded are added to the '.rej' file.
The limit imposed by this option is effective for the duration of the current run. A run restarted using '--resume' is considered a 'new' run for this purpose.
'--resume'
Command-Line Format
'--resume'
Introduced
5.7.18-ndb-7.6.2
If a job is aborted (due to a temporary db error or when interrupted by the user), resume with any rows not yet processed.
'--rowbatch'=#
Command-Line Format
'--rowbatch=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'0'
Minimum Value
'0'
Maximum Value
'4294967295'
Unit
rows
Set a limit on the number of rows per row queue. Use 0 for no limit.
'--rowbytes'=#
Command-Line Format
'--rowbytes=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'262144'
Minimum Value
'0'
Maximum Value
'4294967295'
Unit
bytes
Set a limit on the number of bytes per row queue. Use 0 for no limit.
'--stats'
Command-Line Format
'--stats'
Introduced
5.7.20-ndb-7.6.4
Save information about options related to performance and other internal statistics in files named '.sto' and '.stt'. These files are always kept on successful completion (even if '--keep-state' is not also specified).
'--state-dir'=NAME
Command-Line Format
'--state-dir=path'
Introduced
5.7.18-ndb-7.6.2
Type
String
Default Value
'.'
Where to write the state files ('TBL_NAME.map', 'TBL_NAME.rej', 'TBL_NAME.res', and 'TBL_NAME.stt') produced by a run of the program; the default is the current directory.
'--tempdelay'=#
Command-Line Format
'--tempdelay=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'10'
Minimum Value
'0'
Maximum Value
'4294967295'
Unit
ms
Number of milliseconds to sleep between temporary errors.
'--temperrors'=#
Command-Line Format
'--temperrors=#'
Introduced
5.7.18-ndb-7.6.2
Type
Integer
Default Value
'0'
Minimum Value
'0'
Maximum Value
'4294967295'
Number of times a transaction can fail due to a temporary error, per execution batch. The default is 0, which means that any temporary error is fatal. Temporary errors do not cause any rows to be added to the '.rej' file.
'--usage'
Command-Line Format
'--usage'
Introduced
5.7.18-ndb-7.6.2
Display help text and exit; same as '--help'.
'--verbose', '-v'
Command-Line Format
'--verbose[=#]'
Introduced
5.7.18-ndb-7.6.2
Type (≥ 5.7.20-ndb-7.6.4)
Boolean
Type (≥ 5.7.18-ndb-7.6.2, <= 5.7.18-ndb-7.6.3)
Integer
Default Value (≥ 5.7.20-ndb-7.6.4)
'false'
Default Value (≥ 5.7.18-ndb-7.6.2, <= 5.7.18-ndb-7.6.3)
'0'
Minimum Value
'0'
Maximum Value
'2'
Enable verbose output.
Note:
Previously, this option controlled the internal logging level for debugging messages. In NDB 7.6, use the '--log-level' option for this purpose instead.
'--version'
Command-Line Format
'--version'
Introduced
5.7.18-ndb-7.6.2
Display version information and exit.
As with note 'LOAD DATA': load-data, options for field and line formatting much match those used to create the CSV file, whether this was done using note 'SELECT INTO ... OUTFILE': select-into, or by some other means. There is no equivalent to the *note 'LOAD DATA': load-data. statement 'STARTING WITH' option.
*note 'ndb_import': mysql-cluster-programs-ndb-import. was added in NDB 7.6.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-index-stat, Next: mysql-cluster-programs-ndb-move-data, Prev: mysql-cluster-programs-ndb-import, Up: mysql-cluster-programs
*note 'ndb_index_stat': mysql-cluster-programs-ndb-index-stat. provides per-fragment statistical information about indexes on 'NDB' tables. This includes cache version and age, number of index entries per partition, and memory consumption by indexes.
Usage
To obtain basic index statistics about a given note 'NDB': mysql-cluster. table, invoke note 'ndb_index_stat': mysql-cluster-programs-ndb-index-stat. as shown here, with the name of the table as the first argument and the name of the database containing this table specified immediately following it, using the '--database' ('-d') option:
ndb_index_stat TABLE -d DATABASE
In this example, we use *note 'ndb_index_stat': mysql-cluster-programs-ndb-index-stat. to obtain such information about an 'NDB' table named 'mytable' in the 'test' database:
$> ndb_index_stat -d test mytable
table:City index:PRIMARY fragCount:2
sampleVersion:3 loadTime:1399585986 sampleCount:1994 keyBytes:7976
query cache: valid:1 sampleCount:1994 totalBytes:27916
times in ms: save: 7.133 sort: 1.974 sort per sample: 0.000
NDBT_ProgramExit: 0 - OK
'sampleVersion' is the version number of the cache from which the statistics data is taken. Running *note 'ndb_index_stat': mysql-cluster-programs-ndb-index-stat. with the '--update' option causes sampleVersion to be incremented.
'loadTime' shows when the cache was last updated. This is expressed as seconds since the Unix Epoch.
'sampleCount' is the number of index entries found per partition. You can estimate the total number of entries by multiplying this by the number of fragments (shown as 'fragCount').
'sampleCount' can be compared with the cardinality of note 'SHOW INDEX': show-index. or note 'INFORMATION_SCHEMA.STATISTICS': information-schema-statistics-table, although the latter two provide a view of the table as a whole, while *note 'ndb_index_stat': mysql-cluster-programs-ndb-index-stat. provides a per-fragment average.
'keyBytes' is the number of bytes used by the index. In this example, the primary key is an integer, which requires four bytes for each index, so 'keyBytes' can be calculated in this case as shown here:
keyBytes = sampleCount * (4 bytes per index) = 1994 * 4 = 7976
This information can also be obtained using the corresponding column definitions from the Information Schema *note 'COLUMNS': information-schema-columns-table. table (this requires a MySQL Server and a MySQL client application).
'totalBytes' is the total memory consumed by all indexes on the table, in bytes.
Timings shown in the preceding examples are specific to each invocation of *note 'ndb_index_stat': mysql-cluster-programs-ndb-index-stat.
The '--verbose' option provides some additional output, as shown here:
$> ndb_index_stat -d test mytable --verbose
random seed 1337010518
connected
loop 1 of 1
table:mytable index:PRIMARY fragCount:4
sampleVersion:2 loadTime:1336751773 sampleCount:0 keyBytes:0
read stats
query cache created
query cache: valid:1 sampleCount:0 totalBytes:0
times in ms: save: 20.766 sort: 0.001
disconnected
NDBT_ProgramExit: 0 - OK
$>
If the only output from the program is 'NDBT_ProgramExit: 0 - OK', this may indicate that no statistics yet exist. To force them to be created (or updated if they already exist), invoke note 'ndb_index_stat': mysql-cluster-programs-ndb-index-stat. with the '--update' option, or execute note 'ANALYZE TABLE': analyze-table. on the table in the *note 'mysql': mysql. client.
Options
The following table includes options that are specific to the NDB Cluster *note 'ndb_index_stat': mysql-cluster-programs-ndb-index-stat. utility. Additional descriptions are listed following the table.
Command-line options used with the program ndb_index_stat
Format Description Added, Deprecated, or Removed
' --character-sets-dir=path '
Directory containing (Supported in all NDB character sets releases based on MySQL 5.7)
' --connect-retries=# '
Number of times to (Supported in all NDB retry connection releases based on before giving up MySQL 5.7)
' --connect-retry-delay=# '
Number of seconds to (Supported in all NDB wait between attempts releases based on to contact management MySQL 5.7) server
'--connect-string=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --core-file '
Write core file on (Supported in all NDB error; used in releases based on debugging MySQL 5.7)
'--database=name',
' -d name '
Name of database (Supported in all NDB containing table releases based on MySQL 5.7)
' --defaults-extra-file=path '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
' --delete '
Delete index (Supported in all NDB statistics for table, releases based on stopping any MySQL 5.7) auto-update previously
configured
' --dump '
Print query cache (Supported in all NDB releases based on MySQL 5.7)
'--help',
' -? '
Display help text and (Supported in all NDB exit releases based on MySQL 5.7)
' --login-path=path '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
' --loops=# '
Set the number of (Supported in all NDB times to perform given releases based on command; default is 0 MySQL 5.7)
'--ndb-connectstring=connection_string',
' -c connection_string '
Set connect string for (Supported in all NDB connecting to releases based on ndb_mgmd. Syntax: MySQL 5.7) "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf
'--ndb-mgmd-host=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --ndb-nodeid=# '
Set node ID for this (Supported in all NDB node, overriding any releases based on ID set by MySQL 5.7) -ndb-connectstring
' --ndb-optimized-node-selection '
Enable optimizations (Supported in all NDB for selection of nodes releases based on for transactions. MySQL 5.7) Enabled by default;
use -skip-ndb-optimized-node-selection to disable
' --no-defaults '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
' --print-defaults '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
' --query=# '
Perform random range (Supported in all NDB queries on first key releases based on attr (must be int MySQL 5.7) unsigned)
' --sys-drop '
Drop any statistics (Supported in all NDB tables and events in releases based on NDB kernel (all MySQL 5.7) statistics are lost)
' --sys-create '
Create all statistics (Supported in all NDB tables and events in releases based on NDB kernel, if none of MySQL 5.7) them already exist
' --sys-create-if-not-exist '
Create any statistics (Supported in all NDB tables and events in releases based on NDB kernel that do not MySQL 5.7) already exist
' --sys-create-if-not-valid '
Create any statistics (Supported in all NDB tables or events that releases based on do not already exist MySQL 5.7) in the NDB kernel,
after dropping any that are invalid
' --sys-check '
Verify that NDB system (Supported in all NDB index statistics and releases based on event tables exist MySQL 5.7)
' --sys-skip-tables '
Do not apply sys-* (Supported in all NDB options to tables releases based on MySQL 5.7)
' --sys-skip-events '
Do not apply sys-* (Supported in all NDB options to events releases based on MySQL 5.7)
' --update '
Update index (Supported in all NDB statistics for table, releases based on restarting any MySQL 5.7) auto-update previously
configured
'--usage',
' -? '
Display help text and (Supported in all NDB exit; same as -help releases based on MySQL 5.7)
'--verbose',
' -v '
Turn on verbose output (Supported in all NDB releases based on MySQL 5.7)
'--version',
' -V '
Display version (Supported in all NDB information and exit releases based on MySQL 5.7)
'--character-sets-dir'
Command-Line Format
'--character-sets-dir=path'
Directory containing character sets.
'--connect-retries'
Command-Line Format
'--connect-retries=#'
Type
Integer
Default Value
'12'
Minimum Value
'0'
Maximum Value
'12'
Number of times to retry connection before giving up.
'--connect-retry-delay'
Command-Line Format
'--connect-retry-delay=#'
Type
Integer
Default Value
'5'
Minimum Value
'0'
Maximum Value
'5'
Number of seconds to wait between attempts to contact management server.
'--connect-string'
Command-Line Format
'--connect-string=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--core-file'
Command-Line Format
'--core-file'
Write core file on error; used in debugging.
'--database=NAME', '-d NAME'
Command-Line Format
'--database=name'
Type
String
Default Value
'[none]'
Minimum Value
''
Maximum Value
''
The name of the database that contains the table being queried.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--delete'
Command-Line Format
'--delete'
Delete the index statistics for the given table, stopping any auto-update that was previously configured.
'--dump'
Command-Line Format
'--dump'
Dump the contents of the query cache.
'--help'
Command-Line Format
'--help'
Display help text and exit.
'--login-path'
Command-Line Format
'--login-path=path'
Type
String
Default Value
'[none]'
Read given path from login file.
'--loops=#'
Command-Line Format
'--loops=#'
Type
Numeric
Default Value
'0'
Minimum Value
'0'
Maximum Value
'MAX_INT'
Repeat commands this number of times (for use in testing).
'--ndb-connectstring'
Command-Line Format
'--ndb-connectstring=connection_string'
Type
String
Default Value
'[none]'
Set connect string for connecting to ndb_mgmd. Syntax: "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf.
'--ndb-mgmd-host'
Command-Line Format
'--ndb-mgmd-host=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--ndb-nodeid'
Command-Line Format
'--ndb-nodeid=#'
Type
Integer
Default Value
'[none]'
Set node ID for this node, overriding any ID set by '--ndb-connectstring'.
'--ndb-optimized-node-selection'
Command-Line Format
'--ndb-optimized-node-selection'
Enable optimizations for selection of nodes for transactions. Enabled by default; use '--skip-ndb-optimized-node-selection' to disable.
'--no-defaults'
Command-Line Format
'--no-defaults'
Do not read default options from any option file other than login file.
'--print-defaults'
Command-Line Format
'--print-defaults'
Print program argument list and exit.
'--query=#'
Command-Line Format
'--query=#'
Type
Numeric
Default Value
'0'
Minimum Value
'0'
Maximum Value
'MAX_INT'
Perform random range queries on first key attribute (must be int unsigned).
'--sys-drop'
Command-Line Format
'--sys-drop'
Drop all statistics tables and events in the NDB kernel. This causes all statistics to be lost.
'--sys-create'
Command-Line Format
'--sys-create'
Create all statistics tables and events in the NDB kernel. This works only if none of them exist previously.
'--sys-create-if-not-exist'
Command-Line Format
'--sys-create-if-not-exist'
Create any NDB system statistics tables or events (or both) that do not already exist when the program is invoked.
'--sys-create-if-not-valid'
Command-Line Format
'--sys-create-if-not-valid'
Create any NDB system statistics tables or events that do not already exist, after dropping any that are invalid.
'--sys-check'
Command-Line Format
'--sys-check'
Verify that all required system statistics tables and events exist in the NDB kernel.
'--sys-skip-tables'
Command-Line Format
'--sys-skip-tables'
Do not apply any '--sys-*' options to any statistics tables.
'--sys-skip-events'
Command-Line Format
'--sys-skip-events'
Do not apply any '--sys-*' options to any events.
'--update'
Command-Line Format
'--update'
Update the index statistics for the given table, and restart any auto-update that was previously configured.
'--usage'
Command-Line Format
'--usage'
Display help text and exit; same as '--help'.
'--verbose'
Command-Line Format
'--verbose'
Turn on verbose output.
'--version'
Command-Line Format
'--version'
Display version information and exit.
ndb_index_stat system options
The following options are used to generate and update the statistics tables in the NDB kernel. None of these options can be mixed with statistics options (see *note ndb-index-stat-options-statistics::).
'--sys-drop'
'--sys-create'
'--sys-create-if-not-exist'
'--sys-create-if-not-valid'
'--sys-check'
'--sys-skip-tables'
'--sys-skip-events'
ndb_index_stat statistics options
The options listed here are used to generate index statistics. They work with a given table and database. They cannot be mixed with system options (see *note ndb-index-stat-options-system::).
'--database'
'--delete'
'--update'
'--dump'
'--query'
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-move-data, Next: mysql-cluster-programs-ndb-perror, Prev: mysql-cluster-programs-ndb-index-stat, Up: mysql-cluster-programs
*note 'ndb_move_data': mysql-cluster-programs-ndb-move-data. copies data from one NDB table to another.
Usage
The program is invoked with the names of the source and target tables; either or both of these may be qualified optionally with the database name. Both tables must use the NDB storage engine.
ndb_move_data OPTIONS SOURCE TARGET
Options that can be used with *note 'ndb_move_data': mysql-cluster-programs-ndb-move-data. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndb_move_data
Format Description Added, Deprecated, or Removed
' --abort-on-error '
Dump core on permanent (Supported in all NDB error (debug option) releases based on MySQL 5.7)
' --character-sets-dir=path '
Directory where (Supported in all NDB character sets are releases based on MySQL 5.7)
' --connect-retries=# '
Number of times to (Supported in all NDB retry connection releases based on before giving up MySQL 5.7)
' --connect-retry-delay=# '
Number of seconds to (Supported in all NDB wait between attempts releases based on to contact management MySQL 5.7) server
'--connect-string=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --core-file '
Write core file on (Supported in all NDB error; used in releases based on debugging MySQL 5.7)
'--database=name',
' -d name '
Name of database in (Supported in all NDB which table is found releases based on MySQL 5.7)
' --defaults-extra-file=path '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
' --drop-source '
Drop source table (Supported in all NDB after all rows have releases based on been moved MySQL 5.7)
' --error-insert '
Insert random (Supported in all NDB temporary errors (used releases based on in testing) MySQL 5.7)
' --exclude-missing-columns '
Ignore extra columns (Supported in all NDB in source or target releases based on table MySQL 5.7)
'--help',
' -? '
Display help text and (Supported in all NDB exit releases based on MySQL 5.7)
' --login-path=path '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
'--lossy-conversions',
' -l '
Allow attribute data (Supported in all NDB to be truncated when releases based on converted to smaller MySQL 5.7) type
'--ndb-connectstring=connection_string',
' -c connection_string '
Set connect string for (Supported in all NDB connecting to releases based on ndb_mgmd. Syntax: MySQL 5.7) "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf
'--ndb-mgmd-host=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --ndb-nodeid=# '
Set node ID for this (Supported in all NDB node, overriding any releases based on ID set by MySQL 5.7) -ndb-connectstring
' --ndb-optimized-node-selection '
Enable optimizations (Supported in all NDB for selection of nodes releases based on for transactions. MySQL 5.7) Enabled by default;
use -skip-ndb-optimized-node-selection to disable
' --no-defaults '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
' --print-defaults '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
'--promote-attributes',
' -A '
Allow attribute data (Supported in all NDB to be converted to releases based on larger type MySQL 5.7)
' --staging-tries=x[,y[,z]] '
Specify tries on (Supported in all NDB temporary errors; releases based on format is x[,y[,z]] MySQL 5.7) where x=max tries
(0=no limit), y=min delay (ms), z=max delay (ms)
'--usage',
' -? '
Display help text and (Supported in all NDB exit; same as -help releases based on MySQL 5.7)
' --verbose '
Enable verbose (Supported in all NDB messages releases based on MySQL 5.7)
'--version',
' -V '
Display version (Supported in all NDB information and exit releases based on MySQL 5.7)
'--abort-on-error'
Command-Line Format
'--abort-on-error'
Dump core on permanent error (debug option).
'--character-sets-dir'=NAME
Command-Line Format
'--character-sets-dir=path'
Type
String
Default Value
'[none]'
Directory where character sets are.
'--connect-retry-delay'
Command-Line Format
'--connect-retry-delay=#'
Type
Integer
Default Value
'5'
Minimum Value
'0'
Maximum Value
'5'
Number of seconds to wait between attempts to contact management server.
'--connect-retries'
Command-Line Format
'--connect-retries=#'
Type
Integer
Default Value
'12'
Minimum Value
'0'
Maximum Value
'12'
Number of times to retry connection before giving up.
'--connect-string'
Command-Line Format
'--connect-string=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--core-file'
Command-Line Format
'--core-file'
Write core file on error; used in debugging.
'--database'=DBNAME, '-d'
Command-Line Format
'--database=name'
Type
String
Default Value
'TEST_DB'
Name of the database in which the table is found.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--drop-source'
Command-Line Format
'--drop-source'
Drop source table after all rows have been moved.
'--error-insert'
Command-Line Format
'--error-insert'
Insert random temporary errors (testing option).
'--exclude-missing-columns'
Command-Line Format
'--exclude-missing-columns'
Ignore extra columns in source or target table.
'--help'
Command-Line Format
'--help'
Display help text and exit.
'--login-path'
Command-Line Format
'--login-path=path'
Type
String
Default Value
'[none]'
Read given path from login file.
'--lossy-conversions', '-l'
Command-Line Format
'--lossy-conversions'
Allow attribute data to be truncated when converted to a smaller type.
'--ndb-connectstring'
Command-Line Format
'--ndb-connectstring=connection_string'
Type
String
Default Value
'[none]'
Set connect string for connecting to ndb_mgmd. Syntax: "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf.
'--ndb-mgmd-host'
Command-Line Format
'--ndb-mgmd-host=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--ndb-nodeid'
Command-Line Format
'--ndb-nodeid=#'
Type
Integer
Default Value
'[none]'
Set node ID for this node, overriding any ID set by '--ndb-connectstring'.
'--ndb-optimized-node-selection'
Command-Line Format
'--ndb-optimized-node-selection'
Enable optimizations for selection of nodes for transactions. Enabled by default; use '--skip-ndb-optimized-node-selection' to disable.
'--no-defaults'
Command-Line Format
'--no-defaults'
Do not read default options from any option file other than login file.
'--print-defaults'
Command-Line Format
'--print-defaults'
Print program argument list and exit.
'--promote-attributes', '-A'
Command-Line Format
'--promote-attributes'
Allow attribute data to be converted to a larger type.
'--staging-tries'=X[,Y[,Z]]
Command-Line Format
'--staging-tries=x[,y[,z]]'
Type
String
Default Value
'0,1000,60000'
Specify tries on temporary errors. Format is x[,y[,z]] where x=max tries (0=no limit), y=min delay (ms), z=max delay (ms).
'--usage'
Command-Line Format
'--usage'
Display help text and exit; same as '--help'.
'--verbose'
Command-Line Format
'--verbose'
Enable verbose messages.
'--version'
Command-Line Format
'--version'
Display version information and exit.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-perror, Next: mysql-cluster-programs-ndb-print-backup-file, Prev: mysql-cluster-programs-ndb-move-data, Up: mysql-cluster-programs
note 'ndb_perror': mysql-cluster-programs-ndb-perror. shows information about an NDB error, given its error code. This includes the error message, the type of error, and whether the error is permanent or temporary. Added to the MySQL NDB Cluster distribution in NDB 7.6, it is intended as a drop-in replacement for note 'perror': perror. '--ndb'.
Usage
ndb_perror [OPTIONS] ERROR_CODE
*note 'ndb_perror': mysql-cluster-programs-ndb-perror. does not need to access a running NDB Cluster, or any nodes (including SQL nodes). To view information about a given NDB error, invoke the program, using the error code as an argument, like this:
$> ndb_perror 323
NDB error code 323: Invalid nodegroup id, nodegroup already existing: Permanent error: Application error
To display only the error message, invoke *note 'ndb_perror': mysql-cluster-programs-ndb-perror. with the '--silent' option (short form '-s'), as shown here:
$> ndb_perror -s 323
Invalid nodegroup id, nodegroup already existing: Permanent error: Application error
Like note 'perror': perror, note 'ndb_perror': mysql-cluster-programs-ndb-perror. accepts multiple error codes:
$> ndb_perror 321 1001
NDB error code 321: Invalid nodegroup id: Permanent error: Application error
NDB error code 1001: Illegal connect string
Additional program options for *note 'ndb_perror': mysql-cluster-programs-ndb-perror. are described later in this section.
note 'ndb_perror': mysql-cluster-programs-ndb-perror. replaces note 'perror': perror. '--ndb', which is deprecated in NDB 7.6 and subject to removal in a future release of MySQL NDB Cluster. To make substitution easier in scripts and other applications that might depend on note 'perror': perror. for obtaining NDB error information, note 'ndb_perror': mysql-cluster-programs-ndb-perror. supports its own 'dummy' '--ndb' option, which does nothing.
The following table includes all options that are specific to the NDB Cluster program *note 'ndb_perror': mysql-cluster-programs-ndb-perror. Additional descriptions follow the table.
Command-line options used with the program ndb_perror
Format Description Added, Deprecated, or Removed
' --defaults-extra-file=path (https://dev.mysql.com/doc/refman/8.0/en/mysql-cluster-programs-ndb-perror.html#option_ndb_perror_defaults-extra-file) '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path (https://dev.mysql.com/doc/refman/8.0/en/mysql-cluster-programs-ndb-perror.html#option_ndb_perror_defaults-file) '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string (https://dev.mysql.com/doc/refman/8.0/en/mysql-cluster-programs-ndb-perror.html#option_ndb_perror_defaults-group-suffix) '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
'--help',
' -? '
Display help text ADDED: NDB 7.6.4
' --login-path=path (https://dev.mysql.com/doc/refman/8.0/en/mysql-cluster-programs-ndb-perror.html#option_ndb_perror_login-path) '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
' --ndb '
For compatibility with ADDED: NDB 7.6.4 applications depending
on old versions of perror; does nothing
' --no-defaults (https://dev.mysql.com/doc/refman/8.0/en/mysql-cluster-programs-ndb-perror.html#option_ndb_perror_no-defaults) '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
' --print-defaults (https://dev.mysql.com/doc/refman/8.0/en/mysql-cluster-programs-ndb-perror.html#option_ndb_perror_print-defaults) '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
'--silent',
' -s '
Show error message ADDED: NDB 7.6.4 only
'--version',
' -V '
Print program version ADDED: NDB 7.6.4 information and exit
'--verbose',
' -v '
Verbose output; ADDED: NDB 7.6.4 disable with -silent
Additional Options
'--help', '-?'
Command-Line Format
'--help'
Introduced
5.7.19-ndb-7.6.4
Display program help text and exit.
'--ndb'
Command-Line Format
'--ndb'
Introduced
5.7.19-ndb-7.6.4
For compatibility with applications depending on old versions of note 'perror': perror. that use that program's '--ndb' option. The option when used with note 'ndb_perror': mysql-cluster-programs-ndb-perror. does nothing, and is ignored by it.
'--silent', '-s'
Command-Line Format
'--silent'
Introduced
5.7.19-ndb-7.6.4
Show error message only.
'--version', '-V'
Command-Line Format
'--version'
Introduced
5.7.19-ndb-7.6.4
Print program version information and exit.
'--verbose', '-v'
Command-Line Format
'--verbose'
Introduced
5.7.19-ndb-7.6.4
Verbose output; disable with '--silent'.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-print-backup-file, Next: mysql-cluster-programs-ndb-print-file, Prev: mysql-cluster-programs-ndb-perror, Up: mysql-cluster-programs
*note 'ndb_print_backup_file': mysql-cluster-programs-ndb-print-backup-file. obtains diagnostic information from a cluster backup file.
Usage
ndb_print_backup_file FILE_NAME
FILE_NAME is the name of a cluster backup file. This can be any of the files ('.Data', '.ctl', or '.log' file) found in a cluster backup directory. These files are found in the data node's backup directory under the subdirectory 'BACKUP-#', where # is the sequence number for the backup. For more information about cluster backup files and their contents, see *note mysql-cluster-backup-concepts::.
Like note 'ndb_print_schema_file': mysql-cluster-programs-ndb-print-schema-file. and note 'ndb_print_sys_file': mysql-cluster-programs-ndb-print-sys-file. (and unlike most of the other note 'NDB': mysql-cluster. utilities that are intended to be run on a management server host or to connect to a management server) note 'ndb_print_backup_file': mysql-cluster-programs-ndb-print-backup-file. must be run on a cluster data node, since it accesses the data node file system directly. Because it does not make use of the management server, this utility can be used when the management server is not running, and even when the cluster has been completely shut down.
Additional Options
None.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-print-file, Next: mysql-cluster-programs-ndb-print-frag-file, Prev: mysql-cluster-programs-ndb-print-backup-file, Up: mysql-cluster-programs
*note 'ndb_print_file': mysql-cluster-programs-ndb-print-file. obtains information from an NDB Cluster Disk Data file.
Usage
ndb_print_file [-v] [-q] FILE_NAME+
FILE_NAME is the name of an NDB Cluster Disk Data file. Multiple filenames are accepted, separated by spaces.
Like note 'ndb_print_schema_file': mysql-cluster-programs-ndb-print-schema-file. and note 'ndb_print_sys_file': mysql-cluster-programs-ndb-print-sys-file. (and unlike most of the other note 'NDB': mysql-cluster. utilities that are intended to be run on a management server host or to connect to a management server) note 'ndb_print_file': mysql-cluster-programs-ndb-print-file. must be run on an NDB Cluster data node, since it accesses the data node file system directly. Because it does not make use of the management server, this utility can be used when the management server is not running, and even when the cluster has been completely shut down.
Additional Options
*note 'ndb_print_file': mysql-cluster-programs-ndb-print-file. supports the following options:
'-v': Make output verbose.
'-q': Suppress output (quiet mode).
'--help', '-h', '-?': Print help message.
For more information, see *note mysql-cluster-disk-data::.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-print-frag-file, Next: mysql-cluster-programs-ndb-print-schema-file, Prev: mysql-cluster-programs-ndb-print-file, Up: mysql-cluster-programs
*note 'ndb_print_frag_file': mysql-cluster-programs-ndb-print-frag-file. obtains information from a cluster fragment list file. It is intended for use in helping to diagnose issues with data node restarts.
Usage
ndb_print_frag_file FILE_NAME
FILE_NAME is the name of a cluster fragment list file, which matches the pattern 'SX.FragList', where X is a digit in the range 2-9 inclusive, and are found in the data node file system of the data node having the node ID NODEID, in directories named 'ndb_NODEID_fs/DN/DBDIH/', where N is '1' or '2'. Each fragment file contains records of the fragments belonging to each 'NDB' table. For more information about cluster fragment files, see NDB Cluster Data Node File System Directory (https://dev.mysql.com/doc/ndb-internals/en/ndb-internals-ndbd-filesystemdir-files.html).
Like note 'ndb_print_backup_file': mysql-cluster-programs-ndb-print-backup-file, note 'ndb_print_sys_file': mysql-cluster-programs-ndb-print-sys-file, and note 'ndb_print_schema_file': mysql-cluster-programs-ndb-print-schema-file. (and unlike most of the other note 'NDB': mysql-cluster. utilities that are intended to be run on a management server host or to connect to a management server), *note 'ndb_print_frag_file': mysql-cluster-programs-ndb-print-frag-file. must be run on a cluster data node, since it accesses the data node file system directly. Because it does not make use of the management server, this utility can be used when the management server is not running, and even when the cluster has been completely shut down.
Additional Options
None.
Sample Output
$> ndb_print_frag_file /usr/local/mysqld/data/ndb_3_fs/D1/DBDIH/S2.FragList
Filename: /usr/local/mysqld/data/ndb_3_fs/D1/DBDIH/S2.FragList with size 8192
noOfPages = 1 noOfWords = 182
Table Data
----------
Num Frags: 2 NoOfReplicas: 2 hashpointer: 4294967040
kvalue: 6 mask: 0x00000000 method: HashMap
Storage is on Logged and checkpointed, survives SR
------ Fragment with FragId: 0 --------
Preferred Primary: 2 numStoredReplicas: 2 numOldStoredReplicas: 0 distKey: 0 LogPartId: 0
-------Stored Replica----------
Replica node is: 2 initialGci: 2 numCrashedReplicas = 0 nextLcpNo = 1
LcpNo[0]: maxGciCompleted: 1 maxGciStarted: 2 lcpId: 1 lcpStatus: valid
LcpNo[1]: maxGciCompleted: 0 maxGciStarted: 0 lcpId: 0 lcpStatus: invalid
-------Stored Replica----------
Replica node is: 3 initialGci: 2 numCrashedReplicas = 0 nextLcpNo = 1
LcpNo[0]: maxGciCompleted: 1 maxGciStarted: 2 lcpId: 1 lcpStatus: valid
LcpNo[1]: maxGciCompleted: 0 maxGciStarted: 0 lcpId: 0 lcpStatus: invalid
------ Fragment with FragId: 1 --------
Preferred Primary: 3 numStoredReplicas: 2 numOldStoredReplicas: 0 distKey: 0 LogPartId: 1
-------Stored Replica----------
Replica node is: 3 initialGci: 2 numCrashedReplicas = 0 nextLcpNo = 1
LcpNo[0]: maxGciCompleted: 1 maxGciStarted: 2 lcpId: 1 lcpStatus: valid
LcpNo[1]: maxGciCompleted: 0 maxGciStarted: 0 lcpId: 0 lcpStatus: invalid
-------Stored Replica----------
Replica node is: 2 initialGci: 2 numCrashedReplicas = 0 nextLcpNo = 1
LcpNo[0]: maxGciCompleted: 1 maxGciStarted: 2 lcpId: 1 lcpStatus: valid
LcpNo[1]: maxGciCompleted: 0 maxGciStarted: 0 lcpId: 0 lcpStatus: invalid
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-print-schema-file, Next: mysql-cluster-programs-ndb-print-sys-file, Prev: mysql-cluster-programs-ndb-print-frag-file, Up: mysql-cluster-programs
*note 'ndb_print_schema_file': mysql-cluster-programs-ndb-print-schema-file. obtains diagnostic information from a cluster schema file.
Usage
ndb_print_schema_file FILE_NAME
FILE_NAME is the name of a cluster schema file. For more information about cluster schema files, see NDB Cluster Data Node File System Directory (https://dev.mysql.com/doc/ndb-internals/en/ndb-internals-ndbd-filesystemdir-files.html).
Like note 'ndb_print_backup_file': mysql-cluster-programs-ndb-print-backup-file. and note 'ndb_print_sys_file': mysql-cluster-programs-ndb-print-sys-file. (and unlike most of the other note 'NDB': mysql-cluster. utilities that are intended to be run on a management server host or to connect to a management server) note 'ndb_print_schema_file': mysql-cluster-programs-ndb-print-schema-file. must be run on a cluster data node, since it accesses the data node file system directly. Because it does not make use of the management server, this utility can be used when the management server is not running, and even when the cluster has been completely shut down.
Additional Options
None.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-print-sys-file, Next: mysql-cluster-programs-ndb-redo-log-reader, Prev: mysql-cluster-programs-ndb-print-schema-file, Up: mysql-cluster-programs
*note 'ndb_print_sys_file': mysql-cluster-programs-ndb-print-sys-file. obtains diagnostic information from an NDB Cluster system file.
Usage
ndb_print_sys_file FILE_NAME
FILE_NAME is the name of a cluster system file (sysfile). Cluster system files are located in a data node's data directory ('DataDir'); the path under this directory to system files matches the pattern 'ndb_#_fs/D#/DBDIH/P#.sysfile'. In each case, the # represents a number (not necessarily the same number). For more information, see NDB Cluster Data Node File System Directory (https://dev.mysql.com/doc/ndb-internals/en/ndb-internals-ndbd-filesystemdir-files.html).
Like note 'ndb_print_backup_file': mysql-cluster-programs-ndb-print-backup-file. and note 'ndb_print_schema_file': mysql-cluster-programs-ndb-print-schema-file. (and unlike most of the other note 'NDB': mysql-cluster. utilities that are intended to be run on a management server host or to connect to a management server) note 'ndb_print_backup_file': mysql-cluster-programs-ndb-print-backup-file. must be run on a cluster data node, since it accesses the data node file system directly. Because it does not make use of the management server, this utility can be used when the management server is not running, and even when the cluster has been completely shut down.
Additional Options
None.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-redo-log-reader, Next: mysql-cluster-programs-ndb-restore, Prev: mysql-cluster-programs-ndb-print-sys-file, Up: mysql-cluster-programs
Reads a redo log file, checking it for errors, printing its contents in a human-readable format, or both. *note 'ndb_redo_log_reader': mysql-cluster-programs-ndb-redo-log-reader. is intended for use primarily by NDB Cluster developers and Support personnel in debugging and diagnosing problems.
This utility remains under development, and its syntax and behavior are subject to change in future NDB Cluster releases.
The C++ source files for *note 'ndb_redo_log_reader': mysql-cluster-programs-ndb-redo-log-reader. can be found in the directory '/storage/ndb/src/kernel/blocks/dblqh/redoLogReader'.
Options that can be used with *note 'ndb_redo_log_reader': mysql-cluster-programs-ndb-redo-log-reader. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndb_redo_log_reader
Format Description Added, Deprecated, or Removed
' -dump '
Print dump info (Supported in all NDB releases based on MySQL 5.7)
' -filedescriptors '
Print file descriptors (Supported in all NDB only releases based on MySQL 5.7)
' --help '
Print usage (Supported in all NDB information (has no releases based on short form) MySQL 5.7)
' -lap '
Provide lap info, with (Supported in all NDB max GCI started and releases based on completed MySQL 5.7)
' -mbyte # '
Starting megabyte (Supported in all NDB releases based on MySQL 5.7)
' -mbyteheaders '
Show only first page (Supported in all NDB header of each releases based on megabyte in file MySQL 5.7)
' -nocheck '
Do not check records (Supported in all NDB for errors releases based on MySQL 5.7)
' -noprint '
Do not print records (Supported in all NDB releases based on MySQL 5.7)
' -page # '
Start with this page (Supported in all NDB releases based on MySQL 5.7)
' -pageheaders '
Show page headers only (Supported in all NDB releases based on MySQL 5.7)
' -pageindex # '
Start with this page (Supported in all NDB index releases based on MySQL 5.7)
' -twiddle '
Bit-shifted dump (Supported in all NDB releases based on MySQL 5.7)
Usage
ndb_redo_log_reader FILE_NAME [OPTIONS]
FILE_NAME is the name of a cluster redo log file. redo log files are located in the numbered directories under the data node's data directory ('DataDir'); the path under this directory to the redo log files matches the pattern 'ndb_NODEID_fs/D#/DBLQH/S#.FragLog'. NODEID is the data node's node ID. The two instances of # each represent a number (not necessarily the same number); the number following 'D' is in the range 8-39 inclusive; the range of the number following 'S' varies according to the value of the 'NoOfFragmentLogFiles' configuration parameter, whose default value is 16; thus, the default range of the number in the file name is 0-15 inclusive. For more information, see NDB Cluster Data Node File System Directory (https://dev.mysql.com/doc/ndb-internals/en/ndb-internals-ndbd-filesystemdir-files.html).
The name of the file to be read may be followed by one or more of the options listed here:
'-dump'
Command-Line Format
'-dump'
Print dump info.
Command-Line Format
'-filedescriptors'
'-filedescriptors': Print file descriptors only.
Command-Line Format
'--help'
'--help': Print usage information.
'-lap'
Command-Line Format
'-lap'
Provide lap info, with max GCI started and completed.
Command-Line Format
'-mbyte #'
Type
Numeric
Default Value
'0'
Minimum Value
'0'
Maximum Value
'15'
'-mbyte #': Starting megabyte.
# is an integer in the range 0 to 15, inclusive.
Command-Line Format
'-mbyteheaders'
'-mbyteheaders': Show only the first page header of every megabyte in the file.
Command-Line Format
'-noprint'
'-noprint': Do not print the contents of the log file.
Command-Line Format
'-nocheck'
'-nocheck': Do not check the log file for errors.
Command-Line Format
'-page #'
Type
Integer
Default Value
'0'
Minimum Value
'0'
Maximum Value
'31'
'-page #': Start at this page.
# is an integer in the range 0 to 31, inclusive.
Command-Line Format
'-pageheaders'
'-pageheaders': Show page headers only.
Command-Line Format
'-pageindex #'
Type
Integer
Default Value
'12'
Minimum Value
'12'
Maximum Value
'8191'
'-pageindex #': Start at this page index.
# is an integer between 12 and 8191, inclusive.
'-twiddle'
Command-Line Format
'-twiddle'
Bit-shifted dump.
Like note 'ndb_print_backup_file': mysql-cluster-programs-ndb-print-backup-file. and note 'ndb_print_schema_file': mysql-cluster-programs-ndb-print-schema-file. (and unlike most of the note 'NDB': mysql-cluster. utilities that are intended to be run on a management server host or to connect to a management server) note 'ndb_redo_log_reader': mysql-cluster-programs-ndb-redo-log-reader. must be run on a cluster data node, since it accesses the data node file system directly. Because it does not make use of the management server, this utility can be used when the management server is not running, and even when the cluster has been completely shut down.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-restore, Next: mysql-cluster-programs-ndb-select-all, Prev: mysql-cluster-programs-ndb-redo-log-reader, Up: mysql-cluster-programs
Menu:
ndb-restore-different-number-nodes:: Restoring to a different number of data nodes
The NDB Cluster restoration program is implemented as a separate command-line utility *note 'ndb_restore': mysql-cluster-programs-ndb-restore, which can normally be found in the MySQL 'bin' directory. This program reads the files created as a result of the backup and inserts the stored information into the database.
Note:
Beginning with NDB 7.5.15 and 7.6.11, this program no longer prints 'NDBT_ProgramExit: ...' when it finishes its run. Applications depending on this behavior should be modified accordingly when upgrading from earlier releases.
note 'ndb_restore': mysql-cluster-programs-ndb-restore. must be executed once for each of the backup files that were created by the note 'START BACKUP': mysql-cluster-backup-using-management-client. command used to create the backup (see *note mysql-cluster-backup-using-management-client::). This is equal to the number of data nodes in the cluster at the time that the backup was created.
Note:
Before using note 'ndb_restore': mysql-cluster-programs-ndb-restore, it is recommended that the cluster be running in single user mode, unless you are restoring multiple data nodes in parallel. See note mysql-cluster-single-user-mode::, for more information.
Options that can be used with *note 'ndb_restore': mysql-cluster-programs-ndb-restore. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndb_restore
Format Description Added, Deprecated, or Removed
' --allow-pk-changes[=0|1] '
Allow changes to set ADDED: NDB 7.6.14 of columns making up
table's primary key
' --append '
Append data to (Supported in all NDB tab-delimited file releases based on MySQL 5.7)
' --backup-path=path '
Path to backup files (Supported in all NDB directory releases based on MySQL 5.7)
'--backupid=#',
' -b # '
Restore from backup (Supported in all NDB having this ID releases based on MySQL 5.7)
' --character-sets-dir=path '
Directory containing (Supported in all NDB character sets releases based on MySQL 5.7)
'--connect=connection_string',
' -c connection_string '
Alias for (Supported in all NDB -connectstring releases based on MySQL 5.7)
' --connect-retries=# '
Number of times to (Supported in all NDB retry connection releases based on before giving up MySQL 5.7)
' --connect-retry-delay=# '
Number of seconds to (Supported in all NDB wait between attempts releases based on to contact management MySQL 5.7) server
'--connect-string=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --core-file '
Write core file on (Supported in all NDB error; used in releases based on debugging MySQL 5.7)
' --defaults-extra-file=path '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
' --disable-indexes '
Causes indexes from (Supported in all NDB backup to be ignored; releases based on may decrease time MySQL 5.7) needed to restore data
'--dont-ignore-systab-0',
' -f '
Do not ignore system (Supported in all NDB table during restore; releases based on experimental only; not MySQL 5.7) for production use
' --exclude-databases=list '
List of one or more (Supported in all NDB databases to exclude releases based on (includes those not MySQL 5.7) named)
' --exclude-intermediate-sql-tables[=TRUE|FALSE] '
Do not restore any (Supported in all NDB intermediate tables releases based on (having names prefixed MySQL 5.7) with '#sql-') that
were left over from copying ALTER TABLE operations; specify FALSE to restore such tables
' --exclude-missing-columns '
Causes columns from (Supported in all NDB backup version of releases based on table that are missing MySQL 5.7) from version of table
in database to be ignored
' --exclude-missing-tables '
Causes tables from (Supported in all NDB backup that are releases based on missing from database MySQL 5.7) to be ignored
' --exclude-tables=list '
List of one or more (Supported in all NDB tables to exclude releases based on (includes those in MySQL 5.7) same database that are
not named); each table reference must include database name
' --fields-enclosed-by=char '
Fields are enclosed by (Supported in all NDB this character releases based on MySQL 5.7)
' --fields-optionally-enclosed-by '
Fields are optionally (Supported in all NDB enclosed by this releases based on character MySQL 5.7)
' --fields-terminated-by=char '
Fields are terminated (Supported in all NDB by this character releases based on MySQL 5.7)
'--help',
' -? '
Display help text and (Supported in all NDB exit releases based on MySQL 5.7)
' --hex '
Print binary types in (Supported in all NDB hexadecimal format releases based on MySQL 5.7)
' --ignore-extended-pk-updates[=0|1] '
Ignore log entries ADDED: NDB 7.6.14 containing updates to
columns now included in extended primary key
' --include-databases=list '
List of one or more (Supported in all NDB databases to restore releases based on (excludes those not MySQL 5.7) named)
' --include-tables=list '
List of one or more (Supported in all NDB tables to restore releases based on (excludes those in MySQL 5.7) same database that are
not named); each table reference must include database name
' --lines-terminated-by=char '
Lines are terminated (Supported in all NDB by this character releases based on MySQL 5.7)
' --login-path=path '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
'--lossy-conversions',
' -L '
Allow lossy (Supported in all NDB conversions of column releases based on values (type demotions MySQL 5.7) or changes in sign)
when restoring data from backup
' --no-binlog '
If mysqld is connected (Supported in all NDB and using binary releases based on logging, do not log MySQL 5.7) restored data
' --no-defaults '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
'--no-restore-disk-objects',
' -d '
Do not restore objects (Supported in all NDB relating to Disk Data releases based on MySQL 5.7)
'--no-upgrade',
' -u '
Do not upgrade array (Supported in all NDB type for varsize releases based on attributes which do MySQL 5.7) not already resize VAR
data, and do not change column attributes
'--ndb-connectstring=connection_string',
' -c connection_string '
Set connect string for (Supported in all NDB connecting to releases based on ndb_mgmd. Syntax: MySQL 5.7) "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf
'--ndb-mgmd-host=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
'--ndb-nodegroup-map=map',
' -z '
Specify node group (Supported in all NDB map; unused, releases based on unsupported MySQL 5.7)
' --ndb-nodeid=# '
Set node ID for this (Supported in all NDB node, overriding any releases based on ID set by MySQL 5.7) -ndb-connectstring
' --ndb-optimized-node-selection '
Enable optimizations (Supported in all NDB for selection of nodes releases based on for transactions. MySQL 5.7) Enabled by default;
use -skip-ndb-optimized-node-selection to disable
'--nodeid=#',
' -n # '
ID of node where (Supported in all NDB backup was taken releases based on MySQL 5.7)
' --num-slices=# '
Number of slices to ADDED: NDB 7.6.13 apply when restoring
by slice
'--parallelism=#',
' -p # '
Number of parallel (Supported in all NDB transactions to use releases based on while restoring data MySQL 5.7)
'--preserve-trailing-spaces',
' -P '
Allow preservation of (Supported in all NDB trailing spaces releases based on (including padding) MySQL 5.7) when promoting
fixed-width string types to variable-width types
' --print '
Print metadata, data, (Supported in all NDB and log to stdout releases based on (equivalent to MySQL 5.7) -print-meta
-print-data -print-log)
' --print-data '
Print data to stdout (Supported in all NDB releases based on MySQL 5.7)
' --print-defaults '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
' --print-log '
Print log to stdout (Supported in all NDB releases based on MySQL 5.7)
' --print-meta '
Print metadata to (Supported in all NDB stdout releases based on MySQL 5.7)
' --print-sql-log '
Write SQL log to ADDED: NDB 7.5.4 stdout
' --progress-frequency=# '
Print status of (Supported in all NDB restore each given releases based on number of seconds MySQL 5.7)
'--promote-attributes',
' -A '
Allow attributes to be (Supported in all NDB promoted when releases based on restoring data from MySQL 5.7) backup
' --rebuild-indexes '
Causes multithreaded (Supported in all NDB rebuilding of ordered releases based on indexes found in MySQL 5.7) backup; number of
threads used is determined by setting BuildIndexThreads
' --remap-column=string '
Apply offset to value ADDED: NDB 7.6.14 of specified column
using indicated function and arguments. Format is [db].[tbl].[col]:[fn]:[args]; see documentation for details
'--restore-data',
' -r '
Restore table data and (Supported in all NDB logs into NDB Cluster releases based on using NDB API MySQL 5.7)
'--restore-epoch',
' -e '
Restore epoch info (Supported in all NDB into status table; releases based on useful on replica MySQL 5.7) cluster for starting
replication; updates or inserts row in mysql.ndb_apply_status with ID 0
'--restore-meta',
' -m '
Restore metadata to (Supported in all NDB NDB Cluster using NDB releases based on API MySQL 5.7)
' --restore-privilege-tables '
Restore MySQL (Supported in all NDB privilege tables that releases based on were previously moved MySQL 5.7) to NDB
' --rewrite-database=string '
Restore to differently (Supported in all NDB named database; format releases based on is olddb,newdb MySQL 5.7)
' --skip-broken-objects '
Ignore missing blob (Supported in all NDB tables in backup file releases based on MySQL 5.7)
'--skip-table-check',
' -s '
Skip table structure (Supported in all NDB check during restore releases based on MySQL 5.7)
' --skip-unknown-objects '
Causes schema objects (Supported in all NDB not recognized by releases based on ndb_restore to be MySQL 5.7) ignored when restoring
backup made from newer NDB version to older version
' --slice-id=# '
Slice ID, when ADDED: NDB 7.6.13 restoring by slices
'--tab=path',
' -T path '
Creates a (Supported in all NDB tab-separated .txt releases based on file for each table in MySQL 5.7) path provided
' --timestamp-printouts{=true|false} '
Prefix all info, ADDED: NDB 7.5.30, error, and debug log 5.7.41-ndb-7.6.26 messages with
timestamps
'--usage',
' -? '
Display help text and (Supported in all NDB exit; same as -help releases based on MySQL 5.7)
' --verbose=# '
Level of verbosity in (Supported in all NDB output releases based on MySQL 5.7)
'--version',
' -V '
Display version (Supported in all NDB information and exit releases based on MySQL 5.7)
'--allow-pk-changes'
Command-Line Format
'--allow-pk-changes[=0|1]'
Introduced
5.7.29-ndb-7.6.14
Type
Integer
Default Value
'0'
Minimum Value
'0'
Maximum Value
'1'
When this option is set to '1', note 'ndb_restore': mysql-cluster-programs-ndb-restore. allows the primary keys in a table definition to differ from that of the same table in the backup. This may be desirable when backing up and restoring between different schema versions with primary key changes on one or more tables, and it appears that performing the restore operation using ndb_restore is simpler or mor efficient than issuing many note 'ALTER TABLE': alter-table. statements after restoring table schemas and data.
The following changes in primary key definitions are supported by '--allow-pk-changes':
* *Extending the primary key*: A non-nullable column that exists
in the table schema in the backup becomes part of the table's
primary key in the database.
*Important*:
When extending a table's primary key, any columns which become
part of primary key must not be updated while the backup is
being taken; any such updates discovered by *note
'ndb_restore': mysql-cluster-programs-ndb-restore. cause the
restore operation to fail, even when no change in value takes
place. In some cases, it may be possible to override this
behavior using the '--ignore-extended-pk-updates' option; see
the description of this option for more information.
* *Contracting the primary key (1)*: A column that is already
part of the table's primary key in the backup schema is no
longer part of the primary key, but remains in the table.
* *Contracting the primary key (2)*: A column that is already
part of the table's primary key in the backup schema is
removed from the table entirely.
These differences can be combined with other schema differences supported by *note 'ndb_restore': mysql-cluster-programs-ndb-restore, including changes to blob and text columns requiring the use of staging tables.
Basic steps in a typical scenario using primary key schema changes are listed here:
Restore table schemas using *note 'ndb_restore': mysql-cluster-programs-ndb-restore. '--restore-meta'
Alter schema to that desired, or create it
Back up the desired schema
Run *note 'ndb_restore': mysql-cluster-programs-ndb-restore. '--disable-indexes' using the backup from the previous step, to drop indexes and constraints
Run *note 'ndb_restore': mysql-cluster-programs-ndb-restore. '--allow-pk-changes' (possibly along with '--ignore-extended-pk-updates', '--disable-indexes', and possibly other options as needed) to restore all data
Run *note 'ndb_restore': mysql-cluster-programs-ndb-restore. '--rebuild-indexes' using the backup made with the desired schema, to rebuild indexes and constraints
When extending the primary key, it may be necessary for note 'ndb_restore': mysql-cluster-programs-ndb-restore. to use a temporary secondary unique index during the restore operation to map from the old primary key to the new one. Such an index is created only when necessary to apply events from the backup log to a table which has an extended primary key. This index is named 'NDB$RESTORE_PK_MAPPING', and is created on each table requiring it; it can be shared, if necessary, by multiple instances of note 'ndb_restore': mysql-cluster-programs-ndb-restore. instances running in parallel. (Running *note 'ndb_restore': mysql-cluster-programs-ndb-restore. '--rebuild-indexes' at the end of the restore process causes this index to be dropped.)
'--append'
Command-Line Format
'--append'
When used with the '--tab' and '--print-data' options, this causes the data to be appended to any existing files having the same names.
'--backup-path'=DIR_NAME
Command-Line Format
'--backup-path=path'
Type
Directory name
Default Value
'./'
The path to the backup directory is required; this is supplied to note 'ndb_restore': mysql-cluster-programs-ndb-restore. using the '--backup-path' option, and must include the subdirectory corresponding to the ID backup of the backup to be restored. For example, if the data node's 'DataDir' is '/var/lib/mysql-cluster', then the backup directory is '/var/lib/mysql-cluster/BACKUP', and the backup files for the backup with the ID 3 can be found in '/var/lib/mysql-cluster/BACKUP/BACKUP-3'. The path may be absolute or relative to the directory in which the note 'ndb_restore': mysql-cluster-programs-ndb-restore. executable is located, and may be optionally prefixed with 'backup-path='.
It is possible to restore a backup to a database with a different configuration than it was created from. For example, suppose that a backup with backup ID '12', created in a cluster with two storage nodes having the node IDs '2' and '3', is to be restored to a cluster with four nodes. Then note 'ndb_restore': mysql-cluster-programs-ndb-restore. must be run twice--once for each storage node in the cluster where the backup was taken. However, note 'ndb_restore': mysql-cluster-programs-ndb-restore. cannot always restore backups made from a cluster running one version of MySQL to a cluster running a different MySQL version. See *note mysql-cluster-upgrade-downgrade::, for more information.
Important:
It is not possible to restore a backup made from a newer version of NDB Cluster using an older version of note 'ndb_restore': mysql-cluster-programs-ndb-restore. You can restore a backup made from a newer version of MySQL to an older cluster, but you must use a copy of note 'ndb_restore': mysql-cluster-programs-ndb-restore. from the newer NDB Cluster version to do so.
For example, to restore a cluster backup taken from a cluster running NDB Cluster 7.5.36 to a cluster running NDB Cluster 7.4.39, you must use the *note 'ndb_restore': mysql-cluster-programs-ndb-restore. that comes with the NDB Cluster 7.5.36 distribution.
For more rapid restoration, the data may be restored in parallel, provided that there is a sufficient number of cluster connections available. That is, when restoring to multiple nodes in parallel, you must have an '[api]' or '[mysqld]' section in the cluster 'config.ini' file available for each concurrent *note 'ndb_restore': mysql-cluster-programs-ndb-restore. process. However, the data files must always be applied before the logs.
'--backupid'=#, '-b'
Command-Line Format
'--backupid=#'
Type
Numeric
Default Value
'none'
This option is used to specify the ID or sequence number of the backup, and is the same number shown by the management client in the 'Backup BACKUP_ID completed' message displayed upon completion of a backup. (See *note mysql-cluster-backup-using-management-client::.)
Important:
When restoring cluster backups, you must be sure to restore all data nodes from backups having the same backup ID. Using files from different backups can at best result in restoring the cluster to an inconsistent state, and may fail altogether.
In NDB 7.5.13 and later, and in NDB 7.6.9 and later, this option is required.
'--character-sets-dir'
Command-Line Format
'--character-sets-dir=path'
Directory containing character sets.
'--connect', '-c'
Command-Line Format
'--connect=connection_string'
Type
String
Default Value
'localhost:1186'
Alias for '--ndb-connectstring'.
'--connect-retries'
Command-Line Format
'--connect-retries=#'
Type
Integer
Default Value
'12'
Minimum Value
'0'
Maximum Value
'12'
Number of times to retry connection before giving up.
'--connect-retry-delay'
Command-Line Format
'--connect-retry-delay=#'
Type
Integer
Default Value
'5'
Minimum Value
'0'
Maximum Value
'5'
Number of seconds to wait between attempts to contact management server.
'--connect-string'
Command-Line Format
'--connect-string=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--core-file'
Command-Line Format
'--core-file'
Write core file on error; used in debugging.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--disable-indexes'
Command-Line Format
'--disable-indexes'
Disable restoration of indexes during restoration of the data from a native 'NDB' backup. Afterwards, you can restore indexes for all tables at once with multithreaded building of indexes using '--rebuild-indexes', which should be faster than rebuilding indexes concurrently for very large tables.
Beginning with NDB 7.5.24 and NDB 7.6.20, this option also drops any foreign keys specified in the backup.
'--dont-ignore-systab-0', '-f'
Command-Line Format
'--dont-ignore-systab-0'
Normally, when restoring table data and metadata, note 'ndb_restore': mysql-cluster-programs-ndb-restore. ignores the copy of the note 'NDB': mysql-cluster. system table that is present in the backup. '--dont-ignore-systab-0' causes the system table to be restored. This option is intended for experimental and development use only, and is not recommended in a production environment.
'--exclude-databases'=DB-LIST
Command-Line Format
'--exclude-databases=list'
Type
String
Default Value
''
Comma-delimited list of one or more databases which should not be restored.
This option is often used in combination with '--exclude-tables'; see that option's description for further information and examples.
'--exclude-intermediate-sql-tables['=TRUE|FALSE]
Command-Line Format
'--exclude-intermediate-sql-tables[=TRUE|FALSE]'
Type
Boolean
Default Value
'TRUE'
When performing copying note 'ALTER TABLE': alter-table. operations, note 'mysqld': mysqld. creates intermediate tables (whose names are prefixed with '#sql-'). When 'TRUE', the '--exclude-intermediate-sql-tables' option keeps *note 'ndb_restore': mysql-cluster-programs-ndb-restore. from restoring such tables that may have been left over from these operations. This option is 'TRUE' by default.
'--exclude-missing-columns'
Command-Line Format
'--exclude-missing-columns'
It is possible to restore only selected table columns using this option, which causes note 'ndb_restore': mysql-cluster-programs-ndb-restore. to ignore any columns missing from tables being restored as compared to the versions of those tables found in the backup. This option applies to all tables being restored. If you wish to apply this option only to selected tables or databases, you can use it in combination with one or more of the '--include-' or '--exclude-*' options described elsewhere in this section to do so, then restore data to the remaining tables using a complementary set of these options.
'--exclude-missing-tables'
Command-Line Format
'--exclude-missing-tables'
It is possible to restore only selected tables using this option, which causes *note 'ndb_restore': mysql-cluster-programs-ndb-restore. to ignore any tables from the backup that are not found in the target database.
'--exclude-tables'=TABLE-LIST
Command-Line Format
'--exclude-tables=list'
Type
String
Default Value
''
List of one or more tables to exclude; each table reference must include the database name. Often used together with '--exclude-databases'.
When '--exclude-databases' or '--exclude-tables' is used, only those databases or tables named by the option are excluded; all other databases and tables are restored by *note 'ndb_restore': mysql-cluster-programs-ndb-restore.
This table shows several invocations of note 'ndb_restore': mysql-cluster-programs-ndb-restore. usng '--exclude-' options (other options possibly required have been omitted for clarity), and the effects these options have on restoring from an NDB Cluster backup:
Several invocations of ndb_restore using -exclude- options, and the effects these options have on restoring from an NDB Cluster backup.*
Option Result
'--exclude-databases=db1' All tables in all databases except 'db1' are restored; no tables in 'db1' are restored
'--exclude-databases=db1,db2' (or All tables in all databases except '--exclude-databases=db1' 'db1' and 'db2' are restored; no '--exclude-databases=db2') tables in 'db1' or 'db2' are restored
'--exclude-tables=db1.t1' All tables except 't1' in database 'db1' are restored; all other tables in 'db1' are restored; all tables in all other databases are restored
'--exclude-tables=db1.t2,db2.t1' All tables in database 'db1' (or '--exclude-tables=db1.t2' except for 't2' and all tables in '--exclude-tables=db2.t1)' database 'db2' except for table 't1' are restored; no other tables in 'db1' or 'db2' are restored; all tables in all other databases are restored
You can use these two options together. For example, the following causes all tables in all databases except for databases 'db1' and 'db2', and tables 't1' and 't2' in database 'db3', to be restored:
$> ndb_restore [...] --exclude-databases=db1,db2 --exclude-tables=db3.t1,db3.t2
(Again, we have omitted other possibly necessary options in the interest of clarity and brevity from the example just shown.)
You can use '--include-' and '--exclude-' options together, subject to the following rules:
* The actions of all '--include-*' and '--exclude-*' options are
cumulative.
* All '--include-*' and '--exclude-*' options are evaluated in
the order passed to ndb_restore, from right to left.
* In the event of conflicting options, the first (rightmost)
option takes precedence. In other words, the first option
(going from right to left) that matches against a given
database or table 'wins'.
For example, the following set of options causes *note 'ndb_restore': mysql-cluster-programs-ndb-restore. to restore all tables from database 'db1' except 'db1.t1', while restoring no other tables from any other databases:
--include-databases=db1 --exclude-tables=db1.t1
However, reversing the order of the options just given simply causes all tables from database 'db1' to be restored (including 'db1.t1', but no tables from any other database), because the '--include-databases' option, being farthest to the right, is the first match against database 'db1' and thus takes precedence over any other option that matches 'db1' or any tables in 'db1':
--exclude-tables=db1.t1 --include-databases=db1
'--fields-enclosed-by'=CHAR
Command-Line Format
'--fields-enclosed-by=char'
Type
String
Default Value
''
Each column value is enclosed by the string passed to this option (regardless of data type; see the description of '--fields-optionally-enclosed-by').
'--fields-optionally-enclosed-by'
Command-Line Format
'--fields-optionally-enclosed-by'
Type
String
Default Value
''
The string passed to this option is used to enclose column values containing character data (such as note 'CHAR': char, note 'VARCHAR': char, note 'BINARY': binary-varbinary, note 'TEXT': blob, or *note 'ENUM': enum.).
'--fields-terminated-by'=CHAR
Command-Line Format
'--fields-terminated-by=char'
Type
String
Default Value
'(tab)'
The string passed to this option is used to separate column values. The default value is a tab character ('').
'--help'
Command-Line Format
'--help'
Display help text and exit.
'--hex'
Command-Line Format
'--hex'
If this option is used, all binary values are output in hexadecimal format.
'--ignore-extended-pk-updates'
Command-Line Format
'--ignore-extended-pk-updates[=0|1]'
Introduced
5.7.29-ndb-7.6.14
Type
Integer
Default Value
'0'
Minimum Value
'0'
Maximum Value
'1'
When using the '--allow-pk-changes' option, columns which become part of a table's primary key must not be updated while the backup is being taken; such columns should keep the same values from the time values are inserted into them until the rows containing the values are deleted. If note 'ndb_restore': mysql-cluster-programs-ndb-restore. encounters updates to these columns when restoring a backup, the restore fails. Because some applications may set values for all columns when updating a row, even when some column values are not changed, the backup may include log events appearing to update columns which are not in fact modified. In such cases you can set '--ignore-extended-pk-updates' to '1', forcing note 'ndb_restore': mysql-cluster-programs-ndb-restore. to ignore such updates.
Important:
When causing these updates to be ignored, the user is responsible for ensuring that there are no updates to the values of any columns that become part of the primary key.
For more information, see the description of '--allow-pk-changes'.
'--include-databases'=DB-LIST
Command-Line Format
'--include-databases=list'
Type
String
Default Value
''
Comma-delimited list of one or more databases to restore. Often used together with '--include-tables'; see the description of that option for further information and examples.
'--include-tables'=TABLE-LIST
Command-Line Format
'--include-tables=list'
Type
String
Default Value
''
Comma-delimited list of tables to restore; each table reference must include the database name.
When '--include-databases' or '--include-tables' is used, only those databases or tables named by the option are restored; all other databases and tables are excluded by *note 'ndb_restore': mysql-cluster-programs-ndb-restore, and are not restored.
The following table shows several invocations of note 'ndb_restore': mysql-cluster-programs-ndb-restore. using '--include-' options (other options possibly required have been omitted for clarity), and the effects these have on restoring from an NDB Cluster backup:
Several invocations of ndb_restore using -include- options, and their effects on restoring from an NDB Cluster backup.*
Option Result
'--include-databases=db1' Only tables in database 'db1' are restored; all tables in all other databases are ignored
'--include-databases=db1,db2' (or Only tables in databases 'db1' and '--include-databases=db1' 'db2' are restored; all tables in '--include-databases=db2') all other databases are ignored
'--include-tables=db1.t1' Only table 't1' in database 'db1' is restored; no other tables in 'db1' or in any other database are restored
'--include-tables=db1.t2,db2.t1' Only the table 't2' in database (or '--include-tables=db1.t2' 'db1' and the table 't1' in '--include-tables=db2.t1') database 'db2' are restored; no other tables in 'db1', 'db2', or any other database are restored
You can also use these two options together. For example, the following causes all tables in databases 'db1' and 'db2', together with the tables 't1' and 't2' in database 'db3', to be restored (and no other databases or tables):
$> ndb_restore [...] --include-databases=db1,db2 --include-tables=db3.t1,db3.t2
(Again we have omitted other, possibly required, options in the example just shown.)
It also possible to restore only selected databases, or selected tables from a single database, without any '--include-' (or '--exclude-') options, using the syntax shown here:
ndb_restore OTHER_OPTIONS DB_NAME,[DB_NAME[,...] | TBL_NAME[,TBL_NAME][,...]]
In other words, you can specify either of the following to be restored:
* All tables from one or more databases
* One or more tables from a single database
'--lines-terminated-by'=CHAR
Command-Line Format
'--lines-terminated-by=char'
Type
String
Default Value
'(linebreak)'
Specifies the string used to end each line of output. The default is a linefeed character ('').
'--login-path'
Command-Line Format
'--login-path=path'
Type
String
Default Value
'[none]'
Read given path from login file.
'--lossy-conversions', '-L'
Command-Line Format
'--lossy-conversions'
This option is intended to complement the '--promote-attributes' option. Using '--lossy-conversions' allows lossy conversions of column values (type demotions or changes in sign) when restoring data from backup. With some exceptions, the rules governing demotion are the same as for MySQL replication; see *note replication-features-different-data-types::, for information about specific type conversions currently supported by attribute demotion.
Beginning with NDB 7.5.23 and NDB 7.6.19, this option also makes it possible to restore a 'NULL' column as 'NOT NULL'. The column must not contain any 'NULL' entries; otherwise *note 'ndb_restore': mysql-cluster-programs-ndb-restore. stops with an error.
*note 'ndb_restore': mysql-cluster-programs-ndb-restore. reports any truncation of data that it performs during lossy conversions once per attribute and column.
'--ndb-connectstring'
Command-Line Format
'--ndb-connectstring=connection_string'
Type
String
Default Value
'[none]'
Set connect string for connecting to ndb_mgmd. Syntax: "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf.
'--ndb-mgmd-host'
Command-Line Format
'--ndb-mgmd-host=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--ndb-nodegroup-map'=MAP, '-z'
Command-Line Format
'--ndb-nodegroup-map=map'
Intended for restoring a backup taken from one node group to a different node group, but never completely implemented; unsupported.
'--ndb-nodeid'
Command-Line Format
'--ndb-nodeid=#'
Type
Integer
Default Value
'[none]'
Set node ID for this node, overriding any ID set by '--ndb-connectstring'.
'--ndb-optimized-node-selection'
Command-Line Format
'--ndb-optimized-node-selection'
Enable optimizations for selection of nodes for transactions. Enabled by default; use '--skip-ndb-optimized-node-selection' to disable.
'--no-binlog'
Command-Line Format
'--no-binlog'
This option prevents any connected SQL nodes from writing data restored by *note 'ndb_restore': mysql-cluster-programs-ndb-restore. to their binary logs.
'--no-defaults'
Command-Line Format
'--no-defaults'
Do not read default options from any option file other than login file.
'--no-restore-disk-objects', '-d'
Command-Line Format
'--no-restore-disk-objects'
This option stops note 'ndb_restore': mysql-cluster-programs-ndb-restore. from restoring any NDB Cluster Disk Data objects, such as tablespaces and log file groups; see note mysql-cluster-disk-data::, for more information about these.
'--no-upgrade', '-u'
Command-Line Format
'--no-upgrade'
When using note 'ndb_restore': mysql-cluster-programs-ndb-restore. to restore a backup, note 'VARCHAR': char. columns created using the old fixed format are resized and recreated using the variable-width format now employed. This behavior can be overridden by specifying '--no-upgrade'.
'--nodeid'=#, '-n'
Command-Line Format
'--nodeid=#'
Type
Numeric
Default Value
'none'
Specify the node ID of the data node on which the backup was taken.
When restoring to a cluster with different number of data nodes from that where the backup was taken, this information helps identify the correct set or sets of files to be restored to a given node. (In such cases, multiple files usually need to be restored to a single data node.) See *note ndb-restore-different-number-nodes::, for additional information and examples.
In NDB 7.5.13 and later, and in NDB 7.6.9 and later, this option is required.
'--num-slices'=#
Command-Line Format
'--num-slices=#'
Introduced
5.7.29-ndb-7.6.13
Type
Integer
Default Value
'1'
Minimum Value
'1'
Maximum Value
'1024'
When restoring a backup by slices, this option sets the number of slices into which to divide the backup. This allows multiple instances of *note 'ndb_restore': mysql-cluster-programs-ndb-restore. to restore disjoint subsets in parallel, potentially reducing the amount of time required to perform the restore operation.
A slice is a subset of the data in a given backup; that is, it is a set of fragments having the same slice ID, specified using the '--slice-id' option. The two options must always be used together, and the value set by '--slice-id' must always be less than the number of slices.
note 'ndb_restore': mysql-cluster-programs-ndb-restore. encounters fragments and assigns each one a fragment counter. When restoring by slices, a slice ID is assigned to each fragment; this slice ID is in the range 0 to 1 less than the number of slices. For a table that is not a note 'BLOB': blob. table, the slice to which a given fragment belongs is determined using the formula shown here:
[SLICE_ID] = [FRAGMENT_COUNTER] % [NUMBER_OF_SLICES]
For a *note 'BLOB': blob. table, a fragment counter is not used; the fragment number is used instead, along with the ID of the main table for the 'BLOB' table (recall that 'NDB' stores BLOB values in a separate table internally). In this case, the slice ID for a given fragment is calculated as shown here:
[SLICE_ID] =
([MAIN_TABLE_ID] + [FRAGMENT_ID]) % [NUMBER_OF_SLICES]
Thus, restoring by N slices means running N instances of *note 'ndb_restore': mysql-cluster-programs-ndb-restore, all with '--num-slices=N' (along with any other necessary options) and one each with '--slice-id=1', '--slice-id=2', '--slice-id=3', and so on through 'slice-id=N-1'.
'--parallelism'=#, '-p'
Command-Line Format
'--parallelism=#'
Type
Numeric
Default Value
'128'
Minimum Value
'1'
Maximum Value
'1024'
note 'ndb_restore': mysql-cluster-programs-ndb-restore. uses single-row transactions to apply many rows concurrently. This parameter determines the number of parallel transactions (concurrent rows) that an instance of note 'ndb_restore': mysql-cluster-programs-ndb-restore. tries to use. By default, this is 128; the minimum is 1, and the maximum is 1024.
The work of performing the inserts is parallelized across the threads in the data nodes involved. This mechanism is employed for restoring bulk data from the '.Data' file--that is, the fuzzy snapshot of the data; it is not used for building or rebuilding indexes. The change log is applied serially; index drops and builds are DDL operations and handled separately. There is no thread-level parallelism on the client side of the restore.
'--preserve-trailing-spaces', '-P'
Command-Line Format
'--preserve-trailing-spaces'
Cause trailing spaces to be preserved when promoting a fixed-width character data type to its variable-width equivalent--that is, when promoting a note 'CHAR': char. column value to note 'VARCHAR': char, or a 'BINARY' column value to *note 'VARBINARY': binary-varbinary. Otherwise, any trailing spaces are dropped from such column values when they are inserted into the new columns.
Note:
Although you can promote note 'CHAR': char. columns to note 'VARCHAR': char. and 'BINARY' columns to note 'VARBINARY': binary-varbinary, you cannot promote note 'VARCHAR': char. columns to note 'CHAR': char. or note 'VARBINARY': binary-varbinary. columns to 'BINARY'.
'--print'
Command-Line Format
'--print'
Causes *note 'ndb_restore': mysql-cluster-programs-ndb-restore. to print all data, metadata, and logs to 'stdout'. Equivalent to using the '--print-data', '--print-meta', and '--print-log' options together.
Note:
Use of '--print' or any of the '--print_' options is in effect performing a dry run. Including one or more of these options causes any output to be redirected to 'stdout'; in such cases, note 'ndb_restore': mysql-cluster-programs-ndb-restore. makes no attempt to restore data or metadata to an NDB Cluster.
'--print-data'
Command-Line Format
'--print-data'
Cause *note 'ndb_restore': mysql-cluster-programs-ndb-restore. to direct its output to 'stdout'. Often used together with one or more of '--tab', '--fields-enclosed-by', '--fields-optionally-enclosed-by', '--fields-terminated-by', '--hex', and '--append'.
note 'TEXT': blob. and note 'BLOB': blob. column values are always truncated. Such values are truncated to the first 256 bytes in the output. This cannot currently be overridden when using '--print-data'.
'--print-defaults'
Command-Line Format
'--print-defaults'
Print program argument list and exit.
'--print-log'
Command-Line Format
'--print-log'
Cause *note 'ndb_restore': mysql-cluster-programs-ndb-restore. to output its log to 'stdout'.
'--print-meta'
Command-Line Format
'--print-meta'
Print all metadata to 'stdout'.
'print-sql-log'
Command-Line Format
'--print-sql-log'
Introduced
5.7.16-ndb-7.5.4
Log SQL statements to 'stdout'. Use the option to enable; normally this behavior is disabled. The option checks before attempting to log whether all the tables being restored have explicitly defined primary keys; queries on a table having only the hidden primary key implemented by 'NDB' cannot be converted to valid SQL.
This option does not work with tables having *note 'BLOB': blob. columns.
The '--print-sql-log' option was added in NDB 7.5.4. (Bug #13511949)
'--progress-frequency'=N
Command-Line Format
'--progress-frequency=#'
Type
Numeric
Default Value
'0'
Minimum Value
'0'
Maximum Value
'65535'
Print a status report each N seconds while the backup is in progress. 0 (the default) causes no status reports to be printed. The maximum is 65535.
'--promote-attributes', '-A'
Command-Line Format
'--promote-attributes'
note 'ndb_restore': mysql-cluster-programs-ndb-restore. supports limited attribute promotion in much the same way that it is supported by MySQL replication; that is, data backed up from a column of a given type can generally be restored to a column using a 'larger, similar' type. For example, data from a 'CHAR(20)' column can be restored to a column declared as 'VARCHAR(20)', 'VARCHAR(30)', or 'CHAR(30)'; data from a note 'MEDIUMINT': integer-types. column can be restored to a column of type note 'INT': integer-types. or note 'BIGINT': integer-types. See *note replication-features-different-data-types::, for a table of type conversions currently supported by attribute promotion.
Beginning with NDB 7.5.23 and NDB 7.6.19, this option also makes it possible to restore a 'NOT NULL' column as 'NULL'.
Attribute promotion by *note 'ndb_restore': mysql-cluster-programs-ndb-restore. must be enabled explicitly, as follows:
Prepare the table to which the backup is to be restored. note 'ndb_restore': mysql-cluster-programs-ndb-restore. cannot be used to re-create the table with a different definition from the original; this means that you must either create the table manually, or alter the columns which you wish to promote using note 'ALTER TABLE': alter-table. after restoring the table metadata but before restoring the data.
Invoke *note 'ndb_restore': mysql-cluster-programs-ndb-restore. with the '--promote-attributes' option (short form '-A') when restoring the table data. Attribute promotion does not occur if this option is not used; instead, the restore operation fails with an error.
When converting between character data types and 'TEXT' or 'BLOB', only conversions between character types (note 'CHAR': char. and note 'VARCHAR': char.) and binary types (note 'BINARY': binary-varbinary. and note 'VARBINARY': binary-varbinary.) can be performed at the same time. For example, you cannot promote an note 'INT': integer-types. column to note 'BIGINT': integer-types. while promoting a 'VARCHAR' column to 'TEXT' in the same invocation of *note 'ndb_restore': mysql-cluster-programs-ndb-restore.
Converting between *note 'TEXT': blob. columns using different character sets is not supported, and is expressly disallowed.
When performing conversions of character or binary types to 'TEXT' or 'BLOB' with note 'ndb_restore': mysql-cluster-programs-ndb-restore, you may notice that it creates and uses one or more staging tables named 'TABLE_NAME$STNODE_ID'. These tables are not needed afterwards, and are normally deleted by note 'ndb_restore': mysql-cluster-programs-ndb-restore. following a successful restoration.
'--rebuild-indexes'
Command-Line Format
'--rebuild-indexes'
Enable multithreaded rebuilding of the ordered indexes while restoring a native 'NDB' backup. The number of threads used for building ordered indexes by *note 'ndb_restore': mysql-cluster-programs-ndb-restore. with this option is controlled by the 'BuildIndexThreads' data node configuration parameter and the number of LDMs.
It is necessary to use this option only for the first run of *note 'ndb_restore': mysql-cluster-programs-ndb-restore.; this causes all ordered indexes to be rebuilt without using '--rebuild-indexes' again when restoring subsequent nodes. You should use this option prior to inserting new rows into the database; otherwise, it is possible for a row to be inserted that later causes a unique constraint violation when trying to rebuild the indexes.
Building of ordered indices is parallelized with the number of LDMs by default. Offline index builds performed during node and system restarts can be made faster using the 'BuildIndexThreads' data node configuration parameter; this parameter has no effect on dropping and rebuilding of indexes by *note 'ndb_restore': mysql-cluster-programs-ndb-restore, which is performed online.
Rebuilding of unique indexes uses disk write bandwidth for redo logging and local checkpointing. An insufficient amount of this bandwith can lead to redo buffer overload or log overload errors. In such cases you can run note 'ndb_restore': mysql-cluster-programs-ndb-restore. '--rebuild-indexes' again; the process resumes at the point where the error occurred. You can also do this when you have encountered temporary errors. You can repeat execution of note 'ndb_restore': mysql-cluster-programs-ndb-restore. '--rebuild-indexes' indefinitely; you may be able to stop such errors by reducing the value of '--parallelism'. If the problem is insufficient space, you can increase the size of the redo log ('FragmentLogFileSize' node configuration parameter), or you can increase the speed at which LCPs are performed ('MaxDiskWriteSpeed' and related parameters), in order to free space more quickly.
'--remap-column=DB.TBL.COL:FN:ARGS'
Command-Line Format
'--remap-column=string'
Introduced
5.7.29-ndb-7.6.14
Type
String
Default Value
'[none]'
When used together with '--restore-data', this option applies a function to the value of the indicated column. Values in the argument string are listed here:
* DB: Database name, following any renames performed by
'--rewrite-database'.
* TBL: Table name.
* COL: Name of the column to be updated. This column must be of
type *note 'INT': integer-types. or *note 'BIGINT':
integer-types. The column can also be but is not required to
be 'UNSIGNED'.
* FN: Function name; currently, the only supported name is
'offset'.
* ARGS: Arguments supplied to the function. Currently, only a
single argument, the size of the offset to be added by the
'offset' function, is supported. Negative values are
supported. The size of the argument cannot exceed that of the
signed variant of the column's type; for example, if COL is an
'INT' column, then the allowed range of the argument passed to
the 'offset' function is '-2147483648' to '2147483647' (see
*note integer-types::).
If applying the offset value to the column would cause an
overflow or underflow, the restore operation fails. This
could happen, for example, if the column is a 'BIGINT', and
the option attempts to apply an offset value of 8 on a row in
which the column value is 4294967291, since '4294967291 + 8 =
4294967299 > 4294967295'.
This option can be useful when you wish to merge data stored in multiple source instances of NDB Cluster (all using the same schema) into a single destination NDB Cluster, using NDB native backup (see note mysql-cluster-backup-using-management-client::) and note 'ndb_restore': mysql-cluster-programs-ndb-restore. to merge the data, where primary and unique key values are overlapping between source clusters, and it is necessary as part of the process to remap these values to ranges that do not overlap. It may also be necessary to preserve other relationships between tables. To fulfill such requirements, it is possible to use the option multiple times in the same invocation of *note 'ndb_restore': mysql-cluster-programs-ndb-restore. to remap columns of different tables, as shown here:
$> ndb_restore --restore-data --remap-column=hr.employee.id:offset:1000 \
--remap-column=hr.manager.id:offset:1000 --remap-column=hr.firstaiders.id:offset:1000
(Other options not shown here may also be used.)
'--remap-column' can also be used to update multiple columns of the same table. Combinations of multiple tables and columns are possible. Different offset values can also be used for different columns of the same table, like this:
$> ndb_restore --restore-data --remap-column=hr.employee.salary:offset:10000 \
--remap-column=hr.employee.hours:offset:-10
When source backups contain duplicate tables which should not be merged, you can handle this by using '--exclude-tables', '--exclude-databases', or by some other means in your application.
Information about the structure and other characteristics of tables to be merged can obtained using note 'SHOW CREATE TABLE': show-create-table.; the note 'ndb_desc': mysql-cluster-programs-ndb-desc. tool; and 'MAX()', 'MIN()', 'LAST_INSERT_ID()', and other MySQL functions.
Replication of changes from merged to unmerged tables, or from unmerged to merged tables, in separate instances of NDB Cluster is not supported.
'--restore-data', '-r'
Command-Line Format
'--restore-data'
Output *note 'NDB': mysql-cluster. table data and logs.
'--restore-epoch', '-e'
Command-Line Format
'--restore-epoch'
Add (or restore) epoch information to the cluster replication status table. This is useful for starting replication on an NDB replica cluster. When this option is used, the row in the 'mysql.ndb_apply_status' having '0' in the 'id' column is updated if it already exists; such a row is inserted if it does not already exist. (See *note mysql-cluster-replication-backups::.)
'--restore-meta', '-m'
Command-Line Format
'--restore-meta'
This option causes note 'ndb_restore': mysql-cluster-programs-ndb-restore. to print note 'NDB': mysql-cluster. table metadata.
The first time you run the *note 'ndb_restore': mysql-cluster-programs-ndb-restore. restoration program, you also need to restore the metadata. In other words, you must re-create the database tables--this can be done by running it with the '--restore-meta' ('-m') option. Restoring the metadata need be done only on a single data node; this is sufficient to restore it to the entire cluster.
In older versions of NDB Cluster, tables whose schemas were restored using this option used the same number of partitions as they did on the original cluster, even if it had a differing number of data nodes from the new cluster. In NDB 7.5.2 and later, when restoring metadata, this is no longer an issue; *note 'ndb_restore': mysql-cluster-programs-ndb-restore. now uses the default number of partitions for the target cluster, unless the number of local data manager threads is also changed from what it was for data nodes in the original cluster.
Note:
The cluster should have an empty database when starting to restore a backup. (In other words, you should start the data nodes with '--initial' prior to performing the restore.)
'--restore-privilege-tables'
Command-Line Format
'--restore-privilege-tables'
note 'ndb_restore': mysql-cluster-programs-ndb-restore. does not by default restore distributed MySQL privilege tables. This option causes note 'ndb_restore': mysql-cluster-programs-ndb-restore. to restore the privilege tables.
This works only if the privilege tables were converted to note 'NDB': mysql-cluster. before the backup was taken. For more information, see note mysql-cluster-privilege-distribution::.
'--rewrite-database'=OLDDB,NEWDB
Command-Line Format
'--rewrite-database=string'
Type
String
Default Value
'none'
This option makes it possible to restore to a database having a different name from that used in the backup. For example, if a backup is made of a database named 'products', you can restore the data it contains to a database named 'inventory', use this option as shown here (omitting any other options that might be required):
$> ndb_restore --rewrite-database=product,inventory
The option can be employed multiple times in a single invocation of note 'ndb_restore': mysql-cluster-programs-ndb-restore. Thus it is possible to restore simultaneously from a database named 'db1' to a database named 'db2' and from a database named 'db3' to one named 'db4' using '--rewrite-database=db1,db2 --rewrite-database=db3,db4'. Other note 'ndb_restore': mysql-cluster-programs-ndb-restore. options may be used between multiple occurrences of '--rewrite-database'.
In the event of conflicts between multiple '--rewrite-database' options, the last '--rewrite-database' option used, reading from left to right, is the one that takes effect. For example, if '--rewrite-database=db1,db2 --rewrite-database=db1,db3' is used, only '--rewrite-database=db1,db3' is honored, and '--rewrite-database=db1,db2' is ignored. It is also possible to restore from multiple databases to a single database, so that '--rewrite-database=db1,db3 --rewrite-database=db2,db3' restores all tables and data from databases 'db1' and 'db2' into database 'db3'.
Important:
When restoring from multiple backup databases into a single target database using '--rewrite-database', no check is made for collisions between table or other object names, and the order in which rows are restored is not guaranteed. This means that it is possible in such cases for rows to be overwritten and updates to be lost.
'--skip-broken-objects'
Command-Line Format
'--skip-broken-objects'
This option causes note 'ndb_restore': mysql-cluster-programs-ndb-restore. to ignore corrupt tables while reading a native note 'NDB': mysql-cluster. backup, and to continue restoring any remaining tables (that are not also corrupted). Currently, the '--skip-broken-objects' option works only in the case of missing blob parts tables.
'--skip-table-check', '-s'
Command-Line Format
'--skip-table-check'
It is possible to restore data without restoring table metadata. By default when doing this, *note 'ndb_restore': mysql-cluster-programs-ndb-restore. fails with an error if a mismatch is found between the table data and the table schema; this option overrides that behavior.
Some of the restrictions on mismatches in column definitions when restoring data using note 'ndb_restore': mysql-cluster-programs-ndb-restore. are relaxed; when one of these types of mismatches is encountered, note 'ndb_restore': mysql-cluster-programs-ndb-restore. does not stop with an error as it did previously, but rather accepts the data and inserts it into the target table while issuing a warning to the user that this is being done. This behavior occurs whether or not either of the options '--skip-table-check' or '--promote-attributes' is in use. These differences in column definitions are of the following types:
* Different 'COLUMN_FORMAT' settings ('FIXED', 'DYNAMIC',
'DEFAULT')
* Different 'STORAGE' settings ('MEMORY', 'DISK')
* Different default values
* Different distribution key settings
'--skip-unknown-objects'
Command-Line Format
'--skip-unknown-objects'
This option causes note 'ndb_restore': mysql-cluster-programs-ndb-restore. to ignore any schema objects it does not recognize while reading a native note 'NDB': mysql-cluster. backup. This can be used for restoring a backup made from a cluster running (for example) NDB 7.6 to a cluster running NDB Cluster 7.5.
'--slice-id'=#
Command-Line Format
'--slice-id=#'
Introduced
5.7.29-ndb-7.6.13
Type
Integer
Default Value
'0'
Minimum Value
'0'
Maximum Value
'1023'
When restoring by slices, this is the ID of the slice to restore. This option is always used together with '--num-slices', and its value must be always less than that of '--num-slices'.
For more information, see the description of the '--num-slices' elsewhere in this section.
'--tab'=DIR_NAME, '-T' DIR_NAME
Command-Line Format
'--tab=path'
Type
Directory name
Causes '--print-data' to create dump files, one per table, each named 'TBL_NAME.txt'. It requires as its argument the path to the directory where the files should be saved; use '.' for the current directory.
'--timestamp-printouts'
Command-Line Format
'--timestamp-printouts{=true|false}'
Introduced
5.7.41-ndb-7.5.30, 5.7.41-ndb-7.6.26
Type
Boolean
Default Value
'false'
Causes info, error, and debug log messages to be prefixed with timestamps.
This option is disabled by default in NDB 7.5 and NDB 7.6. Set it explicitly to 'true' to enable.
'--usage'
Command-Line Format
'--usage'
Display help text and exit; same as '--help'.
'--verbose'=#
Command-Line Format
'--verbose=#'
Type
Numeric
Default Value
'1'
Minimum Value
'0'
Maximum Value
'255'
Sets the level for the verbosity of the output. The minimum is 0; the maximum is 255. The default value is 1.
'--version'
Command-Line Format
'--version'
Display version information and exit.
Typical options for this utility are shown here:
ndb_restore [-c CONNECTION_STRING] -n NODE_ID -b BACKUP_ID \
[-m] -r --backup-path=/PATH/TO/BACKUP/FILES
Normally, when restoring from an NDB Cluster backup, note 'ndb_restore': mysql-cluster-programs-ndb-restore. requires at a minimum the '--nodeid' (short form: '-n'), '--backupid' (short form: '-b'), and '--backup-path' options. In addition, when note 'ndb_restore': mysql-cluster-programs-ndb-restore. is used to restore any tables containing unique indexes, you must include '--disable-indexes' or '--rebuild-indexes'. (Bug #57782, Bug #11764893)
The '-c' option is used to specify a connection string which tells 'ndb_restore' where to locate the cluster management server (see note mysql-cluster-connection-strings::). If this option is not used, then note 'ndb_restore': mysql-cluster-programs-ndb-restore. attempts to connect to a management server on 'localhost:1186'. This utility acts as a cluster API node, and so requires a free connection 'slot' to connect to the cluster management server. This means that there must be at least one '[api]' or '[mysqld]' section that can be used by it in the cluster 'config.ini' file. It is a good idea to keep at least one empty '[api]' or '[mysqld]' section in 'config.ini' that is not being used for a MySQL server or other application for this reason (see *note mysql-cluster-api-definition::).
You can verify that note 'ndb_restore': mysql-cluster-programs-ndb-restore. is connected to the cluster by using the 'SHOW' command in the note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. management client. You can also accomplish this from a system shell, as shown here:
$> ndb_mgm -e "SHOW"
Error reporting
*note 'ndb_restore': mysql-cluster-programs-ndb-restore. reports both temporary and permanent errors. In the case of temporary errors, it may able to recover from them, and reports 'Restore successful, but encountered temporary error, please look at configuration' in such cases.
Important:
After using note 'ndb_restore': mysql-cluster-programs-ndb-restore. to initialize an NDB Cluster for use in circular replication, binary logs on the SQL node acting as the replica are not automatically created, and you must cause them to be created manually. To cause the binary logs to be created, issue a note 'SHOW TABLES': show-tables. statement on that SQL node before running *note 'START SLAVE': start-slave. This is a known issue in NDB Cluster.
File: manual.info.tmp, Node: ndb-restore-to-different-version, Next: ndb-restore-different-number-nodes, Prev: mysql-cluster-programs-ndb-restore, Up: mysql-cluster-programs-ndb-restore
21.5.24.1 Restoring an NDB Backup to a Different Version of NDB Cluster .......................................................................
Menu:
ndb-restore-to-later-version:: Restoring an NDB backup to a later version of NDB Cluster
The following two sections provide information about restoring a native NDB backup to a different version of NDB Cluster from the version in which the backup was taken.
In addition, you should consult *note mysql-cluster-upgrade-downgrade::, for other issues you may encounter when attempting to restore an NDB backup to a cluster running a different version of the NDB software.
It is also advisable to review What is New in NDB Cluster 8.0 (https://dev.mysql.com/doc/refman/8.0/en/mysql-cluster-what-is-new.html#mysql-cluster-what-is-new-8-0), as well as *note upgrading-from-previous-series::, for other changes between NDB 8.0 and previous versions of NDB Cluster that may be relevant to your particular circumstances.
File: manual.info.tmp, Node: ndb-restore-to-previous-version, Next: ndb-restore-to-later-version, Prev: ndb-restore-to-different-version, Up: ndb-restore-to-different-version
21.5.24.2 Restoring an NDB backup to a previous version of NDB Cluster ......................................................................
You may encounter issues when restoring a backup taken from a later version of NDB Cluster to a previous one, due to the use of features which do not exist in the earlier version. Some of these issues are listed here:
Tables created in NDB 8.0 by default use the 'utf8mb4_ai_ci' character set, which is not available in NDB 7.6 and earlier, and so cannot be read by an *note 'ndb_restore': mysql-cluster-programs-ndb-restore. binary from one of these earlier versions. In such cases, it is necessary to alter any tables using 'utf8mb4_ai_ci' so that they use a character set supported in the older version prior to performing the backup.
Due to changes in how the MySQL Server and NDB handle table metadata, tables created or altered using the included MySQL server binary from NDB 8.0.14 or later cannot be restored using note 'ndb_restore': mysql-cluster-programs-ndb-restore. to an earlier version of NDB Cluster. Such tables use '.sdi' files which are not understood by older versions of note 'mysqld': mysqld.
A backup taken in NDB 8.0.14 or later of tables which were created in NDB 8.0.13 or earlier, and which have not been altered since upgrading to NDB 8.0.14 or later, should be restorable to older versions of NDB Cluster.
Since it is possible to restore metadata and table data separately, you can in such cases restore the table schemas from a dump made using note 'mysqldump': mysqldump, or by executing the necessary note 'CREATE TABLE': create-table. statements manually, then import only the table data using *note 'ndb_restore': mysql-cluster-programs-ndb-restore. with the '--restore-data' option.
Encrypted backups created in NDB 8.0.22 and later cannot be restored using *note 'ndb_restore': mysql-cluster-programs-ndb-restore. from NDB 8.0.21 or earlier.
The 'NDB_STORED_USER' (https://dev.mysql.com/doc/refman/8.0/en/privileges-provided.html#priv_ndb-stored-user) privilege is not supported prior to NDB 8.0.18.
NDB Cluster 8.0.18 and later supports up to 144 data nodes, while earlier versions support a maximum of only 48 data nodes. See *note ndb-restore-to-fewer-nodes::, for information with situations in which this incompatibility causes an issue.
File: manual.info.tmp, Node: ndb-restore-to-later-version, Prev: ndb-restore-to-previous-version, Up: ndb-restore-to-different-version
21.5.24.3 Restoring an NDB backup to a later version of NDB Cluster ...................................................................
In general, it should be possible to restore a backup created using the note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. client note 'START BACKUP': mysql-cluster-backup-using-management-client. command in an older version of NDB to a newer version, provided that you use the note 'ndb_restore': mysql-cluster-programs-ndb-restore. binary that comes with the newer version. (It may be possible to use the older version of note 'ndb_restore': mysql-cluster-programs-ndb-restore, but this is not recommended.) Additional potential issues are listed here:
When restoring the metadata from a backup ('--restore-meta' option), *note 'ndb_restore': mysql-cluster-programs-ndb-restore. normally attempts to reproduce the captured table schema exactly as it was when the backup was taken.
Tables created in versions of NDB prior to 8.0.14 use '.frm' files for their metadata. These files can be read by the *note 'mysqld': mysqld. in NDB 8.0.14 and later, which can use the information contained therein to create the '.sdi' files used by the MySQL data dictionary in later versions.
When restoring an older backup to a newer version of NDB, it may not be possible to take advantage of newer features such as hashmap partitioning, greater number of hashmap buckets, read backup, and different partitioning layouts. For this reason, it may be preferable to restore older schemas using note 'mysqldump': mysqldump. and the note 'mysql': mysql. client, which allows NDB to make use of the new schema features.
Tables using the old temporal types which did not support fractional seconds (used prior to MySQL 5.6.4 and NDB 7.3.31) cannot be restored to NDB 8.0 using note 'ndb_restore': mysql-cluster-programs-ndb-restore. You can check such tables using note 'CHECK TABLE': check-table, and then upgrade them to the newer temporal column format, if necessary, using note 'REPAIR TABLE': repair-table. in the note 'mysql': mysql. client; this must be done prior to taking the backup. See Preparing Your Installation for Upgrade (https://dev.mysql.com/doc/refman/8.0/en/upgrade-prerequisites.html), for more information.
You also restore such tables using a dump created with *note 'mysqldump': mysqldump.
Distributed grant tables created in NDB 7.6 and earlier are not supported in NDB 8.0. Such tables can be restored to an NDB 8.0 cluster, but they have no effect on access control.
File: manual.info.tmp, Node: ndb-restore-different-number-nodes, Prev: ndb-restore-to-different-version, Up: mysql-cluster-programs-ndb-restore
21.5.24.4 Restoring to a different number of data nodes .......................................................
Menu:
ndb-restore-to-more-nodes:: Restoring to More Nodes Than the Original
It is possible to restore from an NDB backup to a cluster having a different number of data nodes than the original from which the backup was taken. The following two sections discuss, respectively, the cases where the target cluster has a lesser or greater number of data nodes than the source of the backup.
File: manual.info.tmp, Node: ndb-restore-to-fewer-nodes, Next: ndb-restore-to-more-nodes, Prev: ndb-restore-different-number-nodes, Up: ndb-restore-different-number-nodes
21.5.24.5 Restoring to Fewer Nodes Than the Original ....................................................
You can restore to a cluster having fewer data nodes than the original provided that the larger number of nodes is an even multiple of the smaller number. In the following example, we use a backup taken on a cluster having four data nodes to a cluster having two data nodes.
The management server for the original cluster is on host 'host10'. The original cluster has four data nodes, with the node IDs and host names shown in the following extract from the management server's 'config.ini' file:
[ndbd]
NodeId=2
HostName=host2
[ndbd]
NodeId=4
HostName=host4
[ndbd]
NodeId=6
HostName=host6
[ndbd]
NodeId=8
HostName=host8
We assume that each data node was originally started with *note 'ndbmtd': mysql-cluster-programs-ndbmtd. '--ndb-connectstring=host10' or the equivalent.
Perform a backup in the normal manner. See *note mysql-cluster-backup-using-management-client::, for information about how to do this.
The files created by the backup on each data node are listed here, where N is the node ID and B is the backup ID.
* 'BACKUP-B-0.N.Data'
* 'BACKUP-B.N.ctl'
* 'BACKUP-B.N.log'
These files are found under 'BackupDataDir''/BACKUP/BACKUP-B', on each data node. For the rest of this example, we assume that the backup ID is 1.
Have all of these files available for later copying to the new data nodes (where they can be accessed on the data node's local file system by *note 'ndb_restore': mysql-cluster-programs-ndb-restore.). It is simplest to copy them all to a single location; we assume that this is what you have done.
The management server for the target cluster is on host 'host20', and the target has two data nodes, with the node IDs and host names shown, from the management server 'config.ini' file on 'host20':
[ndbd]
NodeId=3
hostname=host3
[ndbd]
NodeId=5
hostname=host5
Each of the data node processes on 'host3' and 'host5' should be started with *note 'ndbmtd': mysql-cluster-programs-ndbmtd. '-c host20' '--initial' or the equivalent, so that the new (target) cluster starts with clean data node file systems.
Copy two different sets of two backup files to each of the target data nodes. For this example, copy the backup files from nodes 2 and 4 from the original cluster to node 3 in the target cluster. These files are listed here:
* 'BACKUP-1-0.2.Data'
* 'BACKUP-1.2.ctl'
* 'BACKUP-1.2.log'
* 'BACKUP-1-0.4.Data'
* 'BACKUP-1.4.ctl'
* 'BACKUP-1.4.log'
Then copy the backup files from nodes 6 and 8 to node 5; these files are shown in the following list:
* 'BACKUP-1-0.6.Data'
* 'BACKUP-1.6.ctl'
* 'BACKUP-1.6.log'
* 'BACKUP-1-0.8.Data'
* 'BACKUP-1.8.ctl'
* 'BACKUP-1.8.log'
For the remainder of this example, we assume that the respective backup files have been saved to the directory '/BACKUP-1' on each of nodes 3 and 5.
On each of the two target data nodes, you must restore from both sets of backups. First, restore the backups from nodes 2 and 4 to node 3 by invoking *note 'ndb_restore': mysql-cluster-programs-ndb-restore. on 'host3' as shown here:
$> ndb_restore -c host20 --nodeid=2 --backupid=1 --restore-data --backup-path=/BACKUP-1
$> ndb_restore -c host20 --nodeid=4 --backupid=1 --restore-data --backup-path=/BACKUP-1
Then restore the backups from nodes 6 and 8 to node 5 by invoking *note 'ndb_restore': mysql-cluster-programs-ndb-restore. on 'host5', like this:
$> ndb_restore -c host20 --nodeid=6 --backupid=1 --restore-data --backup-path=/BACKUP-1
$> ndb_restore -c host20 --nodeid=8 --backupid=1 --restore-data --backup-path=/BACKUP-1
File: manual.info.tmp, Node: ndb-restore-to-more-nodes, Prev: ndb-restore-to-fewer-nodes, Up: ndb-restore-different-number-nodes
21.5.24.6 Restoring to More Nodes Than the Original ...................................................
The node ID specified for a given note 'ndb_restore': mysql-cluster-programs-ndb-restore. command is that of the node in the original backup and not that of the data node to restore it to. When performing a backup using the method described in this section, note 'ndb_restore': mysql-cluster-programs-ndb-restore. connects to the management server and obtains a list of data nodes in the cluster the backup is being restored to. The restored data is distributed accordingly, so that the number of nodes in the target cluster does not need to be to be known or calculated when performing the backup.
Note:
When changing the total number of LCP threads or LQH threads per node group, you should recreate the schema from backup created using *note 'mysqldump': mysqldump.
Create the backup of the data. You can do this by invoking the *note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. client 'START BACKUP' command from the system shell, like this:
$> ndb_mgm -e "START BACKUP 1"
This assumes that the desired backup ID is 1.
Create a backup of the schema. In NDB 7.5.2 and later, this step is necessary only if the total number of LCP threads or LQH threads per node group is changed.
$> mysqldump --no-data --routines --events --triggers --databases > myschema.sql
Important:
Once you have created the 'NDB' native backup using *note 'ndb_mgm': mysql-cluster-programs-ndb-mgm, you must not make any schema changes before creating the backup of the schema, if you do so.
Copy the backup directory to the new cluster. For example if the backup you want to restore has ID 1 and 'BackupDataDir' = '/backups/node_NODEID', then the path to the backup on this node is '/backups/node_1/BACKUP/BACKUP-1'. Inside this directory there are three files, listed here:
* 'BACKUP-1-0.1.Data'
* 'BACKUP-1.1.ctl'
* 'BACKUP-1.1.log'
You should copy the entire directory to the new node.
If you needed to create a schema file, copy this to a location on an SQL node where it can be read by *note 'mysqld': mysqld.
There is no requirement for the backup to be restored from a specific node or nodes.
To restore from the backup just created, perform the following steps:
Restore the schema.
* If you created a separate schema backup file using *note
'mysqldump': mysqldump, import this file using the *note
'mysql': mysql. client, similar to what is shown here:
$> mysql < myschema.sql
When importing the schema file, you may need to specify the
'--user' and '--password' options (and possibly others) in
addition to what is shown, in order for the *note 'mysql':
mysql. client to be able to connect to the MySQL server.
* If you did _not_ need to create a schema file, you can
re-create the schema using *note 'ndb_restore':
mysql-cluster-programs-ndb-restore. '--restore-meta' (short
form '-m'), similar to what is shown here:
$> ndb_restore --nodeid=1 --backupid=1 --restore-meta --backup-path=/backups/node_1/BACKUP/BACKUP-1
*note 'ndb_restore': mysql-cluster-programs-ndb-restore. must
be able to contact the management server; add the
'--ndb-connectstring' option if and as needed to make this
possible.
Restore the data. This needs to be done once for each data node in the original cluster, each time using that data node's node ID. Assuming that there were 4 data nodes originally, the set of commands required would look something like this:
ndb_restore --nodeid=1 --backupid=1 --restore-data --backup-path=/backups/node_1/BACKUP/BACKUP-1 --disable-indexes
ndb_restore --nodeid=2 --backupid=1 --restore-data --backup-path=/backups/node_2/BACKUP/BACKUP-1 --disable-indexes
ndb_restore --nodeid=3 --backupid=1 --restore-data --backup-path=/backups/node_3/BACKUP/BACKUP-1 --disable-indexes
ndb_restore --nodeid=4 --backupid=1 --restore-data --backup-path=/backups/node_4/BACKUP/BACKUP-1 --disable-indexes
These can be run in parallel.
Be sure to add the '--ndb-connectstring' option as needed.
Rebuild the indexes. These were disabled by the '--disable-indexes' option used in the commands just shown. Recreating the indexes avoids errors due to the restore not being consistent at all points. Rebuilding the indexes can also improve performance in some cases. To rebuild the indexes, execute the following command once, on a single node:
$> ndb_restore --nodeid=1 --backupid=1 --backup-path=/backups/node_1/BACKUP/BACKUP-1 --rebuild-indexes
As mentioned previously, you may need to add the '--ndb-connectstring' option, so that *note 'ndb_restore': mysql-cluster-programs-ndb-restore. can contact the management server.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-select-all, Next: mysql-cluster-programs-ndb-select-count, Prev: mysql-cluster-programs-ndb-restore, Up: mysql-cluster-programs
note 'ndb_select_all': mysql-cluster-programs-ndb-select-all. prints all rows from an note 'NDB': mysql-cluster. table to 'stdout'.
Usage
ndb_select_all -c CONNECTION_STRING TBL_NAME -d DB_NAME [> FILE_NAME]
Options that can be used with *note 'ndb_select_all': mysql-cluster-programs-ndb-select-all. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndb_select_all
Format Description Added, Deprecated, or Removed
' --character-sets-dir=path '
Directory containing (Supported in all NDB character sets releases based on MySQL 5.7)
' --connect-retries=# '
Number of times to (Supported in all NDB retry connection releases based on before giving up MySQL 5.7)
' --connect-retry-delay=# '
Number of seconds to (Supported in all NDB wait between attempts releases based on to contact management MySQL 5.7) server
'--connect-string=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --core-file '
Write core file on (Supported in all NDB error; used in releases based on debugging MySQL 5.7)
'--database=name',
' -d name '
Name of database in (Supported in all NDB which table is found releases based on MySQL 5.7)
' --defaults-extra-file=path '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
'--delimiter=char',
' -D char '
Set column delimiter (Supported in all NDB releases based on MySQL 5.7)
'--descending',
' -z '
Sort resultset in (Supported in all NDB descending order releases based on (requires -order) MySQL 5.7)
' --disk '
Print disk references (Supported in all NDB (useful only for Disk releases based on Data tables having MySQL 5.7) unindexed columns)
' --gci '
Include GCI in output (Supported in all NDB releases based on MySQL 5.7)
' --gci64 '
Include GCI and row (Supported in all NDB epoch in output releases based on MySQL 5.7)
'--header[=value]',
' -h '
Print header (set to (Supported in all NDB 0|FALSE to disable releases based on headers in output) MySQL 5.7)
'--lock=#',
' -l # '
Lock type (Supported in all NDB releases based on MySQL 5.7)
' --login-path=path '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
'--help',
' -? '
Display help text and (Supported in all NDB exit releases based on MySQL 5.7)
'--ndb-connectstring=connection_string',
' -c connection_string '
Set connect string for (Supported in all NDB connecting to releases based on ndb_mgmd. Syntax: MySQL 5.7) "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf
'--ndb-mgmd-host=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --ndb-nodeid=# '
Set node ID for this (Supported in all NDB node, overriding any releases based on ID set by MySQL 5.7) -ndb-connectstring
' --ndb-optimized-node-selection '
Enable optimizations (Supported in all NDB for selection of nodes releases based on for transactions. MySQL 5.7) Enabled by default;
use -skip-ndb-optimized-node-selection to disable
' --no-defaults '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
' --nodata '
Do not print table (Supported in all NDB column data releases based on MySQL 5.7)
'--order=index',
' -o index '
Sort resultset (Supported in all NDB according to index releases based on having this name MySQL 5.7)
'--parallelism=#',
' -p # '
Degree of parallelism (Supported in all NDB releases based on MySQL 5.7)
' --print-defaults '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
' --rowid '
Print row ID (Supported in all NDB releases based on MySQL 5.7)
'--tupscan',
' -t '
Scan in tup order (Supported in all NDB releases based on MySQL 5.7)
'--usage',
' -? '
Display help text and (Supported in all NDB exit; same as -help releases based on MySQL 5.7)
'--useHexFormat',
' -x '
Output numbers in (Supported in all NDB hexadecimal format releases based on MySQL 5.7)
'--version',
' -V '
Display version (Supported in all NDB information and exit releases based on MySQL 5.7)
'--character-sets-dir'
Command-Line Format
'--character-sets-dir=path'
Directory containing character sets.
'--connect-retries'
Command-Line Format
'--connect-retries=#'
Type
Integer
Default Value
'12'
Minimum Value
'0'
Maximum Value
'12'
Number of times to retry connection before giving up.
'--connect-retry-delay'
Command-Line Format
'--connect-retry-delay=#'
Type
Integer
Default Value
'5'
Minimum Value
'0'
Maximum Value
'5'
Number of seconds to wait between attempts to contact management server.
'--connect-string'
Command-Line Format
'--connect-string=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--core-file'
Command-Line Format
'--core-file'
Write core file on error; used in debugging.
'--database=DBNAME', '-d' DBNAME
Name of the database in which the table is found. The default value is 'TEST_DB'.
'--descending', '-z'
Sorts the output in descending order. This option can be used only in conjunction with the '-o' ('--order') option.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--delimiter=CHARACTER', '-D CHARACTER'
Causes the CHARACTER to be used as a column delimiter. Only table data columns are separated by this delimiter.
The default delimiter is the tab character.
'--disk'
Adds a disk reference column to the output. The column is nonempty only for Disk Data tables having nonindexed columns.
'--gci'
Adds a 'GCI' column to the output showing the global checkpoint at which each row was last updated. See note mysql-cluster-overview::, and note mysql-cluster-log-events::, for more information about checkpoints.
'--gci64'
Adds a 'ROW$GCI64' column to the output showing the global checkpoint at which each row was last updated, as well as the number of the epoch in which this update occurred.
'--help'
Command-Line Format
'--help'
Display help text and exit.
'--lock=LOCK_TYPE', '-l LOCK_TYPE'
Employs a lock when reading the table. Possible values for LOCK_TYPE are:
* '0': Read lock
* '1': Read lock with hold
* '2': Exclusive read lock
There is no default value for this option.
'--login-path'
Command-Line Format
'--login-path=path'
Type
String
Default Value
'[none]'
Read given path from login file.
'--header=FALSE'
Excludes column headers from the output.
'--nodata'
Causes any table data to be omitted.
'--ndb-connectstring'
Command-Line Format
'--ndb-connectstring=connection_string'
Type
String
Default Value
'[none]'
Set connect string for connecting to ndb_mgmd. Syntax: "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf.
'--ndb-mgmd-host'
Command-Line Format
'--ndb-mgmd-host=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--ndb-nodeid'
Command-Line Format
'--ndb-nodeid=#'
Type
Integer
Default Value
'[none]'
Set node ID for this node, overriding any ID set by '--ndb-connectstring'.
'--ndb-optimized-node-selection'
Command-Line Format
'--ndb-optimized-node-selection'
Enable optimizations for selection of nodes for transactions. Enabled by default; use '--skip-ndb-optimized-node-selection' to disable.
'--no-defaults'
Command-Line Format
'--no-defaults'
Do not read default options from any option file other than login file.
'--order=INDEX_NAME', '-o INDEX_NAME'
Orders the output according to the index named INDEX_NAME.
Note:
This is the name of an index, not of a column; the index must have been explicitly named when created.
'parallelism=#', '-p' #
Specifies the degree of parallelism.
'--print-defaults'
Command-Line Format
'--print-defaults'
Print program argument list and exit.
'--rowid'
Adds a 'ROWID' column providing information about the fragments in which rows are stored.
'--tupscan', '-t'
Scan the table in the order of the tuples.
'--usage'
Command-Line Format
'--usage'
Display help text and exit; same as '--help'.
'--useHexFormat' '-x'
Causes all numeric values to be displayed in hexadecimal format. This does not affect the output of numerals contained in strings or datetime values.
'--version'
Command-Line Format
'--version'
Display version information and exit.
Sample Output
Output from a MySQL *note 'SELECT': select. statement:
mysql> SELECT * FROM ctest1.fish;
+----+-----------+
| id | name |
+----+-----------+
| 3 | shark |
| 6 | puffer |
| 2 | tuna |
| 4 | manta ray |
| 5 | grouper |
| 1 | guppy |
+----+-----------+
6 rows in set (0.04 sec)
Output from the equivalent invocation of *note 'ndb_select_all': mysql-cluster-programs-ndb-select-all.:
$> ./ndb_select_all -c localhost fish -d ctest1
id name
3 [shark]
6 [puffer]
2 [tuna]
4 [manta ray]
5 [grouper]
1 [guppy]
6 rows returned
NDBT_ProgramExit: 0 - OK
All string values are enclosed by square brackets ('['...']') in the output of *note 'ndb_select_all': mysql-cluster-programs-ndb-select-all. For another example, consider the table created and populated as shown here:
CREATE TABLE dogs (
id INT(11) NOT NULL AUTO_INCREMENT,
name VARCHAR(25) NOT NULL,
breed VARCHAR(50) NOT NULL,
PRIMARY KEY pk (id),
KEY ix (name)
)
TABLESPACE ts STORAGE DISK
ENGINE=NDBCLUSTER;
INSERT INTO dogs VALUES
('', 'Lassie', 'collie'),
('', 'Scooby-Doo', 'Great Dane'),
('', 'Rin-Tin-Tin', 'Alsatian'),
('', 'Rosscoe', 'Mutt');
This demonstrates the use of several additional *note 'ndb_select_all': mysql-cluster-programs-ndb-select-all. options:
$> ./ndb_select_all -d ctest1 dogs -o ix -z --gci --disk
GCI id name breed DISK_REF
834461 2 [Scooby-Doo] [Great Dane] [ m_file_no: 0 m_page: 98 m_page_idx: 0 ]
834878 4 [Rosscoe] [Mutt] [ m_file_no: 0 m_page: 98 m_page_idx: 16 ]
834463 3 [Rin-Tin-Tin] [Alsatian] [ m_file_no: 0 m_page: 34 m_page_idx: 0 ]
835657 1 [Lassie] [Collie] [ m_file_no: 0 m_page: 66 m_page_idx: 0 ]
4 rows returned
NDBT_ProgramExit: 0 - OK
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-select-count, Next: mysql-cluster-programs-ndb-show-tables, Prev: mysql-cluster-programs-ndb-select-all, Up: mysql-cluster-programs
note 'ndb_select_count': mysql-cluster-programs-ndb-select-count. prints the number of rows in one or more note 'NDB': mysql-cluster. tables. With a single table, the result is equivalent to that obtained by using the MySQL statement 'SELECT COUNT(*) FROM TBL_NAME'.
Usage
ndb_select_count [-c CONNECTION_STRING] -dDB_NAME TBL_NAME[, TBL_NAME2[, ...]]
Options that can be used with *note 'ndb_select_count': mysql-cluster-programs-ndb-select-count. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndb_select_count
Format Description Added, Deprecated, or Removed
' --character-sets-dir=path '
Directory containing (Supported in all NDB character sets releases based on MySQL 5.7)
' --connect-retries=# '
Number of times to (Supported in all NDB retry connection releases based on before giving up MySQL 5.7)
' --connect-retry-delay=# '
Number of seconds to (Supported in all NDB wait between attempts releases based on to contact management MySQL 5.7) server
'--connect-string=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --core-file '
Write core file on (Supported in all NDB error; used in releases based on debugging MySQL 5.7)
'--database=name',
'-d name'
Name of database in (Supported in all NDB which table is found releases based on MySQL 5.7)
' --defaults-extra-file=path '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
'--help',
' -? '
Display help text and (Supported in all NDB exit releases based on MySQL 5.7)
'--lock=#',
'-l #'
Lock type (Supported in all NDB releases based on MySQL 5.7)
' --login-path=path '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
'--ndb-connectstring=connection_string',
' -c connection_string '
Set connect string for (Supported in all NDB connecting to releases based on ndb_mgmd. Syntax: MySQL 5.7) "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf
'--ndb-mgmd-host=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --ndb-nodeid=# '
Set node ID for this (Supported in all NDB node, overriding any releases based on ID set by MySQL 5.7) -ndb-connectstring
' --ndb-optimized-node-selection '
Enable optimizations (Supported in all NDB for selection of nodes releases based on for transactions. MySQL 5.7) Enabled by default;
use -skip-ndb-optimized-node-selection to disable
' --no-defaults '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
'--parallelism=#',
'-p #'
Degree of parallelism (Supported in all NDB releases based on MySQL 5.7)
' --print-defaults '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
'--usage',
' -? '
Display help text and (Supported in all NDB exit; same as -help releases based on MySQL 5.7)
'--version',
' -V '
Display version (Supported in all NDB information and exit releases based on MySQL 5.7)
'--character-sets-dir'
Command-Line Format
'--character-sets-dir=path'
Directory containing character sets.
'--connect-retries'
Command-Line Format
'--connect-retries=#'
Type
Integer
Default Value
'12'
Minimum Value
'0'
Maximum Value
'12'
Number of times to retry connection before giving up.
'--connect-retry-delay'
Command-Line Format
'--connect-retry-delay=#'
Type
Integer
Default Value
'5'
Minimum Value
'0'
Maximum Value
'5'
Number of seconds to wait between attempts to contact management server.
'--connect-string'
Command-Line Format
'--connect-string=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--core-file'
Command-Line Format
'--core-file'
Write core file on error; used in debugging.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--login-path'
Command-Line Format
'--login-path=path'
Type
String
Default Value
'[none]'
Read given path from login file.
'--help'
Command-Line Format
'--help'
Display help text and exit.
'--ndb-connectstring'
Command-Line Format
'--ndb-connectstring=connection_string'
Type
String
Default Value
'[none]'
Set connect string for connecting to ndb_mgmd. Syntax: "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf.
'--ndb-mgmd-host'
Command-Line Format
'--ndb-mgmd-host=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--ndb-optimized-node-selection'
Command-Line Format
'--ndb-optimized-node-selection'
Enable optimizations for selection of nodes for transactions. Enabled by default; use '--skip-ndb-optimized-node-selection' to disable.
'--ndb-nodeid'
Command-Line Format
'--ndb-nodeid=#'
Type
Integer
Default Value
'[none]'
Set node ID for this node, overriding any ID set by '--ndb-connectstring'.
'--no-defaults'
Command-Line Format
'--no-defaults'
Do not read default options from any option file other than login file.
'--print-defaults'
Command-Line Format
'--print-defaults'
Print program argument list and exit.
'--usage'
Command-Line Format
'--usage'
Display help text and exit; same as '--help'.
'--version'
Command-Line Format
'--version'
Display version information and exit.
You can obtain row counts from multiple tables in the same database by listing the table names separated by spaces when invoking this command, as shown under Sample Output.
Sample Output
$> ./ndb_select_count -c localhost -d ctest1 fish dogs
6 records in table fish
4 records in table dogs
NDBT_ProgramExit: 0 - OK
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-show-tables, Next: mysql-cluster-programs-ndb-size-pl, Prev: mysql-cluster-programs-ndb-select-count, Up: mysql-cluster-programs
note 'ndb_show_tables': mysql-cluster-programs-ndb-show-tables. displays a list of all note 'NDB': mysql-cluster. database objects in the cluster. By default, this includes not only both user-created tables and note 'NDB': mysql-cluster. system tables, but note 'NDB': mysql-cluster.-specific indexes, internal triggers, and NDB Cluster Disk Data objects as well.
Options that can be used with *note 'ndb_show_tables': mysql-cluster-programs-ndb-show-tables. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndb_show_tables
Format Description Added, Deprecated, or Removed
' --character-sets-dir=path '
Directory containing (Supported in all NDB character sets releases based on MySQL 5.7)
' --connect-retries=# '
Number of times to (Supported in all NDB retry connection releases based on before giving up MySQL 5.7)
' --connect-retry-delay=# '
Number of seconds to (Supported in all NDB wait between attempts releases based on to contact management MySQL 5.7) server
'--connect-string=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --core-file '
Write core file on (Supported in all NDB error; used in releases based on debugging MySQL 5.7)
'--database=name',
' -d name '
Specifies database in (Supported in all NDB which table is found; releases based on database name must be MySQL 5.7) followed by table name
' --defaults-extra-file=path '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
' --login-path=path '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
'--loops=#',
' -l # '
Number of times to (Supported in all NDB repeat output releases based on MySQL 5.7)
'--help',
' -? '
Display help text and (Supported in all NDB exit releases based on MySQL 5.7)
'--ndb-connectstring=connection_string',
' -c connection_string '
Set connect string for (Supported in all NDB connecting to releases based on ndb_mgmd. Syntax: MySQL 5.7) "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf
'--ndb-mgmd-host=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --ndb-nodeid=# '
Set node ID for this (Supported in all NDB node, overriding any releases based on ID set by MySQL 5.7) -ndb-connectstring
' --ndb-optimized-node-selection '
Enable optimizations (Supported in all NDB for selection of nodes releases based on for transactions. MySQL 5.7) Enabled by default;
use -skip-ndb-optimized-node-selection to disable
' --no-defaults '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
'--parsable',
' -p '
Return output suitable (Supported in all NDB for MySQL LOAD DATA releases based on statement MySQL 5.7)
' --print-defaults '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
' --show-temp-status '
Show table temporary (Supported in all NDB flag releases based on MySQL 5.7)
'--type=#',
' -t # '
Limit output to (Supported in all NDB objects of this type releases based on MySQL 5.7)
'--unqualified',
' -u '
Do not qualify table (Supported in all NDB names releases based on MySQL 5.7)
'--usage',
' -? '
Display help text and (Supported in all NDB exit; same as -help releases based on MySQL 5.7)
'--version',
' -V '
Display version (Supported in all NDB information and exit releases based on MySQL 5.7)
Usage
ndb_show_tables [-c CONNECTION_STRING]
'--character-sets-dir'
Command-Line Format
'--character-sets-dir=path'
Directory containing character sets.
'--connect-retries'
Command-Line Format
'--connect-retries=#'
Type
Integer
Default Value
'12'
Minimum Value
'0'
Maximum Value
'12'
Number of times to retry connection before giving up.
'--connect-retry-delay'
Command-Line Format
'--connect-retry-delay=#'
Type
Integer
Default Value
'5'
Minimum Value
'0'
Maximum Value
'5'
Number of seconds to wait between attempts to contact management server.
'--connect-string'
Command-Line Format
'--connect-string=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--core-file'
Command-Line Format
'--core-file'
Write core file on error; used in debugging.
'--database', '-d'
Specifies the name of the database in which the desired table is found. If this option is given, the name of a table must follow the database name.
If this option has not been specified, and no tables are found in the 'TEST_DB' database, *note 'ndb_show_tables': mysql-cluster-programs-ndb-show-tables. issues a warning.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--help'
Command-Line Format
'--help'
Display help text and exit.
'--login-path'
Command-Line Format
'--login-path=path'
Type
String
Default Value
'[none]'
Read given path from login file.
'--loops', '-l'
Specifies the number of times the utility should execute. This is 1 when this option is not specified, but if you do use the option, you must supply an integer argument for it.
'--ndb-connectstring'
Command-Line Format
'--ndb-connectstring=connection_string'
Type
String
Default Value
'[none]'
Set connect string for connecting to ndb_mgmd. Syntax: "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf.
'--ndb-mgmd-host'
Command-Line Format
'--ndb-mgmd-host=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--ndb-nodeid'
Command-Line Format
'--ndb-nodeid=#'
Type
Integer
Default Value
'[none]'
Set node ID for this node, overriding any ID set by '--ndb-connectstring'.
'--ndb-optimized-node-selection'
Command-Line Format
'--ndb-optimized-node-selection'
Enable optimizations for selection of nodes for transactions. Enabled by default; use '--skip-ndb-optimized-node-selection' to disable.
'--no-defaults'
Command-Line Format
'--no-defaults'
Do not read default options from any option file other than login file.
'--parsable', '-p'
Using this option causes the output to be in a format suitable for use with *note 'LOAD DATA': load-data.
'--print-defaults'
Command-Line Format
'--print-defaults'
Print program argument list and exit.
'--show-temp-status'
If specified, this causes temporary tables to be displayed.
'--type', '-t'
Can be used to restrict the output to one type of object, specified by an integer type code as shown here:
* '1': System table
* '2': User-created table
* '3': Unique hash index
Any other value causes all *note 'NDB': mysql-cluster. database objects to be listed (the default).
'--unqualified', '-u'
If specified, this causes unqualified object names to be displayed.
'--usage'
Command-Line Format
'--usage'
Display help text and exit; same as '--help'.
'--version'
Command-Line Format
'--version'
Display version information and exit.
Note:
Only user-created NDB Cluster tables may be accessed from MySQL; system tables such as 'SYSTAB_0' are not visible to note 'mysqld': mysqld. However, you can examine the contents of system tables using note 'NDB': mysql-cluster. API applications such as note 'ndb_select_all': mysql-cluster-programs-ndb-select-all. (see note mysql-cluster-programs-ndb-select-all::).
Prior to NDB 7.5.18 and 7.6.14, this program printed 'NDBT_ProgramExit - STATUS' upon completion of its run, due to an unnecessary dependency on the 'NDBT' testing library. This dependency is has now been removed, eliminating the extraneous output.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-size-pl, Next: mysql-cluster-programs-ndb-top, Prev: mysql-cluster-programs-ndb-show-tables, Up: mysql-cluster-programs
This is a Perl script that can be used to estimate the amount of space that would be required by a MySQL database if it were converted to use the *note 'NDBCLUSTER': mysql-cluster. storage engine. Unlike the other utilities discussed in this section, it does not require access to an NDB Cluster (in fact, there is no reason for it to do so). However, it does need to access the MySQL server on which the database to be tested resides.
Requirements
A running MySQL server. The server instance does not have to provide support for NDB Cluster.
A working installation of Perl.
The 'DBI' module, which can be obtained from CPAN if it is not already part of your Perl installation. (Many Linux and other operating system distributions provide their own packages for this library.)
A MySQL user account having the necessary privileges. If you do not wish to use an existing account, then creating one using 'GRANT USAGE ON DB_NAME.*'--where DB_NAME is the name of the database to be examined--is sufficient for this purpose.
'ndb_size.pl' can also be found in the MySQL sources in 'storage/ndb/tools'.
Options that can be used with *note 'ndb_size.pl': mysql-cluster-programs-ndb-size-pl. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndb_size.pl
Format Description Added, Deprecated, or Removed
' --database=string '
Database or databases (Supported in all NDB to examine; a releases based on comma-delimited list; MySQL 5.7) default is ALL (use
all databases found on server)
' --hostname=string '
Specify host and (Supported in all NDB optional port in releases based on host[:port] format MySQL 5.7)
' --socket=path '
Specify socket to (Supported in all NDB connect to releases based on MySQL 5.7)
' --user=string '
Specify MySQL user (Supported in all NDB name releases based on MySQL 5.7)
' --password=password '
Specify MySQL user (Supported in all NDB password releases based on MySQL 5.7)
' --format=string '
Set output format (Supported in all NDB (text or HTML) releases based on MySQL 5.7)
' --excludetables=list '
Skip any tables in (Supported in all NDB comma-separated list releases based on MySQL 5.7)
' --excludedbs=list '
Skip any databases in (Supported in all NDB comma-separated list releases based on MySQL 5.7)
' --savequeries=path '
Saves all queries on (Supported in all NDB database into file releases based on specified MySQL 5.7)
' --loadqueries=path '
Loads all queries from (Supported in all NDB file specified; does releases based on not connect to MySQL 5.7) database
' --real_table_name=string '
Designates table to (Supported in all NDB handle unique index releases based on size calculations MySQL 5.7)
Usage
perl ndb_size.pl [--database={DB_NAME|ALL}] [--hostname=HOST[:PORT]] [--socket=SOCKET] \
[--user=USER] [--password=PASSWORD] \
[--help|-h] [--format={html|text}] \
[--loadqueries=FILE_NAME] [--savequeries=FILE_NAME]
By default, this utility attempts to analyze all databases on the server. You can specify a single database using the '--database' option; the default behavior can be made explicit by using 'ALL' for the name of the database. You can also exclude one or more databases by using the '--excludedbs' option with a comma-separated list of the names of the databases to be skipped. Similarly, you can cause specific tables to be skipped by listing their names, separated by commas, following the optional '--excludetables' option. A host name can be specified using '--hostname'; the default is 'localhost'. You can specify a port in addition to the host using HOST:PORT format for the value of '--hostname'. The default port number is 3306. If necessary, you can also specify a socket; the default is '/var/lib/mysql.sock'. A MySQL user name and password can be specified the corresponding options shown. It also possible to control the format of the output using the '--format' option; this can take either of the values 'html' or 'text', with 'text' being the default. An example of the text output is shown here:
$> ndb_size.pl --database=test --socket=/tmp/mysql.sock
ndb_size.pl report for database: 'test' (1 tables)
--------------------------------------------------
Connected to: DBI:mysql:host=localhost;mysql_socket=/tmp/mysql.sock
Including information for versions: 4.1, 5.0, 5.1
test.t1
-------
DataMemory for Columns (* means varsized DataMemory):
Column Name Type Varsized Key 4.1 5.0 5.1
HIDDEN_NDB_PKEY bigint PRI 8 8 8
c2 varchar(50) Y 52 52 4*
c1 int(11) 4 4 4
-- -- --
Fixed Size Columns DM/Row 64 64 12
Varsize Columns DM/Row 0 0 4
DataMemory for Indexes:
Index Name Type 4.1 5.0 5.1
PRIMARY BTREE 16 16 16
-- -- --
Total Index DM/Row 16 16 16
IndexMemory for Indexes:
Index Name 4.1 5.0 5.1
PRIMARY 33 16 16
-- -- --
Indexes IM/Row 33 16 16
Summary (for THIS table):
4.1 5.0 5.1
Fixed Overhead DM/Row 12 12 16
NULL Bytes/Row 4 4 4
DataMemory/Row 96 96 48
(Includes overhead, bitmap and indexes)
Varsize Overhead DM/Row 0 0 8
Varsize NULL Bytes/Row 0 0 4
Avg Varside DM/Row 0 0 16
No. Rows 0 0 0
Rows/32kb DM Page 340 340 680
Fixedsize DataMemory (KB) 0 0 0
Rows/32kb Varsize DM Page 0 0 2040
Varsize DataMemory (KB) 0 0 0
Rows/8kb IM Page 248 512 512
IndexMemory (KB) 0 0 0
Parameter Minimum Requirements
------------------------------
* indicates greater than default
Parameter Default 4.1 5.0 5.1
DataMemory (KB) 81920 0 0 0
NoOfOrderedIndexes 128 1 1 1
NoOfTables 128 1 1 1
IndexMemory (KB) 18432 0 0 0
NoOfUniqueHashIndexes 64 0 0 0
NoOfAttributes 1000 3 3 3
NoOfTriggers 768 5 5 5
For debugging purposes, the Perl arrays containing the queries run by this script can be read from the file specified using can be saved to a file using '--savequeries'; a file containing such arrays to be read during script execution can be specified using '--loadqueries'. Neither of these options has a default value.
To produce output in HTML format, use the '--format' option and redirect the output to a file, as shown here:
$> ndb_size.pl --database=test --socket=/tmp/mysql.sock --format=html > ndb_size.html
(Without the redirection, the output is sent to 'stdout'.)
The output from this script includes the following information:
Minimum values for the 'DataMemory', 'IndexMemory', 'MaxNoOfTables', 'MaxNoOfAttributes', 'MaxNoOfOrderedIndexes', and 'MaxNoOfTriggers' configuration parameters required to accommodate the tables analyzed.
Memory requirements for all of the tables, attributes, ordered indexes, and unique hash indexes defined in the database.
The 'IndexMemory' and 'DataMemory' required per table and table row.
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-top, Next: mysql-cluster-programs-ndb-waiter, Prev: mysql-cluster-programs-ndb-size-pl, Up: mysql-cluster-programs
*note 'ndb_top': mysql-cluster-programs-ndb-top. displays running information in the terminal about CPU usage by NDB threads on an NDB Cluster data node. Each thread is represented by two rows in the output, the first showing system statistics, the second showing the measured statistics for the thread.
*note 'ndb_top': mysql-cluster-programs-ndb-top. is available in MySQL NDB Cluster 7.6 (and later).
Usage
ndb_top [-h HOSTNAME] [-t PORT] [-u USER] [-p PASS] [-n NODE_ID]
note 'ndb_top': mysql-cluster-programs-ndb-top. connects to a MySQL Server running as an SQL node of the cluster. By default, it attempts to connect to a note 'mysqld': mysqld. running on 'localhost' and port 3306, as the MySQL 'root' user with no password specified. You can override the default host and port using, respectively, '--host' ('-h') and '--port' ('-t'). To specify a MySQL user and password, use the '--user' ('-u') and '--passwd' ('-p') options. This user must be able to read tables in the note 'ndbinfo': mysql-cluster-ndbinfo. database (note 'ndb_top': mysql-cluster-programs-ndb-top. uses information from *note 'ndbinfo.cpustat': mysql-cluster-ndbinfo-cpustat. and related tables).
For more information about MySQL user accounts and passwords, see *note access-control::.
Output is available as plain text or an ASCII graph; you can specify this using the '--text' ('-x') and '--graph' ('-g') options, respectively. These two display modes provide the same information; they can be used concurrently. At least one display mode must be in use.
Color display of the graph is supported and enabled by default ('--color' or '-c' option). With color support enabled, the graph display shows OS user time in blue, OS system time in green, and idle time as blank. For measured load, blue is used for execution time, yellow for send time, red for time spent in send buffer full waits, and blank spaces for idle time. The percentage shown in the graph display is the sum of percentages for all threads which are not idle. Colors are not currently configurable; you can use grayscale instead by using '--skip-color'.
The sorted view ('--sort', '-r') is based on the maximum of the measured load and the load reported by the OS. Display of these can be enabled and disabled using the '--measured-load' ('-m') and '--os-load' ('-o') options. Display of at least one of these loads must be enabled.
The program tries to obtain statistics from a data node having the node ID given by the '--node-id' ('-n') option; if unspecified, this is 1. *note 'ndb_top': mysql-cluster-programs-ndb-top. cannot provide information about other types of nodes.
The view adjusts itself to the height and width of the terminal window; the minimum supported width is 76 characters.
Once started, *note 'ndb_top': mysql-cluster-programs-ndb-top. runs continuously until forced to exit; you can quit the program using 'Ctrl-C'. The display updates once per second; to set a different delay interval, use '--sleep-time' ('-s').
Note:
*note 'ndb_top': mysql-cluster-programs-ndb-top. is available on macOS, Linux, and Solaris. It is not currently supported on Windows platforms.
The following table includes all options that are specific to the NDB Cluster program *note 'ndb_top': mysql-cluster-programs-ndb-top. Additional descriptions follow the table.
Command-line options used with the program ndb_top
Format Description Added, Deprecated, or Removed
'--color',
' -c '
Show ASCII graphs in ADDED: NDB 7.6.3 color; use
-skip-colors to disable
' --defaults-extra-file=path '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
'--graph',
' -g '
Display data using ADDED: NDB 7.6.3 graphs; use
-skip-graphs to disable
' --help '
Show program usage ADDED: NDB 7.6.3 information
'--host=string',
' -h string '
Host name or IP ADDED: NDB 7.6.3 address of MySQL
Server to connect to
' --login-path=path '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
'--measured-load',
' -m '
Show measured load by ADDED: NDB 7.6.3 thread
' --no-defaults '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
'--node-id=#',
' -n # '
Watch node having this ADDED: NDB 7.6.3 node ID
'--os-load',
' -o '
Show load measured by ADDED: NDB 7.6.3 operating system
'--passwd=password',
' -p password '
Connect using this ADDED: NDB 7.6.3 password (same as
-password option) REMOVED: NDB 7.6.4
'--password=password',
' -p password '
Connect using this ADDED: NDB 7.6.6 password
'--port=#',
'-t #' (<=7.6.5),
'-P #' (>=7.6.6)
Port number to use ADDED: NDB 7.6.3 when connecting to
MySQL Server
' --print-defaults '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
'--sleep-time=#',
' -s # '
Time to wait between ADDED: NDB 7.6.3 display refreshes, in
seconds
'--socket=path',
' -S path '
Socket file to use for ADDED: NDB 7.6.6 connection
'--sort',
' -r '
Sort threads by usage; ADDED: NDB 7.6.3 use -skip-sort to
disable
'--text',
'-x' (<=7.6.5),
'-t' (>=7.6.6)
Display data using ADDED: NDB 7.6.3 text
' --usage '
Show program usage ADDED: NDB 7.6.3 information; same as
-help
'--user=name',
' -u name '
Connect as this MySQL ADDED: NDB 7.6.3 user
Additional Options
'--color', '-c'
Command-Line Format
'--color'
Introduced
5.7.19-ndb-7.6.3
Show ASCII graphs in color; use '--skip-colors' to disable.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--graph', '-g'
Command-Line Format
'--graph'
Introduced
5.7.19-ndb-7.6.3
Display data using graphs; use '--skip-graphs' to disable. This option or '--text' must be true; both options may be true.
'--help', '-?'
Command-Line Format
'--help'
Introduced
5.7.19-ndb-7.6.3
Show program usage information.
'--host['=NAME], '-h'
Command-Line Format
'--host=string'
Introduced
5.7.19-ndb-7.6.3
Type
String
Default Value
'localhost'
Host name or IP address of MySQL Server to connect to.
'--login-path'
Command-Line Format
'--login-path=path'
Type
String
Default Value
'[none]'
Read given path from login file.
'--measured-load', '-m'
Command-Line Format
'--measured-load'
Introduced
5.7.19-ndb-7.6.3
Show measured load by thread. This option or '--os-load' must be true; both options may be true.
'--no-defaults'
Command-Line Format
'--no-defaults'
Do not read default options from any option file other than login file.
'--node-id['=#], '-n'
Command-Line Format
'--node-id=#'
Introduced
5.7.19-ndb-7.6.3
Type
Integer
Default Value
'1'
Watch the data node having this node ID.
'--os-load', '-o'
Command-Line Format
'--os-load'
Introduced
5.7.19-ndb-7.6.3
Show load measured by operating system. This option or '--measured-load' must be true; both options may be true.
'--passwd['=PASSWORD], '-p'
Command-Line Format
'--passwd=password'
Introduced
5.7.19-ndb-7.6.3
Removed
5.7.20-ndb-7.6.4
Type
String
Default Value
'NULL'
Connect to a MySQL Server using this password and the MySQL user specified by '--user'. Synonym for '--password'.
This password is associated with a MySQL user account only, and is not related in any way to the password used with encrypted 'NDB' backups.
'--password['=PASSWORD], '-p'
Command-Line Format
'--password=password'
Introduced
5.7.22-ndb-7.6.6
Type
String
Default Value
'NULL'
Connect to a MySQL Server using this password and the MySQL user specified by '--user'.
This password is associated with a MySQL user account only, and is not related in any way to the password used with encrypted 'NDB' backups.
'--port['=#], '-P'
Command-Line Format
'--port=#'
Introduced
5.7.19-ndb-7.6.3
Type
Integer
Default Value
'3306'
Port number to use when connecting to MySQL Server.
(Formerly, the short form for this option was '-t', which was repurposed as the short form of '--text'.)
'--print-defaults'
Command-Line Format
'--print-defaults'
Print program argument list and exit.
'--sleep-time['=SECONDS], '-s'
Command-Line Format
'--sleep-time=#'
Introduced
5.7.19-ndb-7.6.3
Type
Integer
Default Value
'1'
Time to wait between display refreshes, in seconds.
'--socket=PATH/TO/FILE', -S
Command-Line Format
'--socket=path'
Introduced
5.7.22-ndb-7.6.6
Type
Path name
Default Value
'[none]'
Use the specified socket file for the connection.
'--sort', '-r'
Command-Line Format
'--sort'
Introduced
5.7.19-ndb-7.6.3
Sort threads by usage; use '--skip-sort' to disable.
'--text', '-t'
Command-Line Format
'--text'
Introduced
5.7.19-ndb-7.6.3
Display data using text. This option or '--graph' must be true; both options may be true.
(The short form for this option was '-x' in previous versions of NDB Cluster, but this is no longer supported.)
'--usage'
Command-Line Format
'--usage'
Introduced
5.7.19-ndb-7.6.3
Display help text and exit; same as '--help'.
'--user['=NAME], '-u'
Command-Line Format
'--user=name'
Introduced
5.7.19-ndb-7.6.3
Type
String
Default Value
'root'
Connect as this MySQL user. Normally requires a password supplied by the '--password' option.
Sample Output
The next figure shows note 'ndb_top': mysql-cluster-programs-ndb-top. running in a terminal window on a Linux system with an note 'ndbmtd': mysql-cluster-programs-ndbmtd. data node under a moderate load. Here, the program has been invoked using *note 'ndb_top': mysql-cluster-programs-ndb-top. '-n8' '-x' to provide both text and graph output:
FIGURE GOES HERE: ndb_top Running in Terminal
File: manual.info.tmp, Node: mysql-cluster-programs-ndb-waiter, Prev: mysql-cluster-programs-ndb-top, Up: mysql-cluster-programs
*note 'ndb_waiter': mysql-cluster-programs-ndb-waiter. repeatedly (each 100 milliseconds) prints out the status of all cluster data nodes until either the cluster reaches a given status or the '--timeout' limit is exceeded, then exits. By default, it waits for the cluster to achieve 'STARTED' status, in which all nodes have started and connected to the cluster. This can be overridden using the '--no-contact' and '--not-started' options.
The node states reported by this utility are as follows:
'NO_CONTACT': The node cannot be contacted.
'UNKNOWN': The node can be contacted, but its status is not yet known. Usually, this means that the node has received a 'START' or 'RESTART' command from the management server, but has not yet acted on it.
'NOT_STARTED': The node has stopped, but remains in contact with the cluster. This is seen when restarting the node using the management client's 'RESTART' command.
'STARTING': The node's *note 'ndbd': mysql-cluster-programs-ndbd. process has started, but the node has not yet joined the cluster.
'STARTED': The node is operational, and has joined the cluster.
'SHUTTING_DOWN': The node is shutting down.
'SINGLE USER MODE': This is shown for all cluster data nodes when the cluster is in single user mode.
Options that can be used with *note 'ndb_waiter': mysql-cluster-programs-ndb-waiter. are shown in the following table. Additional descriptions follow the table.
Command-line options used with the program ndb_waiter
Format Description Added, Deprecated, or Removed
' --character-sets-dir=path '
Directory containing (Supported in all NDB character sets releases based on MySQL 5.7)
' --connect-retries=# '
Number of times to (Supported in all NDB retry connection releases based on before giving up MySQL 5.7)
' --connect-retry-delay=# '
Number of seconds to (Supported in all NDB wait between attempts releases based on to contact management MySQL 5.7) server
'--connect-string=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --core-file '
Write core file on (Supported in all NDB error; used in releases based on debugging MySQL 5.7)
' --defaults-extra-file=path '
Read given file after (Supported in all NDB global files are read releases based on MySQL 5.7)
' --defaults-file=path '
Read default options (Supported in all NDB from given file only releases based on MySQL 5.7)
' --defaults-group-suffix=string '
Also read groups with (Supported in all NDB concat(group, suffix) releases based on MySQL 5.7)
'--help',
' -? '
Display help text and (Supported in all NDB exit releases based on MySQL 5.7)
' --login-path=path '
Read given path from (Supported in all NDB login file releases based on MySQL 5.7)
'--ndb-connectstring=connection_string',
' -c connection_string '
Set connect string for (Supported in all NDB connecting to releases based on ndb_mgmd. Syntax: MySQL 5.7) "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf
'--ndb-mgmd-host=connection_string',
' -c connection_string '
Same as (Supported in all NDB -ndb-connectstring releases based on MySQL 5.7)
' --ndb-nodeid=# '
Set node ID for this (Supported in all NDB node, overriding any releases based on ID set by MySQL 5.7) -ndb-connectstring
' --ndb-optimized-node-selection '
Enable optimizations (Supported in all NDB for selection of nodes releases based on for transactions. MySQL 5.7) Enabled by default;
use -skip-ndb-optimized-node-selection to disable
'--no-contact',
' -n '
Wait for cluster to (Supported in all NDB reach NO CONTACT state releases based on MySQL 5.7)
' --no-defaults '
Do not read default (Supported in all NDB options from any releases based on option file other than MySQL 5.7) login file
' --not-started '
Wait for cluster to (Supported in all NDB reach NOT STARTED releases based on state MySQL 5.7)
' --nowait-nodes=list '
List of nodes not to (Supported in all NDB be waited for releases based on MySQL 5.7)
' --print-defaults '
Print program argument (Supported in all NDB list and exit releases based on MySQL 5.7)
' --single-user '
Wait for cluster to (Supported in all NDB enter single user mode releases based on MySQL 5.7)
'--timeout=#',
' -t # '
Wait this many (Supported in all NDB seconds, then exit releases based on whether or not cluster MySQL 5.7) has reached desired
state
'--usage',
' -? '
Display help text and (Supported in all NDB exit; same as -help releases based on MySQL 5.7)
'--version',
' -V '
Display version (Supported in all NDB information and exit releases based on MySQL 5.7)
'--wait-nodes=list',
' -w list '
List of nodes to be (Supported in all NDB waited for releases based on MySQL 5.7)
Usage
ndb_waiter [-c CONNECTION_STRING]
Additional Options
'--character-sets-dir'
Command-Line Format
'--character-sets-dir=path'
Directory containing character sets.
'--connect-retries'
Command-Line Format
'--connect-retries=#'
Type
Integer
Default Value
'12'
Minimum Value
'0'
Maximum Value
'12'
Number of times to retry connection before giving up.
'--connect-retry-delay'
Command-Line Format
'--connect-retry-delay=#'
Type
Integer
Default Value
'5'
Minimum Value
'0'
Maximum Value
'5'
Number of seconds to wait between attempts to contact management server.
'--connect-string'
Command-Line Format
'--connect-string=connection_string'
Type
String
Default Value
'[none]'
Same as '--ndb-connectstring'.
'--core-file'
Command-Line Format
'--core-file'
Write core file on error; used in debugging.
'--defaults-extra-file'
Command-Line Format
'--defaults-extra-file=path'
Type
String
Default Value
'[none]'
Read given file after global files are read.
'--defaults-file'
Command-Line Format
'--defaults-file=path'
Type
String
Default Value
'[none]'
Read default options from given file only.
'--defaults-group-suffix'
Command-Line Format
'--defaults-group-suffix=string'
Type
String
Default Value
'[none]'
Also read groups with concat(group, suffix).
'--login-path'
Command-Line Format
'--login-path=path'
Type
String
Default Value
'[none]'
Read given path from login file.
'--help'
Command-Line Format
'--help'
Display help text and exit.
'--ndb-connectstring'
Command-Line Format
'--ndb-connectstring=connection_string'
Type
String
Default Value
'[none]'
Set connect string for connecting to ndb_mgmd. Syntax: "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf.
'--ndb-mgmd-host'
Command-Line Format
'--ndb-mgmd-host=connection_string'
Type
String
Default Value
'[none]'
Same as -'ndb-connectstring'.
'--ndb-nodeid'
Command-Line Format
'--ndb-nodeid=#'
Type
Integer
Default Value
'[none]'
Set node ID for this node, overriding any ID set by '--ndb-connectstring'.
'--ndb-optimized-node-selection'
Command-Line Format
'--ndb-optimized-node-selection'
Enable optimizations for selection of nodes for transactions. Enabled by default; use '--skip-ndb-optimized-node-selection' to disable.
'--no-contact', '-n'
Instead of waiting for the 'STARTED' state, *note 'ndb_waiter': mysql-cluster-programs-ndb-waiter. continues running until the cluster reaches 'NO_CONTACT' status before exiting.
'--no-defaults'
Command-Line Format
'--no-defaults'
Do not read default options from any option file other than login file.
'--not-started'
Instead of waiting for the 'STARTED' state, *note 'ndb_waiter': mysql-cluster-programs-ndb-waiter. continues running until the cluster reaches 'NOT_STARTED' status before exiting.
'--nowait-nodes=LIST'
When this option is used, *note 'ndb_waiter': mysql-cluster-programs-ndb-waiter. does not wait for the nodes whose IDs are listed. The list is comma-delimited; ranges can be indicated by dashes, as shown here:
$> ndb_waiter --nowait-nodes=1,3,7-9
Important:
Do not use this option together with the '--wait-nodes' option.
'--print-defaults'
Command-Line Format
'--print-defaults'
Print program argument list and exit.
'--timeout=SECONDS', '-t SECONDS'
Time to wait. The program exits if the desired state is not achieved within this number of seconds. The default is 120 seconds (1200 reporting cycles).
'--single-user'
The program waits for the cluster to enter single user mode.
'--usage'
Command-Line Format
'--usage'
Display help text and exit; same as '--help'.
'--version'
Command-Line Format
'--version'
Display version information and exit.
'--wait-nodes=LIST', '-w LIST'
When this option is used, *note 'ndb_waiter': mysql-cluster-programs-ndb-waiter. waits only for the nodes whose IDs are listed. The list is comma-delimited; ranges can be indicated by dashes, as shown here:
$> ndb_waiter --wait-nodes=2,4-6,10
Important:
Do not use this option together with the '--nowait-nodes' option.
Sample Output
Shown here is the output from *note 'ndb_waiter': mysql-cluster-programs-ndb-waiter. when run against a 4-node cluster in which two nodes have been shut down and then started again manually. Duplicate reports (indicated by '...') are omitted.
$> ./ndb_waiter -c localhost
Connecting to mgmsrv at (localhost)
State node 1 STARTED
State node 2 NO_CONTACT
State node 3 STARTED
State node 4 NO_CONTACT
Waiting for cluster enter state STARTED
...
State node 1 STARTED
State node 2 UNKNOWN
State node 3 STARTED
State node 4 NO_CONTACT
Waiting for cluster enter state STARTED
...
State node 1 STARTED
State node 2 STARTING
State node 3 STARTED
State node 4 NO_CONTACT
Waiting for cluster enter state STARTED
...
State node 1 STARTED
State node 2 STARTING
State node 3 STARTED
State node 4 UNKNOWN
Waiting for cluster enter state STARTED
...
State node 1 STARTED
State node 2 STARTING
State node 3 STARTED
State node 4 STARTING
Waiting for cluster enter state STARTED
...
State node 1 STARTED
State node 2 STARTED
State node 3 STARTED
State node 4 STARTING
Waiting for cluster enter state STARTED
...
State node 1 STARTED
State node 2 STARTED
State node 3 STARTED
State node 4 STARTED
Waiting for cluster enter state STARTED
Note:
If no connection string is specified, then *note 'ndb_waiter': mysql-cluster-programs-ndb-waiter. tries to connect to a management on 'localhost', and reports 'Connecting to mgmsrv at (null)'.
Prior to NDB 7.5.18 and 7.6.14, this program printed 'NDBT_ProgramExit - STATUS' upon completion of its run, due to an unnecessary dependency on the 'NDBT' testing library. This dependency is has now been removed, eliminating the extraneous output.
File: manual.info.tmp, Node: mysql-cluster-management, Next: mysql-cluster-replication, Prev: mysql-cluster-programs, Up: mysql-cluster