MySQL 5.0 Reference Manual  /  ...  /  Defining SQL and Other API Nodes in a MySQL Cluster Defining SQL and Other API Nodes in a MySQL Cluster

The [mysqld] and [api] sections in the config.ini file define the behavior of the MySQL servers (SQL nodes) and other applications (API nodes) used to access cluster data. None of the parameters shown is required. If no computer or host name is provided, any host can use this SQL or API node.

Generally speaking, a [mysqld] section is used to indicate a MySQL server providing an SQL interface to the cluster, and an [api] section is used for applications other than mysqld processes accessing cluster data, but the two designations are actually synonomous; you can, for instance, list parameters for a MySQL server acting as an SQL node in an [api] section.


For a discussion of MySQL server options for MySQL Cluster, see Section, “mysqld Command Options for MySQL Cluster”; for information about MySQL server system variables relating to MySQL Cluster, see Section, “MySQL Cluster System Variables”.

  • Id

    Effective VersionType/UnitsDefaultRange/ValuesRestart Type
    MySQL 5.0.0unsigned[none]1 - 63IS

    The Id is an integer value used to identify the node in all cluster internal messages. It must be an integer in the range 1 to 63 inclusive, and must be unique among all node IDs within the cluster.

    In MySQL 5.0.15 and later, NodeId is a synonym for this parameter, and is the preferred form. In MySQL Cluster NDB 6.2 and later, Id is deprecated in favor of NodeId for identifying SQL and other API nodes.

  • NodeId

    Effective VersionType/UnitsDefaultRange/ValuesRestart Type
    MySQL 5.0.15unsigned[none]1 - 63IS

    Beginning with MySQL 5.0.15, NodeId is available as a synonym for Id.

    In MySQL Cluster NDB 6.2 and later, Id is deprecated in favor of NodeId for identifying SQL and API nodes.

  • ExecuteOnComputer

    Effective VersionType/UnitsDefaultRange/ValuesRestart Type
    MySQL 5.0.0name[none]...S

    This refers to the Id set for one of the computers (hosts) defined in a [computer] section of the configuration file.

  • HostName

    Effective VersionType/UnitsDefaultRange/ValuesRestart Type
    MySQL 5.0.0name or IP address[none]...N

    Specifying this parameter defines the hostname of the computer on which the SQL node (API node) is to reside. To specify a hostname, either this parameter or ExecuteOnComputer is required.

    If no HostName or ExecuteOnComputer is specified in a given [mysql] or [api] section of the config.ini file, then an SQL or API node may connect using the corresponding slot from any host which can establish a network connection to the management server host machine. This differs from the default behavior for data nodes, where localhost is assumed for HostName unless otherwise specified.

  • ArbitrationRank

    Effective VersionType/UnitsDefaultRange/ValuesRestart Type
    MySQL 5.0.00-200 - 2N

    This parameter defines which nodes can act as arbitrators. Both management nodes and SQL nodes can be arbitrators. A value of 0 means that the given node is never used as an arbitrator, a value of 1 gives the node high priority as an arbitrator, and a value of 2 gives it low priority. A normal configuration uses the management server as arbitrator, setting its ArbitrationRank to 1 (the default for management nodes) and those for all SQL nodes to 0 (the default for SQL nodes).

  • ArbitrationDelay

    Effective VersionType/UnitsDefaultRange/ValuesRestart Type
    MySQL 5.0.0milliseconds00 - 4294967039 (0xFFFFFEFF)N

    Setting this parameter to any other value than 0 (the default) means that responses by the arbitrator to arbitration requests will be delayed by the stated number of milliseconds. It is usually not necessary to change this value.

  • BatchByteSize

    Effective VersionType/UnitsDefaultRange/ValuesRestart Type
    MySQL 5.0.0bytes32K1024 - 1MN

    For queries that are translated into full table scans or range scans on indexes, it is important for best performance to fetch records in properly sized batches. It is possible to set the proper size both in terms of number of records (BatchSize) and in terms of bytes (BatchByteSize). The actual batch size is limited by both parameters.

    The speed at which queries are performed can vary by more than 40% depending upon how this parameter is set.

    This parameter is measured in bytes. The default value is 32K.

  • BatchSize

    Effective VersionType/UnitsDefaultRange/ValuesRestart Type
    MySQL 5.0.0records641 - 992N

    This parameter is measured in number of records and is by default set to 64. The maximum size is 992.

  • MaxScanBatchSize

    Effective VersionType/UnitsDefaultRange/ValuesRestart Type
    MySQL 5.0.0bytes256K32K - 16MN

    The batch size is the size of each batch sent from each data node. Most scans are performed in parallel to protect the MySQL Server from receiving too much data from many nodes in parallel; this parameter sets a limit to the total batch size over all nodes.

    The default value of this parameter is set to 256KB. Its maximum size is 16MB.

You can obtain some information from a MySQL server running as a Cluster SQL node using SHOW STATUS in the mysql client, as shown here:

mysql> SHOW STATUS LIKE 'ndb%';
| Variable_name               | Value         |
| Ndb_cluster_node_id         | 5             |
| Ndb_config_from_host        | |
| Ndb_config_from_port        | 1186          |
| Ndb_number_of_storage_nodes | 4             |
4 rows in set (0.02 sec)

For information about these Cluster system status variables, see Section 5.1.6, “Server Status Variables”.


To add new SQL or API nodes to the configuration of a running MySQL Cluster, it is necessary to perform a rolling restart of all cluster nodes after adding new [mysqld] or [api] sections to the config.ini file (or files, if you are using more than one management server). This must be done before the new SQL or API nodes can connect to the cluster.

It is not necessary to perform any restart of the cluster if new SQL or API nodes can employ previously unused API slots in the cluster configuration to connect to the cluster.

User Comments
Sign Up Login You must be logged in to post a comment.