Preparation: 1, download Mysql-cluster-gpl-7.3.8-1.el6.x86_64.rpm-bundle.tar
: Http://mirrors.sohu.com/mysql/MySQL-Cluster-7.3/MySQL-Cluster-gpl-7.3.8-1.el6.x86_64.rpm-bundle.tar
Extract:
[Email protected] files]#Tar-XVF mysql-cluster-gpl-7.3.8-1. El6.x86_64.rpm-bundle.TarMySQL-cluster-test-gpl-7.3.8-1. El6.x86_64.rpmMySQL-cluster-shared-compat-gpl-7.3.8-1. El6.x86_64.rpmMySQL-cluster-client-gpl-7.3.8-1. El6.x86_64.rpmMySQL-cluster-embedded-gpl-7.3.8-1. El6.x86_64.rpmMySQL-cluster-server-gpl-7.3.8-1. El6.x86_64.rpmMySQL-cluster-devel-gpl-7.3.8-1. El6.x86_64.rpmMySQL-cluster-shared-gpl-7.3.8-1. el6.x86_64.rpm
2, stop the original MySQL delete boot automatically run uninstall the original MySQL related (no correlation is ignored)
Shutting down MySQL. SUCCESS!
[[email protected] files]# chkconfig MySQL off
[Email protected] files]# Rpm-qa | grep MySQL
Mysql-client-5.6.24-1.el6.x86_64
Mysql-server-5.6.24-1.el6.x86_64
Mysql-devel-5.6.24-1.el6.x86_64
Rpm-e--nodeps mysql-client-5.6.24-1.el6.x86_64 mysql-server-5.6.24-1.el6.x86_64 MySQL-devel-5.6.24-1.el6.x86_64
To install the operation
[Email protected] files]# RPM-IVH mysql-cluster-client-gpl-7.3.8-1.el6.x86_64.rpm
To add user information:
' Root '@'%'123456' with GRANT OPTION;
Flush privileges;
Create working directory and file configuration:
mkdir/var/mysql-cluster
[Email protected] var]# Mkdir/var/lib/mysql/data
[Email protected] var]# Mkdir/var/run/mysqld
[Email protected] var]# chmod-r 1777/var/lib/mysql
[Email protected] var]# chmod-r 1777/var/run/mysqld
[Email protected] var]# chmod-r 1777/var/lib/mysql-cluster
[[email protected] var] Vi/etc/config.ini
[Computer]
Id=mgr-server-01
hostname=192.168.1.240
[MGM Default]
Datadir=/var/lib/mysql-cluster
[MGM]
hostname=192.168.1.240
Nodeid=60
Executeoncomputer=mgr-server-01
portnumber=1186
arbitrationrank=2
[NDBD Default]
noofreplicas=2
datamemory=500m
indexmemory=500m
[NDBD]
hostname=192.168.1.240
Datadir=/var/lib/mysql
Nodeid=1
[NDBD]
hostname=192.168.1.241
Datadir=/var/lib/mysql
nodeid=2
[[email protected] var] vi/etc/my.conf
[Client]
Socket=/var/lib/mysql/mysql.sock
[Mysqld]
max_connections=100
Datadir=/var/lib/mysql
Socket=/var/lib/mysql/mysql.sock
Ndbcluster
ndb-connectstring=192.168.1.240
[Mysqld_safe]
Log-error=/var/log/mysqld.log
#pid-file=/var/run/mysqld/mysqld.pid
Pid-file=/var/lib/mysql/mysqld.pid
[Mysql_cluster]
ndb-connectstring=192.168.1.240
Start:
Note: Turn off firewall settings (you can re-open the firewall-only ports when debugging is successful), and SELinux is set to Disabled
Order: Manage node, balance node, data node (opposite when off: Data node service MySQL stop-balanced node ndb_mgm-e shutdown)
ndb_mgmd-f/ var /lib/mysql-cluster/ config.ini //Start Management node operation
MySQL Cluster Management Server mysql-5.6. A ndb- 7.3 . 8
[[email protected] MySQL
[Email protected] mysql-cluster]# mysqld_safe--defaults-file=/etc/my.cnf--explicit_defaults_for_timestamp &// Start Data node
To view connection conditions:
[[Email protected] ~]# NDB_MGM--NDB Cluster--Management Client--NDB_MGM>showconnected to Management Server at:192.168.1.240:1186Cluster Configuration---------------------[NDBD (NDB)]2node (s)ID=1@192.168.1.240(mysql-5.6. Andb-7.3.8, Nodegroup:0)ID=2@192.168.1.241(mysql-5.6. Andb-7.3.8, Nodegroup:0, *) [NDB_MGMD (MGM)]1node (s)ID= -@192.168.1.240(mysql-5.6. Andb-7.3.8) [Mysqld (API)]2node (s)ID=Bayi@192.168.1.240(mysql-5.6. Andb-7.3.8)ID= the@192.168.1.241(mysql-5.6. Andb-7.3.8)
--------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- -------------------------------------------
Go to MySQL error handling:
Mysqld_safe--skip-grant-tables &
Mysql-uroot-p
>use MySQL;
>update Mysql.user Set Password=password (' 123456 ') where user= ' root ';
>flush privileges;
In the MySQL configuration file, add the following sentence, restart the input MySQL enter the command line to modify the password
[Email protected] files]# VI/ETC/MY.CNF
[Mysqld]
Skip-grant-tables
[[email protected] files]# MySQL
Error:
ERROR 1820 (HY000): Must SET PASSWORD before executing this statement
>set PASSWORD = PASSWORD (' 123456 ');
CentOS 6.4 64-bit build Mysql-cluster 7.3.8 Cluster