您的位置:極速下載站→ 資訊首頁 → 系統(tǒng)教程 → 系統(tǒng)資訊 → Centos下MYSQL Cluster NDB7.2部署實踐教程
時間:2019-09-16 14:53:25 作者:無名 瀏覽量:52
試驗需求,OneCoder打算親身布置一下MySQLCluster環(huán)境。VMware環(huán)境中,虛擬化三臺CentOS5.4 x64虛擬機(jī)。
10.4.44.201 SQL
10.4.44.202 Data
10.4.44.203 Manager
用于布置。
官方文檔自然是最好的布置手冊,先簡略了解一下。
MySQLCluster構(gòu)成

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節(jié)點,必須布置MySQL Server binary(mysqld);辦理(Management) 節(jié)點,需求布置management server daemon(ndb_mgmd);數(shù)據(jù)(data)節(jié)點,需求布置data node daemon(ndbd 或許 ndbmtd)。無需在辦理和數(shù)據(jù)節(jié)點上布置MySQL Server binary。推薦在辦理節(jié)點上,也布置management client(ndb_mgm)。
MySQL Cluster裝備(翻譯自官方文檔)
每個data和SQL節(jié)點都需求一個my.cnf文件,其中包含了兩條重要的信息:一個鏈接串指明management節(jié)點方位,一條針對data節(jié)點,告知MySQL服務(wù)器敞開NDBCLUSTER存儲引擎。
management節(jié)點需求config.ini裝備文件,里面保存著它需求辦理的集群節(jié)點的信息、保存數(shù)據(jù)和各data節(jié)點數(shù)據(jù)索引所需的內(nèi)存信息,data節(jié)點的方位信息,
有了這些理論基礎(chǔ),下面咱們來動手操作一下
先布置data和SQL節(jié)點, 下載MysQL Cluster壓縮包 ,通過putty自帶的pscp工具,復(fù)制到各個節(jié)點linux虛擬機(jī)中。

Centos下MYSQL Cluster NDB7.2部署實踐教程圖2
解壓。
先裝備SQL和Data節(jié)點。在/etc下放置my.cnf裝備文件。內(nèi)容如下:
1.[ndbcluster]
2.ndb-connectstring=10.4.44.203
3.[mysql_cluster]
4.ndb-connectstring=10.4.44.203
再裝備Manager
相同先將壓縮包復(fù)制,然后在/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]