Configuring the MySQL DB cluster

Source: Internet
Author: User

1. Install the mysql-cluster package on all database servers first

Management machine: 192.168.1.6

Data node: 192.168.1.31 192.168.1.32

SQL node: 192.168.1.33 192.168.1.111

2. Configure on the Management node

[Email protected] ~]# Vim/etc/config.ini

[NDBD Default]//Data node public configuration noofreplicas=2//Data Backup number datamemory=300m//query cache indexmemory=100m//index cache [NDB_MGMD]//Manage node parameters Number nodeid=1//hostname=192.168.1.6//Management machine Ipdatadir=/mysqlcluster/log//Native cluster log directory (manually created beforehand) [NDBD]//A data node Parameter nodeid=10//hostname=192.168.1.31//This data node Ipdatadir=/mysqldata//Data storage directory (manually created on that stage) [ndbd]nodeid=20hostname=192. 168.1.32DATADIR=/MYSQLDATA[MYSQLD]//One SQL node parameter nodeid=30 hostname=192.168.1.33//sql node ip[mysqld]nodeid=40hostname= 192.168.1.111


3. Configuration on the Data node

[Email protected] ~]# VIM/ETC/MY.CNF

[Mysqld]datadir=/mysqldata ndb-connectstring=192.168.1.6//Management machine Ipndbcluster//Storage engine [MYSQL_CLUSTER]NDB -connectstring=192.168.1.6//Management machine IP


4.sql Configuration on Nodes

[Email protected] ~]# VIM/ETC/MY.CNF

[Mysqld]log-binslow-query-logndbclusterdefault-storage-engine=ndbcluster//default storage engine specified as Ndbcluster[mysql_cluster] ndb-connectstring=192.168.1.6


5. Start the corresponding service on each server after the above configuration is done

[[email protected] ~]# ndb_mgmd-f/etc/config.ini// Management machine Start the management process

[[email protected] ~]# NDBD// Data node start data process

[[email protected] ~]# ndbd // Data node start data process

[[Email protected] ~]# service MySQL start on//sql node

[[Email protected] ~]# service MySQL start on //sql node

6. Verify cluster status on the management machine

[Email protected] ~]# NDB_MGM

ndb_mgm> showcluster Configuration---------------------[ndbd (NDB)]2 node (s) [email protected] (mysql-5.6.14 ndb-7.3.3, nodegroup:0, *)//default data node [email protected] (mysql-5.6.14 ndb-7.3.3, nodegroup:0)//normal backup, when the default node failure, to accept the Memory [NDB_MGMD (MGM)]1 node (s) [email protected] (mysql-5.6.14 ndb-7.3.3) [Mysqld (API)]2 node (s) [email protected] (mysql-5 .6.14 ndb-7.3.3) [email protected] (mysql-5.6.14 ndb-7.3.3)



This article is from the "Sleepcat" blog, make sure to keep this source http://sw5720.blog.51cto.com/8812314/1437566

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.