Project advanced cluster environment construction (3) Multi-management node MySQL cluster previous blog project advanced cluster environment construction (2) MySQL cluster, we set up a basic MySQL cluster, this blog will continue to explain the related content of the MySQL cluster and provide a solution to the problems left over from the previous article. 1. Single-management node MySQL Cluster
Project advanced cluster environment construction (3) Multi-management node MySQL cluster previous blog project advanced cluster environment construction (2) MySQL cluster, we set up a basic MySQL cluster, this blog will continue to explain the related content of the MySQL cluster and provide a solution to the problems left over from the previous article. 1. Single-management node MySQL Cluster
Advanced project cluster environment construction (3) Multi-management node 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 Multi-management node MySQL is very simple. You only need to modify three of 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 node HostName=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 node HostName=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 to open the my. ini file under the 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 server ndb-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) Changing the SQL node configuration is similar to modifying the data node. to modify the SQL node configuration, You need to enable my under C: \ mysqlcluster \ sqlnode \ mysql. in the INI file, 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. Configure and start a MySQL cluster on multiple management nodes. test and start a MySQL cluster on multiple management nodes is no different from that on a single management node, 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!