The MySQL version in Ubuntu8.04 is 5.0.51a. In the package mysql-server-5.0, not only the Cluster Server Manager (ndb_mgmd) is carried, but also the cluster management client (ndb_mgm ). The client ndb_mgm can be used to display the cluster status, so that you can understand the working status of the cluster. In this section, we install and configure the mysql-mgm.mytest.com (192.168.1.10 ). Install MySQL in mysql-mg
The MySQL version in Ubuntu 8.04 is 5.0.51a. In the package mysql-server-5.0, not only the Cluster Server Manager (ndb_mgmd) is carried, but also the cluster management client (ndb_mgm ). The client ndb_mgm can be used to display the cluster status, so that you can understand the working status of the cluster.
In this section, we install and configure the mysql-mgm.mytest.com (192.168.1.10 ).
Install MySQL
On the mysql-mgm.mytest.com server, install the MySQL server:
$ Sudo apt-get update install mysql-server
During installation, the installer requires you to set the MySQL root Password. Set and remember the password.
Configure ndb_mgmd.cnf
Now let's create a MySQL cluster configuration file. The file path is/etc/mysql/ndb_mgmd.cnf:
$ Sudo nano/etc/mysql/ndb_mgmd.cnf
The warning file name must be ndb_mgmd.cnf; otherwise, the service cannot be started.
Enter the following content:
[Ndbd default]
NoOfReplicas = 2
[Mysqld default]
[NDB_MGMD DEFAULT]
[Tcp default]
[NDB_MGMD] # management Node
HostName = 192.168.1.10 # IP address of the Local Machine (Management node)
[NDBD] # Storage Node 1
HostName = 192.168.1.13
DataDir =/var/lib/mysql-cluster
BackupDataDir =/var/lib/mysql-cluster/backup
[NDBD] # Storage Node 2
HostName = 192.168.1.14
DataDir =/var/lib/mysql-cluster
BackupDataDir =/var/lib/mysql-cluster/backup
# If there are several storage nodes, write a few lines [MYSQLD]
[MYSQLD]
[MYSQLD]
After saving the file, you can start the mgm service of MySQL:
$ Sudo/etc/init. d/mysql-ndb-mgm start
To stop a MySQL cluster, stop the mgm service.