10.4.44.202 Data
10.4.44.203 Manager
用于布置。
官方文档自然是最好的布置手册,先简略了解一下。
MySQLCluster构成
Centos下MYSQL Cluster NDB7.2部署实践教程图1
Each MySQL Cluster host computer must have the correct executable programs installed. A host running an SQL node must have installed on it a MySQL Server binary (mysqld). Management nodes require the management server daemon (ndb_mgmd); data nodes require the data node daemon (ndbd or ndbmtd). It is not necessary to install the MySQL Server binary on management node hosts and data node hosts. It is recommended that you also install the management client (ndb_mgm) on the management server host.
SQL节点,必须布置MySQL Server binary(mysqld);办理(Management) 节点,需求布置management server daemon(ndb_mgmd);数据(data)节点,需求布置data node daemon(ndbd 或许 ndbmtd)。无需在办理和数据节点上布置MySQL Server binary。推荐在办理节点上,也布置management client(ndb_mgm)。
MySQL Cluster装备(翻译自官方文档)
每个data和SQL节点都需求一个my.cnf文件,其中包含了两条重要的信息:一个链接串指明management节点方位,一条针对data节点,告知MySQL服务器敞开NDBCLUSTER存储引擎。
management节点需求config.ini装备文件,里面保存着它需求办理的集群节点的信息、保存数据和各data节点数据索引所需的内存信息,data节点的方位信息,
有了这些理论基础,下面咱们来动手操作一下
先布置data和SQL节点, 下载MysQL Cluster压缩包 ,通过putty自带的pscp工具,复制到各个节点linux虚拟机中。
Centos下MYSQL Cluster NDB7.2部署实践教程图2
解压。
先装备SQL和Data节点。在/etc下放置my.cnf装备文件。内容如下:
1.[ndbcluster]
2.ndb-connectstring=10.4.44.203
3.[mysql_cluster]
4.ndb-connectstring=10.4.44.203
再装备Manager
相同先将压缩包复制,然后在/var/lib/mysql-cluster/config.ini 装备:[ndbd default]
01.# Options affecting ndbd processes on all data nodes:
02.NoOfReplicas=1 # Number of replicas
03.DataMemory=80M # How much memory to allocate for data storage
04.IndexMemory=18M # How much memory to allocate for index storage
05.# For DataMemory and IndexMemory,we have used the
06.# default values. Since the "world" database takes up
07.# only about 500KB,this should be more than enough for
08.# this example Cluster setup.
09.
10.[ndb_mgmd]
11.# Management process options:
12.hostname=10.4.44.203 # Hostname or IP address of MGM node
13.datadir=/var/lib/mysql-cluster # Directory for MGM node log files
14.
15.[ndbd]