21.5 NDB Cluster Programs

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

21.5.1 ndbd -- The NDB Cluster Data Node Daemon

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.

*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'.

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

21.5.2 ndbinfo_select_all -- Select From ndbinfo Tables

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)

*note 'ndbinfo_select_all': mysql-cluster-programs-ndbinfo-select-all. is unable to read the following tables:

 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

21.5.3 ndbmtd -- The NDB Cluster Data Node Daemon (Multi-Threaded)

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:

  1. 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::.

  2. 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

21.5.4 ndb_mgmd -- The NDB Cluster Management Server Daemon

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)

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.

 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

21.5.5 ndb_mgm -- The NDB Cluster Management Client

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)

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

21.5.6 ndb_blob_tool -- Check and Repair BLOB and TEXT columns of NDB Cluster Tables

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)

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

21.5.7 ndb_config -- Extract NDB Cluster Configuration Information

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

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

  1. 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.

  2. 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
  3. 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.

  4. 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

21.5.8 ndb_cpcd -- Automate Testing for NDB Development

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

21.5.9 ndb_delete_all -- Delete All Rows from an NDB Table

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)

 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

21.5.10 ndb_desc -- Describe NDB Tables

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)

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

21.5.11 ndb_drop_index -- Drop Index from an NDB Table

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)

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

21.5.12 ndb_drop_table -- Drop an NDB Table

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)

 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

21.5.13 ndb_error_reporter -- NDB Error-Reporting Utility

*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:

 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

21.5.14 ndb_import -- Import CSV Data Into NDB

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:

  1. 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.

  2. 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

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

21.5.15 ndb_index_stat -- NDB Index Statistics Utility

*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)

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::).

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::).

 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

21.5.16 ndb_move_data -- NDB Data Copy Utility

*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)

 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

21.5.17 ndb_perror -- Obtain NDB Error Message Information

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

 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

21.5.18 ndb_print_backup_file -- Print NDB Backup File Contents

*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

21.5.19 ndb_print_file -- Print NDB Disk Data File Contents

*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:

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

21.5.20 ndb_print_frag_file -- Print NDB Fragment List File Contents

*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

21.5.21 ndb_print_schema_file -- Print NDB Schema File Contents

*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

21.5.22 ndb_print_sys_file -- Print NDB System File Contents

*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

21.5.23 ndb_redo_log_reader -- Check and Print Content of Cluster Redo Log

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:

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

21.5.24 ndb_restore -- Restore an NDB Cluster Backup

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)

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 .......................................................................

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:

 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:

 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 .......................................................

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.

  1. 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.

  2. Perform a backup in the normal manner. See *note mysql-cluster-backup-using-management-client::, for information about how to do this.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  1. 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.

  2. 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.

  3. 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:

  1. 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.
  2. 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.

  3. 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

21.5.25 ndb_select_all -- Print Rows from an NDB Table

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)

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

21.5.26 ndb_select_count -- Print Row Counts for NDB Tables

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)

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

21.5.27 ndb_show_tables -- Display List of NDB Tables

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]

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

21.5.28 ndb_size.pl -- NDBCLUSTER Size Requirement Estimator

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

'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:

 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

21.5.29 ndb_top -- View CPU usage information for NDB threads

*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

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

21.5.30 ndb_waiter -- Wait for NDB Cluster to Reach a Given Status

*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:

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

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