Mysql Cluster Mysql-cluster Installation

Source: Internet
Author: User
Tags install perl


Environment description

system Environment: CentOS 6.5 mini (64bit)
Software version: mysql-cluster-advanced-7.3.7-linux-glibc2.5-x86_64.tar.gz

IP Address:
mgm:192.168.100.211

ndbd1:192.168.100.212

ndbd2:192.168.100.213


sql1:192.168.100.214
sql2:192.168.100.215


First, cluster installation (Five Nodes)
Install dependent packages
# yum-y Install perl Libaio ntpdate

Shutting down the firewall
# service Iptables stop

Delete System comes with MySQL:
# Rpm-qa | grep mysql
# rpm-e--allmatches--nodeps mysql-libs-5.1.71-1.el6.x86_64

Decompression software
Uploading software to the/main directory
# Cd/main
# tar ZXVF mysql-cluster-advanced-7.3.7-linux-glibc2.5-x86_64.tar.gz
# mv mysql-cluster-advanced-7.3.7-linux-glibc2.5-x86_64 MySQL

New MySQL user and user group
# Groupadd MySQL
# useradd-g mysql-s/usr/sbin/nologin MySQL
# chown-r Mysql:mysql/main/mysql

Installing cluster
#/main/mysql/scripts/mysql_install_db--user=mysql--basedir=/main/mysql--datadir=/main/mysql/data


Second, node configuration
1. Configure MGM (MGM Node)
Delete your own my.cnf file
You must delete your own/etc/my.cnf if you do not have to delete it.
# rm-rf/etc/my.cnf

Create a new configuration file to store the directory
# MKDIR/MAIN/MYSQL/ETC
# chown Mysql:mysql/main/mysql/etc

Creating a configuration file Config.ini
# Vi/main/mysql/etc/config.ini
[NDB_MGMD Default]
DataDir =/main/mysql/data

[NDBD Default]
Noofreplicas = 2
Datamemory = 80M
Indexmemory = 18M
DataDir =/main/mysql/data

[NDB_MGMD]
NodeId = 1
HostName = 192.168.100.211

[NDBD]
NodeId = 11
HostName = 192.168.100.212
[NDBD]
NodeId = 12
HostName = 192.168.100.213

[Mysqld]
NodeId = 81
HostName = 192.168.100.214
[Mysqld]
NodeId = 82
HostName = 192.168.100.215


2. Configure the Data node (NDBD1 and NDBD2 nodes)
Creating a configuration file my.cnf
# VI/ETC/MY.CNF
[Mysqld]
Ndbcluster
ndb-connectstring = 192.168.100.211
[Mysql_cluster]
ndb-connectstring = 192.168.100.211



3. Configuring SQL Nodes (SQL1 and SQL2 nodes )
Copy files
# cp-p/main/mysql/support-files/mysql.server/etc/init.d/mysqld

Creating a configuration file my.cnf
# VI/ETC/MY.CNF
[Mysqld]
Basedir =/main/mysql
DataDir =/main/mysql/data
Ndbcluster
ndb-connectstring = 192.168.100.211
[Mysql_cluster]
ndb-connectstring = 192.168.100.211


Third, start the node
The boot needs to be done in the following order:MGM > ndbd > SQL

If the boot method below is only suitable for the first boot , or if the backup, recovery or configuration changes after the reboot, otherwise all data will be emptied
1: Start MGM (MGM node)
# mkdir-p/usr/local/mysql/mysql-cluster
# ndb_mgmd-f/main/mysql/etc/config.ini--initial

View cluster status
# NDB_MGM-E Show
Connected to Management Server at:localhost:1186cluster Configuration---------------------[NDBD (NDB)]     2 node (s) Id=11 (not connected, accepting connect from 192.168.100.212) id=12 (not connected, accepting connect from 192.168.100.213) [NDB_MGMD (MGM)] 1 node (s) id=1    @192.168.100.211  (mysql-5.6.21 ndb-7.3.7) [Mysqld (API)]   2 node (s) id=81 ( Not connected, accepting connect from 192.168.100.214) id=82 (not connected, accepting connect from 192.168.100.215)

2: Start ndbd (NDBD1 and NDBD2 nodes)
# ndbd--initial

3: Start SQL (SQL1 and SQL2 nodes)

# service Mysqld Start


By this mysql-cluster installation, the client can connect to the MySQL database via the SQL node. Here are just a few simple installation configuration procedures, detailed configuration instructions please look forward to.


Mysql Cluster Mysql-cluster Installation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.