您的位置:極速下載站→ 資訊首頁(yè) → 系統(tǒng)教程 → 系統(tǒng)資訊 → Centos下MYSQL Cluster NDB7.2部署實(shí)踐教程
時(shí)間:2019-09-16 14:53:25 作者:無(wú)名 瀏覽量:52
試驗(yàn)需求,OneCoder打算親身布置一下MySQLCluster環(huán)境。VMware環(huán)境中,虛擬化三臺(tái)CentOS5.4 x64虛擬機(jī)。
10.4.44.201 SQL
10.4.44.202 Data
10.4.44.203 Manager
用于布置。
官方文檔自然是最好的布置手冊(cè),先簡(jiǎn)略了解一下。
MySQLCluster構(gòu)成
Centos下MYSQL Cluster NDB7.2部署實(shí)踐教程圖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é)點(diǎn),必須布置MySQL Server binary(mysqld);辦理(Management) 節(jié)點(diǎn),需求布置management server daemon(ndb_mgmd);數(shù)據(jù)(data)節(jié)點(diǎn),需求布置data node daemon(ndbd 或許 ndbmtd)。無(wú)需在辦理和數(shù)據(jù)節(jié)點(diǎn)上布置MySQL Server binary。推薦在辦理節(jié)點(diǎn)上,也布置management client(ndb_mgm)。
MySQL Cluster裝備(翻譯自官方文檔)
每個(gè)data和SQL節(jié)點(diǎn)都需求一個(gè)my.cnf文件,其中包含了兩條重要的信息:一個(gè)鏈接串指明management節(jié)點(diǎn)方位,一條針對(duì)data節(jié)點(diǎn),告知MySQL服務(wù)器敞開(kāi)NDBCLUSTER存儲(chǔ)引擎。
management節(jié)點(diǎn)需求config.ini裝備文件,里面保存著它需求辦理的集群節(jié)點(diǎn)的信息、保存數(shù)據(jù)和各data節(jié)點(diǎn)數(shù)據(jù)索引所需的內(nèi)存信息,data節(jié)點(diǎn)的方位信息,
有了這些理論基礎(chǔ),下面咱們來(lái)動(dòng)手操作一下
先布置data和SQL節(jié)點(diǎn), 下載MysQL Cluster壓縮包 ,通過(guò)putty自帶的pscp工具,復(fù)制到各個(gè)節(jié)點(diǎn)linux虛擬機(jī)中。
Centos下MYSQL Cluster NDB7.2部署實(shí)踐教程圖2
解壓。
先裝備SQL和Data節(jié)點(diǎn)。在/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]