Project-advanced cluster environment construction (III) multi-management node MySQL Cluster-mysql tutorial

Source: Internet
Author: User
Advanced Project cluster environment construction (III) multi-management node MySQL Cluster Mysql Cluster

In the previous blog project's advanced cluster environment (2) MySQL Cluster, we built a basic MySQL Cluster. This blog will continue to explain the related content of the MySQL Cluster, at the same time, we propose a solution to the problems left over from the previous article.

1. single-management node MySQL Cluster and multi-management node MySQL Cluster

In the previous blog, only one management node exists in the MySQL Cluster architecture we set up. the created cluster can be represented in the following structure.


After careful analysis, we will find that the single management node MySQL Cluster exists. when the only management node goes down due to network, power failure, high pressure, and other reasons, data nodes and SQL nodes will fight independently and become scattered. In this way, the availability of the MySQL Cluster is low, so we need to change the single management node cluster to a multi-management node cluster as shown in.



In the multi-management node MySQL Cluster, because there are multiple management nodes, when one of the management nodes fails, other management nodes automatically take over the management permissions of the MySQL Cluster to ensure the normal operation of the MySQL Cluster.

2. Multi-management node MySQL Cluster configuration

The configuration of MySQL on multiple management nodes is very simple. you only need to modify the three nodes that have been improved in the previous blog.

1) modify the management node configuration

Open the config. ini file under the management node C:/mysql/bin and modify the configuration of ndb_mgmd to the following:

[ndb_mgmd] # Management process options:# Hostname or IP address of management nodeHostName=192.168.24.16# Directory for management node log files DataDir=C:/mysql/bin/cluster-logs[ndb_mgmd] # Management process options:# Hostname or IP address of management nodeHostName=192.168.24.43 # Directory for management node log files DataDir=C:/mysql/bin/cluster-logs

That is, the modified config. ini has the configuration of multiple ndb_mgmd management nodes.

2) modify the data node configuration

Open the my. ini file under data node C:/mysqlcluster/datanode/mysql and modify the configuration of mysql_cluster to the following:

[mysql_cluster]# Optionsfor data node process:#location of management serverndb-connectstring=192.168.24.16,192.168.24.43

The modified ndb-connectstring under the mysql_cluster node corresponds to the IP addresses of multiple management nodes. (If the management node modifies the service port number, you need to add the corresponding port number, for example, 192.168.24.16: 3306,192.168 .24.43: 3306)

3) modify the SQL node configuration

Similar to modifying a data node, you need to open the my. ini file under C:/mysqlcluster/sqlnode/mysql to modify the configuration of mysqld to the following:

[mysqld] # Options for mysqld process: # run NDB storage engine ndbcluster # location of management server ndb-connectstring=192.168.24.16,192.168.24.43

The modified ndb-connectstring under the mysqld node corresponds to the IP addresses of multiple management nodes.

3. start and test MySQL Cluster configuration on multiple management nodes

There is no difference between the start and test of a MySQL Cluster on multiple management nodes and the start and test of a MySQL Cluster on a single management node. for details, refer to the introduction in the previous article. Note that when starting a MySQL Cluster, other management nodes except the first one will receive the following warning:


The preceding warning indicates that the arbitrator of nodes 1, 3, 2, and 4 are on one host, which may cause the failure of the entire cluster. you do not need to worry about this warning.
So far, our multi-management node MySQL Cluster has been built. such a cluster can meet general requirements under normal circumstances, but it does not mean that it is truly impeccable, in terms of architecture and actual usage, it can also be further optimized and improved. Which of the following aspects can be optimized and improved? Coming soon!

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.