MySQL伺服器叢集介紹與配置詳解

來源:互聯網
上載者:User

  1. 先瞭解一下你是否應該用MySQL叢集。

  減少資料中心結點壓力和大資料量處理,採用把MySQL分布,一個或多個application對應一個MySQL資料庫。把幾個MySQL資料庫公用的資料做出共用資料,例如購物車,使用者物件等等,存在資料結點裡面。其他不共用的資料還維持在各自分布的MySQL資料庫本身中。

  

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

  1)Sql結點(SQL node--上圖對應為MySQLd):分散式資料庫。包括自身資料和查詢中心結點資料.

  2)資料結點(Data node -- ndbd):叢集共用資料(記憶體中).

  3)管理伺服器(Management Server – ndb_mgmd):叢集管理SQL node,Data node.

  3.配置

  MySQL-max版本,當然現在MySQL叢集系統windonws平台上面不被支援.

  安裝MySQL就不多說了,網上一大堆,簡明扼要。

  A:192.168.1.251 – Data node和Management Server.

  B:192.168.1.254 – SQL node.

  當然,你也可以讓一個機器同時為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 node"s datafiles   
  24. # SQL node options:  [MySQLD]  hostname=192.168.1.254    
  25. #[MySQLD] #這個相當於192.168.1.251  




聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.