共計 1984 個字符,預計需要花費 5 分鐘才能閱讀完成。
這期內容當中丸趣 TV 小編將會給大家帶來有關如何配置 MySQL 服務器集群,文章內容豐富且以專業的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
1. 先了解一下你是否應該用 MySQL 集群。
減少數據中心結點壓力和大數據量處理,采用把 MySQL 分布,一個或多個 application 對應一個 MySQL。把幾個 MySQL 數據庫公用的數據做出共享數據,例如購物車,用戶對象等等,存在數據結點里面。其他不共享的數據還維持在各自分布的 MySQL 數據庫本身中。
2. 集群 MySQL 中名稱概念.(如上圖)
1)Sql 結點 (SQL node– 上圖對應為 MySQLd): 分布式數據庫。包括自身數據和查詢中心結點數據.
2) 數據結點 (Data node — ndbd): 集群共享數據 (內存中).
3) 管理服務器 (Management Server ndash; ndb_mgmd): 集群管理 SQL node,Data node.
3. 配置
MySQL-max 版本,當然現在 MySQL 集群系統 windonws 平臺上面不被支持.
安裝 MySQL 就不多說了,網上一大堆,簡明扼要。
A:192.168.1.251 ndash; Data node 和 Management Server.
B:192.168.1.254 ndash; SQL node.
當然,你也可以讓一個機器同時為 3 者。
A,B my.inf 加上:
MySQLD]
ndbcluster # run NDB engine
ndb-connectstring=192.168.1.251 # location of MGM node
# Options for ndbd process: [MySQL_CLUSTER]
ndb-connectstring=192.168.1.251 # location of MGM node
A: /var/lib/MySQL-cluster/config.ini [NDBD DEFAULT]
NoOfReplicas=1
# 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 Cluster setup. # TCP/IP options: [TCP DEFAULT]
portnumber=2202 # This the default; however, you can use any
# port that is free for all the hosts in cluster
# Note: It is recommended beginning with MySQL 5.0 that
# you do not specify the portnumber at all and simply allow
# the default value to be used instead # Management process options: [NDB_MGMD] hostname=192.168.1.251
# Hostname or IP address of MGM node datadir=/var/lib/MySQL-cluster # Directory for MGM node logfiles # Options for data node A : [NDBD]
# (one [NDBD] section per data node) hostname=192.168.1.251
# Hostname or IP address datadir=/usr/local/MySQL/data
# Directory for this data nodes datafiles
# SQL node options: [MySQLD] hostname=192.168.1.254
#[MySQ
上述就是丸趣 TV 小編為大家分享的如何配置 MySQL 服務器集群了,如果剛好有類似的疑惑,不妨參照上述分析進行理解。如果想知道更多相關知識,歡迎關注丸趣 TV 行業資訊頻道。