:: DEVELOPER ZONE
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
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
Section 16.4.4.2, “The 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 1186 [mysqld] ndbcluster ndb-connectstring=ndb_mgmd.mysql.com:1186
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:1186
Currently the configuration file is in INI format, and is named
config.ini by default. It is read by
ndb_mgmd at startup and can be placed anywhere.
Its location and name are specified by using
--config-file=[
on the command line with ndb_mgmd. If the
configuration file is not specified, ndb_mgmd
will by default try to read a <path>]<filename>config.ini file
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, data nodes are configured using
[NDBD] sections. If all data nodes use the same
data memory size, and this is not the same as the default size,
create an [NDBD DEFAULT] section containing a
DataMemory line to specify the default data
memory size for all data 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 data nodes and two MySQL servers is shown below:
# file "config.ini" - 2 data nodes and 2 SQL nodes # This file is placed in the startup directory of ndb_mgmd (the management # server) # The first MySQL Server can be started from any host. The second can be started # only on the host mysqld_5.mysql.com [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 the cluster hosts.
[NDBD]: Defines the cluster's data nodes.
[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. Prior to MySQL 4.1.9, this type of connection was
available only in binaries that were built using the
--with-ndb-shm option. Beginning with MySQL
4.1.9-max, it is enabled by default, but should still be
considered experimental.
Note that each node has its own section in the
config.ini. For instance, since this cluster
has two data nodes, the configuration file contains two sections
defining these nodes.
One can define DEFAULT values for each section.
As of MySQL 4.1.5, all parameter names are case-insensitive.
© 1995-2005 MySQL AB. All rights reserved.

User Comments
Warning: query failed: Unknown column 'user.firstname' in 'field list' in /data0/sites/live/web-main/lib/mysql-cxn.php on line 69
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /data0/sites/live/web-main/lib/docbook.php on line 245
Add your own comment.