21.5.30 ndb_waiter — Wait for NDB Cluster to Reach a Given Status (original) (raw)

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

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 achieveSTARTED 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 ndb_waiter are shown in the following table. Additional descriptions follow the table.

Table 21.46 Command-line options used with the program ndb_waiter

Format Description Added, Deprecated, or Removed
--character-sets-dir=path Directory containing character sets (Supported in all NDB releases based on MySQL 5.7)
--connect-retries=# Number of times to retry connection before giving up (Supported in all NDB releases based on MySQL 5.7)
--connect-retry-delay=# Number of seconds to wait between attempts to contact management server (Supported in all NDB releases based on MySQL 5.7)
--connect-string=connection_string, -c connection_string Same as --ndb-connectstring (Supported in all NDB releases based on MySQL 5.7)
--core-file Write core file on error; used in debugging (Supported in all NDB releases based on MySQL 5.7)
--defaults-extra-file=path Read given file after global files are read (Supported in all NDB releases based on MySQL 5.7)
--defaults-file=path Read default options from given file only (Supported in all NDB releases based on MySQL 5.7)
--defaults-group-suffix=string Also read groups with concat(group, suffix) (Supported in all NDB releases based on MySQL 5.7)
--help, -? Display help text and exit (Supported in all NDB releases based on MySQL 5.7)
--login-path=path Read given path from login file (Supported in all NDB releases based on MySQL 5.7)
--ndb-connectstring=connection_string, -c connection_string Set connect string for connecting to ndb_mgmd. Syntax: "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf (Supported in all NDB releases based on MySQL 5.7)
--ndb-mgmd-host=connection_string, -c connection_string Same as --ndb-connectstring (Supported in all NDB releases based on MySQL 5.7)
--ndb-nodeid=# Set node ID for this node, overriding any ID set by --ndb-connectstring (Supported in all NDB releases based on MySQL 5.7)
--ndb-optimized-node-selection Enable optimizations for selection of nodes for transactions. Enabled by default; use --skip-ndb-optimized-node-selection to disable (Supported in all NDB releases based on MySQL 5.7)
--no-contact, -n Wait for cluster to reach NO CONTACT state (Supported in all NDB releases based on MySQL 5.7)
--no-defaults Do not read default options from any option file other than login file (Supported in all NDB releases based on MySQL 5.7)
--not-started Wait for cluster to reach NOT STARTED state (Supported in all NDB releases based on MySQL 5.7)
--nowait-nodes=list List of nodes not to be waited for (Supported in all NDB releases based on MySQL 5.7)
--print-defaults Print program argument list and exit (Supported in all NDB releases based on MySQL 5.7)
--single-user Wait for cluster to enter single user mode (Supported in all NDB releases based on MySQL 5.7)
--timeout=#, -t # Wait this many seconds, then exit whether or not cluster has reached desired state (Supported in all NDB releases based on MySQL 5.7)
--usage, -? Display help text and exit; same as --help (Supported in all NDB releases based on MySQL 5.7)
--version, -V Display version information and exit (Supported in all NDB releases based on MySQL 5.7)
--wait-nodes=list, -w list List of nodes to be waited for (Supported in all NDB releases based on MySQL 5.7)

Usage

ndb_waiter [-c connection_string]

Additional Options

$> ndb_waiter --nowait-nodes=1,3,7-9  

Important
Do not use this option together with the --wait-nodes option.

$> ndb_waiter --wait-nodes=2,4-6,10  

Important
Do not use this option together with the --nowait-nodes option.

Sample Output. Shown here is the output from 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, thenndb_waiter tries to connect to a management on localhost, and reportsConnecting to mgmsrv at (null).

Prior to NDB 7.5.18 and 7.6.14, this program printedNDBT_ProgramExit -_`status`_ upon completion of its run, due to an unnecessary dependency on theNDBT testing library. This dependency is has now been removed, eliminating the extraneous output.