(mysql.info.gz) MySQL Cluster Config Example
Info Catalog
(mysql.info.gz) MySQL Cluster Config File
(mysql.info.gz) MySQL Cluster Config File
(mysql.info.gz) MySQL Cluster Connectstring
16.3.4.1 Example Configuration for a MySQL Cluster
..................................................
In order to support MySQL Cluster, you will need to update `my.cnf' as
shown in the example below.
From version 4.1.8 some simplifications in `my.cnf' were made,
including new sections for the `ndbcluster' executables. However, these
should not be confused with those occurring in `config.ini' files. As
always, you may specify these parameters when invoking those
executables from the command line.
# my.cnf
# example additions to my.cnf for MySQL Cluster
# (valid from 4.1.8)
# enable ndbcluster storage engine, and provide connectstring for
# management server host (default port is 1186)
[mysqld]
ndbcluster
ndb-connectstring=ndb_mgmd.mysql.com
# provide connectstring for management server host (default port: 1186)
[ndbd]
connect-string=ndb_mgmd.mysql.com
# provide connectstring for management server host (default port: 1186)
[ndb_mgm]
connect-string=ndb_mgmd.mysql.com
# provide location of cluster configuration file
[ndb_mgmd]
config-file=/etc/config.ini
(For more information on connectstrings, see MySQL Cluster
Connectstring.)
# my.cnf
# example additions to my.cnf for MySQL Cluster
# (will work on all versions)
# enable ndbcluster storage engine, and provide connectstring for management
# server host to the default port 2200
[mysqld]
ndbcluster
ndb-connectstring=ndb_mgmd.mysql.com:2200
Also starting with MySQL 4.1.8, the `my.cnf' file supports a separate
`[mysql_cluster]' section for settings to be read by and affecting all
executables in the cluster:
# cluster-specific settings
[mysql_cluster]
ndb-connectstring=ndb_mgmd.mysql.com:2200
Currently the configuration file is in INI format, and is named
`config.ini' by default. It is read by `ndb_mgmd' at startup and it can
be placed anywhere. Its location and name are specified by using
`--config-file=[<path>]<filename>' on the command line with `ndb_mgmd'.
If the configuration file is not specified, `ndb_mgmd' will by default
try to read a `config.ini' located in the current working directory.
Default values are defined for most parameters, and can also be
specified in `config.ini'. To create a default value section, simply
add the word `DEFAULT' to the section name. For example, DB nodes are
configured using `[DB]' sections. If all DB nodes use the same data
memory size, and this is not the same as the default size, create a
`[DB DEFAULT]' section containing a `DataMemory' line to specify the
default data memory size for all DB nodes.
The INI format consists of sections preceded by section headings
(surrounded by square brackets), followed by the appropriate parameter
names and values. One deviation from the standard format is that the
parameter name and value can be separated by a colon (`:') as well as
the equals sign (`='); another is that sections are not uniquely
identified by name. Instead, unique entries (such as two different
nodes of the same type) are identified by a unique ID.
At a minimum, the configuration file must define the computers and
nodes involved in the cluster and on which computers these nodes are
located. An example of a simple configuration file for a cluster
consisting of one management server, two storage nodes and two MySQL
servers is shown below:
# file "config.ini" - 2 DB nodes and 2 mysqld
# This file is placed in the startup directory of ndb_mgmd,
# i.e., the management server.
# The first MySQL Server can be started from any host and the second
# can only be started at the host mysqld_5.mysql.com
# NDBD, MYSQLD, and NDB_MGMD are aliases for DB, API, and MGM respectively
#
[NDBD DEFAULT]
NoOfReplicas= 2
DataDir= /var/lib/mysql-cluster
[NDB_MGMD]
Hostname= ndb_mgmd.mysql.com
DataDir= /var/lib/mysql-cluster
[NDBD]
HostName= ndbd_2.mysql.com
[NDBD]
HostName= ndbd_3.mysql.com
[MYSQLD]
[MYSQLD]
HostName= mysqld_5.mysql.com
There are six different sections in this configuration file:
* `[COMPUTER]': Defines the computers in the cluster.
* `[DB|NDBD]': Defines the cluster's storage nodes.
* `[API|MYSQLD]': Defines the cluster's MySQL server nodes.
* `[MGM|NDB_MGMD]': Defines the management server node in the
cluster.
* `[TCP]': Defines TCP/IP connections between nodes in the cluster,
with TCP/IP being the default connection protocol.
* `[SHM]': Defines shared-memory connections between nodes. This
type of connection is available only in binaries that have been
built with `--with-ndb-shm'.
Note that each node has its own section in the `config.ini'. For
instance, since this cluster has two storage nodes, the configuration
file contains two sections defining these nodes. (In the example above,
these sections are labeled with `[NDBD]', but either or both of them
could have been labeled with `[DB]' instead.)
One can define `DEFAULT' values for each section. As of MySQL 4.1.5,
all parameter names are case insensitive.
Info Catalog
(mysql.info.gz) MySQL Cluster Config File
(mysql.info.gz) MySQL Cluster Config File
(mysql.info.gz) MySQL Cluster Connectstring
automatically generated byinfo2html