如何配置MySQL服務(wù)器集群

這期內(nèi)容當(dāng)中小編將會(huì)給大家?guī)碛嘘P(guān)如何配置MySQL服務(wù)器集群,文章內(nèi)容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。

我們提供的服務(wù)有:網(wǎng)站制作、成都網(wǎng)站制作、微信公眾號(hào)開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、礦區(qū)ssl等。為成百上千家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的礦區(qū)網(wǎng)站制作公司

1. 先了解一下你是否應(yīng)該用MySQL集群。

減少數(shù)據(jù)中心結(jié)點(diǎn)壓力和大數(shù)據(jù)量處理,采用把MySQL分布,一個(gè)或多個(gè)application對(duì)應(yīng)一個(gè)MySQL。把幾個(gè)MySQL數(shù)據(jù)庫公用的數(shù)據(jù)做出共享數(shù)據(jù),例如購物車,用戶對(duì)象等等,存在數(shù)據(jù)結(jié)點(diǎn)里面。其他不共享的數(shù)據(jù)還維持在各自分布的MySQL數(shù)據(jù)庫本身中。

2. 集群MySQL中名稱概念.(如上圖)

1)Sql結(jié)點(diǎn)(SQL node--上圖對(duì)應(yīng)為MySQLd):分布式數(shù)據(jù)庫。包括自身數(shù)據(jù)和查詢中心結(jié)點(diǎn)數(shù)據(jù).

2)數(shù)據(jù)結(jié)點(diǎn)(Data node -- ndbd):集群共享數(shù)據(jù)(內(nèi)存中).

3)管理服務(wù)器(Management Server – ndb_mgmd):集群管理SQL node,Data node.

3.配置

MySQL-max版本,當(dāng)然現(xiàn)在MySQL集群系統(tǒng)windonws平臺(tái)上面不被支持.

安裝MySQL就不多說了,網(wǎng)上一大堆,簡明扼要。

A:192.168.1.251 – Data node和Management Server.

B:192.168.1.254 – SQL node.

當(dāng)然,你也可以讓一個(gè)機(jī)器同時(shí)為3者。

A,B my.inf加上:

  1. MySQLD]                           

  2. ndbcluster                     # run NDB engine    

  3. ndb-connectstring=192.168.1.251 # location of MGM node       

  4. # Options for ndbd process:  [MySQL_CLUSTER]                    

  5. ndb-connectstring=192.168.1.251 # location of MGM node       

  6. A: /var/lib/MySQL-cluster/config.ini  [NDBD DEFAULT]       

  7. NoOfReplicas=1     

  8. # Number of replicas  DataMemory=80M     

  9. # How much memory to allocate for data storage  IndexMemory=18M    

  10. # How much memory to allocate for index storage                     

  11. # For DataMemory and IndexMemory, we have used the                    

  12. # default values. Since the "world" database takes up                     

  13. # only about 500KB, this should be more than enough for                     

  14. # this example Cluster setup.  # TCP/IP options:  [TCP DEFAULT]        

  15. portnumber=2202  # This the default; however, you can use any                     

  16. # port that is free for all the hosts in cluster                     

  17. # Note: It is recommended beginning with MySQL 5.0 that                    

  18. # you do not specify the portnumber at all and simply allow                     

  19. # the default value to be used instead  # Management process options:  [NDB_MGMD]                       hostname=192.168.1.251            

  20. # Hostname or IP address of MGM node  datadir=/var/lib/MySQL-cluster # Directory for MGM node logfiles  # Options for data node "A":  [NDBD]                             

  21. # (one [NDBD] section per data node)  hostname=192.168.1.251           

  22.  # Hostname or IP address  datadir=/usr/local/MySQL/data    

  23. # Directory for this data nodes datafiles   

  24. # SQL node options:  [MySQLD]  hostname=192.168.1.254    

  25. #[MySQ

上述就是小編為大家分享的如何配置MySQL服務(wù)器集群了,如果剛好有類似的疑惑,不妨參照上述分析進(jìn)行理解。如果想知道更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。

標(biāo)題名稱:如何配置MySQL服務(wù)器集群
網(wǎng)址分享:http://muchs.cn/article38/pihesp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供關(guān)鍵詞優(yōu)化、定制網(wǎng)站、網(wǎng)站內(nèi)鏈、微信公眾號(hào)軟件開發(fā)、企業(yè)建站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站建設(shè)網(wǎng)站維護(hù)公司