Build a MySQL-Cluster architecture Mysql Cluster
Lab requirement: deploy a MySQL Cluster to reduce single point of failure (SPOF) of the database.
Tutorial solution: prepare five servers, mgmd (192.168.100.1) as the management node, sqlA (192.168.100.2) and sqlB (192.168.100.3) as the SQL node, ndbA (192.168.100.4) and ndbB (192.168.100.5) as a data node, these five nodes constitute the MySQL Cluster System
MySQL Cluster backup and recovery http://www.linuxidc.com/Linux/2013-06/85295.htm
MySQL Cluster installation configuration http://www.linuxidc.com/Linux/2013-07/87705.htm
Build a Cluster environment with three MySQL clusters: // www.linuxidc.com/Linux/2013-01/78249.htm
MySQL Cluster7.2 online addition of data nodes there are major drawbacks http://www.linuxidc.com/Linux/2012-08/67605.htm
Implementation process:
1. public configuration
1. install MySQL Cluster software on all nodes
1.1 uninstall conflicting packages on all nodes
The MySQL-Cluster software package officially provided has been integrated with database server/client programs, so it can be directly used to replace common MySQL server/client programs. If you have installed common mysql-server, mysql, MySQL-server, and MySQL-client packages, uninstall them first (if not, ignore them ):
# Service mysql stop
# Chkconfig mysql off
# Rpm-e -- nodeps MySQL-server MySQL-client MySQL-shared MySQL-embedded MySQL-test MySQL-devel
Mv/etc/my. cnf/etc/my. cnf. bak
Useradd mysql
1.3 install MySQL-Cluster software packages on all nodes
# Tar xvf MySQL-Cluster-gpl-7.3.3-1.el6.x86_64.rpm-bundle.tar
MySQL-Cluster-shared-gpl-7.3.3-1.el6.x86_64.rpm
MySQL-Cluster-shared-compat-gpl-7.3.3-1.el6.x86_64.rpm
MySQL-Cluster-server-gpl-7.3.3-1.el6.x86_64.rpm
MySQL-Cluster-client-gpl-7.3.3-1.el6.x86_64.rpm
MySQL-Cluster-test-gpl-7.3.3-1.el6.x86_64.rpm
MySQL-Cluster-devel-gpl-7.3.3-1.el6.x86_64.rpm
MySQL-Cluster-embedded-gpl-7.3.3-1.el6.x86_64.rpm
Rpm-Uvh MySQL-Cluster-*. rpm
2. on the SQL node (sqlA, sqlB) server, modify the root password of the MySQL database.
3. add authorized database users to SQL nodes to facilitate client access
Mysql> grant all on *. * to 'root' @ '192. 192.% 'identifiedby '123 ';
II. configuration management node mgmd (192.168.100.1)
1. create a working folder
# Mkdir-p/var/log/mysql-cluster
[Ndbd default]: specifies the default configuration for all data nodes.
[Ndbd]: specifies the configuration of a data node.
[Ndb_mgmd default]: specifies the default configuration for all management nodes.
[Ndb_mgmd]: specifies the configuration of a management node.
[Mysqld default]: specifies the default configuration for all SQL nodes.
[Mysqld]: specifies the configuration of an SQL node.
# Vim/etc/config. ini
[Ndbd default]
NoOfReplicas = 2 // retain two copies of data
DataMemory = 80 M // data cache size
IndexMemory = 18 M // index cache size
[Ndb_mgmd]
Nodeid = 1 // ID of the 1st management nodes
Hostname = 192.168.100.1 // address of the management node
Datadir =/var/log/mysql-cluster // working directory of this management node
[Mysqld]
Nodeid = 2 // ID of the 1st SQL nodes
Hostname = 192.168.100.2 // address of the 1st SQL nodes
[Mysqld]
Nodeid = 3 // ID of the 2nd SQL nodes
Hostname = 192.168.100.3 // address of the 2nd SQL nodes
[Ndbd]
Nodeid = 4 // ID of the 1st data nodes
Hostname = 192.168.100.4 // address of the 1st data nodes
Datadir =/mysql-cluster/data // working directory of 1st data nodes, which must be created
[Ndbd]
Nodeid = 5 // ID of the 2nd data nodes
Hostname = 192.168.100.5 // address of the 2nd data nodes
Datadir =/mysql-cluster/data // working directory of 2nd data nodes, which must be created
For more details, refer to the highlights on the next page.: Http://www.linuxidc.com/Linux/2014-05/102218p2.htm