時間:2019-09-16 14:53:25 作者:無名 瀏覽量:52
試驗需求,OneCoder打算親身布置一下MySQLCluster環境。VMware環境中,虛擬化三臺CentOS5.4 x64虛擬機。
10.4.44.201 SQL
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]