Specific installation and configuration:
1)
Preparations:
Six machines with IP addresses
192.168.0. (231-236)
MGM node: 192.168.0.231 (232)
SQL node: 192.168.0.233-234
NDBD node: 192.168.0.235-236
The system is RedHat AS 5.0
The basic components are installed, the network function is enabled, and the firewall is disabled.
Software Version:
mysql-5.1.21-beta-linux-i686-glibc23.tar.gz
2) Management node installation: (232 and 231 machines)
Shell> cd/var/tmp
Shell> tar-zxvf mysql-5.1.21-beta-linux-i686-glibc23.tar.gz
Shell> cd/var/tmp/mysql-5.1.21-beta-linux-i686-glibc23
Shell> mkdir/usr/local/mysql
Shell> cp bin/ndb_mgm */usr/local/mysql
Shell> cd/usr/local/mysql
Shell> chmod a + x ndb_mgm *
Shell> mkdir data (Used to store data of Management Nodes)
3) Installation of SQL nodes and NDBD nodes: (233-236)
Shell> groupadd mysql
Shell> useradd-g mysql
Shell> cd/var/tmp
Shell> tar-C/usr/local-xzvf mysql-5.1.21-beta-linux-i686-glibc23.tar.gz
Shell> mv/usr/local/mysql-5.1.21-beta-linux-i686-glibc23/usr/local/mysql
Shell> cd mysql
Shell> scripts/mysql_install_db -- user = mysql
Shell> chown-R mysql: mysql/usr/local/mysql
The following steps must be added to the SQL node:
Shell> cp support-files/mysql. server/etc/rc. d/init. d/mysqld
Shell> chmod a + x/etc/rc. d/init. d/mysqld
Shell> chkconfig -- add mysqld
Shell> chkconfig mysqld on(Register MYSQL as a system service)
4) configure the NDBD node:
[Root @ localhost mysql] # cat/etc/my. cnf
[Mysqld]
Ndbcluster
# Ndb-connectstring = 192.168.0.231
# Ndb-connectstring = 192.168.0.20.
In this way, the connection is successful. However, when I came here today, I found that all of them were DOWN.
Ndb-connectstring = 192.168.0.231, 192.168.0.133
[Mysql_cluster]
# Ndb-connectstring = 192.168.0.231
# Ndb-connectstring = 192.168.0.20.
Ndb-connectstring = 192.168.0.231, 192.168.0.133
[Root @ localhost mysql] #
5) configure the SQL node:
[Root @ localhost mysql] # cat/etc/my. cnf
[Mysqld]
Basedir =/usr/local/mysql/
Datadir =/usr/local/mysql/data/
Port = 3306
User = nobody
Socket =/tmp/mysql. sock
Ndbcluster
# Ndb-connectstring = 192.168.0.231
# Ndb-connectstring = 192.168.0.20.
Ndb-connectstring = 192.168.0.231, 192.168.0.133
[Ndbd]
Connect-string = 192.168.0.235
[Ndbd]
Connect-string = 192.168.0.236
[Ndbd_mgm]
Connect-string = 192.168.0.231
[Ndbd_mgm]
Connect-string = 192.168.0.20.
[Ndbd_mgmd]
Config-file =/etc/config. ini
[Mysql_cluster]
# Ndb-connectstring = 192.168.0.231
# Ndb-connectstring = 192.168.0.20.
Ndb-connectstring = 192.168.0.231, 192.168.0.133
[Root @ localhost mysql] #