mysql5.7 NDB集群

Posted 努力哥-运维自动化

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql5.7 NDB集群相关的知识,希望对你有一定的参考价值。

一、

 

 

1、NDB集群的初始配置

vi /etc/my.cnf

#FIQ
https://dev.mysql.com/doc/refman/5.7/en/mysql-cluster-install-linux-binary.html

[mysqld]
# Options for mysqld process:
ndbcluster # run NDB storage engine

[mysql_cluster]
# Options for NDB Cluster processes:
ndb-connectstring=198.51.100.10 # location of management server

shell> mkdir /var/lib/mysql-cluster
shell> cd /var/lib/mysql-cluster
shell> vi config.ini
[ndbd default]
# Options affecting ndbd processes on all data nodes:
NoOfReplicas=2 # Number of replicas
DataMemory=80M # How much memory to allocate for data storage
IndexMemory=18M # How much memory to allocate for index storage
# For DataMemory and IndexMemory, we have used the
# default values. Since the "world" database takes up
# only about 500KB, this should be more than enough for
# this example NDB Cluster setup.
ServerPort=2202 # This the default value; however, you can use any
# port that is free for all the hosts in the cluster
# Note1: It is recommended that you do not specify the port
# number at all and simply allow the default value to be used
# instead
# Note2: The port was formerly specified using the PortNumber
# TCP parameter; this parameter is no longer available in NDB
# Cluster 7.5.

[ndb_mgmd]
# Management process options:
HostName=198.51.100.10 # Hostname or IP address of MGM node
DataDir=/var/lib/mysql-cluster # Directory for MGM node log files

[ndbd]
# Options for data node "A":
# (one [ndbd] section per data node)
HostName=198.51.100.30 # Hostname or IP address
NodeId=2 # Node ID for this data node
DataDir=/usr/local/mysql/data # Directory for this data node‘s data files

[ndbd]
# Options for data node "B":
HostName=198.51.100.40 # Hostname or IP address
NodeId=3 # Node ID for this data node
DataDir=/usr/local/mysql/data # Directory for this data node‘s data files

[mysqld]
# SQL node options:
HostName=198.51.100.20 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)

 

 

以上是关于mysql5.7 NDB集群的主要内容,如果未能解决你的问题,请参考以下文章

nacos1.4.2集群部署mysql5.7

mysql5.7 MGR集群搭建

MySQL5.7集群管理视频教程(主从复制MHAGTIDPXC)高清完整资源

CentOS 7下升级MySQL5.7.23的一个坑

MySQL5.7之PXC集群搭建

MySQL5.7 MGR 集群搭建