Individual Programs

Many different programs are used with MySQL Cluster. Some of the programs are exclusive to MySQL Cluster, whereas a lot of them are used with normal MySQL, and you may be familiar with them already. All these programs have a plethora of different command-line options that can be used with them. The following sections discuss the different programs and some of the most commonly used options.

The mysqld Program

mysqld is the normal MySQL server. It handles all the incoming client connections and handles all the SQL processing in the cluster.

The following is the most common option for mysqld:




Tells the MySQL server to enable the storage engine and to join the cluster setup.


The mysql Program

mysql is the default command-line client for logging in to the MySQL server. All SQL statements in this book (for example, CREATE TABLE, ALTER TABLE, SELECT) can be issued through this interface.

The following are the common options for mysql:



--host or -h

Specifies where to connect to the MySQL server.

--user or -u

Specifies which user to attempt to log in to the server as.

--password or -p

Prompts you for the password (or you can specify it on the command line). Unlike with other options, you cannot use a space between -p and <password> when providing it.


The ndbd Program

The ndbd binary represents a data node instance. You have to execute it once for each data node in the cluster setup. It is in charge of the actual physical storage and reading/writing of memory and disk with regard to the table data you manipulate.

The following are the common options for ndbd:




Causes ndbd to delete everything stored on disk. This is normally only used the first time you run the node or, in some cases, during a change of a configuration parameter.

--nostart or -n

Causes ndbd to connect to the management server and retrieve the configuration information but not actually perform any data manipulations. It can later be fully started from within the management server, using the START option.


You need to be very careful.3 with the --initial option, as it can result in total data loss.


The ndb_mgmd Program

The ndb_mgmd binary represents the management server. This program reads in the cluster configuration file (config.ini) and then sends the configuration to any of the later starting nodes. It is also used for management (for example, restarting nodes, starting backups) and monitoring the health of the cluster. It also creates the cluster log, which is a central location for all cluster activities to be logged to.

The following is the most common option for ndb_mgmd:



--config-file or -f

Tells the management node where to find the cluster configuration. If you do not specify a file, MySQL Cluster looks for a file called config.ini in the current working directory.


The ndb_mgm Program

The ndb_mgm binary is the management client. It is used to log in to the management server and issue the commands to actually do the monitoring and management tasks. Normally, it runs in interactive mode, allowing you to issue commands and see their results immediately.

The following is the most common option for ndb_mgm:



--execute or -e

Causes the client to issue a single command and return the result instead of running in interactive mode. This option is commonly used during shell scripting for various tasks.


The ndb_desc Program

The ndb_desc program allows you to connect directly to the cluster and examine the structure of a table. This can be useful for ensuring that the cluster has the table structure you expect.

The following is the most common option for ndb_desc:



--database or -d

Tells the cluster what database the table is in. This option always has to be specified.

The following is an example of the ndb_desc program:

ndb_desc --database dbname tblname


The ndb_restore Program

The ndb_restore binary is used to restore a backup taken from the hot online native backup command in MySQL Cluster. It is run as many times as there are nodes in the cluster in the backup process.Chapter3, "Backup and Recovery," provides more information.

The following are the common options for ndb_restore:



--backupid or -b

Specifies which backup you want to restore. Every backup is assigned an ID when it is taken, and you need to specify the ID here.

--nodeid or -n

Specifies the original node ID. Note that the node ID is stored in the backup filenames, so you can look it up if you forget it.

--restore_meta or -m

Causes the ndb_restore program to re-create all the table and index structures into the cluster. This is used only for the data you are restoring for the first node.

--restore_data or -r

Causes the ndb_restore program to re-insert the data into the cluster. This option needs to be used for all the original data nodes.


The ndb_show_tables Program

The ndb_show_tables program connects directly to the cluster (not using the MySQL server) and retrieves and outputs a list of all the tables that exist. It is most commonly used for testing that a cluster is up and has in it all the tables that should be there.

The ndb_waiter Program

The ndb_waiter program is designed to allow you to wait until the cluster has entered a certain state before returning. This can be useful when you want to take a certain action when the nodes all reach some point. The two most common times are for all of them to be started and handling requests or for them to be running but waiting to be actually started (due to the --nostart option for ndbd). The default is for ndb_waiter to wait until all the nodes are running.

The following is the most common option for ndb_waiter:




Changes the behavior and makes the program wait until all the nodes are started but not running yet (--nostart option for ndbd).


The perror Program

The perror program is designed to aid in debugging error codes back to plain text. It accepts both MySQL and NDB error codes. The default is to look for the MySQL error code.

The following is the most common option for perror:




Causes perror to attempt to look up the code that NDB has given.

MySQL Clustering
MySQL Clustering
ISBN: 0672328550
EAN: 2147483647
Year: N/A
Pages: 93 © 2008-2020.
If you may any questions please contact us: