偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

MySQL集群簡介與配置詳解

數(shù)據(jù)庫 MySQL
MySQL集群主要用于解決MySQL性能不足的問題,在這里我們將要介紹集群的基本概念,以及一些配置知識。

1. 先了解一下你是否應該用MySQL集群。

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

MySQL Cluster Components

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

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

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

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

3.配置

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

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

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.    
  5. # Options for ndbd process:  
  6. [MySQL_CLUSTER]                  
  7. ndb-connectstring=192.168.1.251 # location of MGM node  
  8.    
  9. A: /var/lib/MySQL-cluster/config.ini  
  10. [NDBD DEFAULT]     
  11. NoOfReplicas=1   # Number of replicas  
  12. DataMemory=80M   # How much memory to allocate for data storage  
  13. IndexMemory=18M  # How much memory to allocate for index storage  
  14.                  # For DataMemory and IndexMemory, we have used the  
  15.                  # default values. Since the "world" database takes up  
  16.                  # only about 500KB, this should be more than enough for  
  17.                  # this example Cluster setup.  
  18. # TCP/IP options:  
  19. [TCP DEFAULT]      
  20. portnumber=2202  # This the default; however, you can use any  
  21.                  # port that is free for all the hosts in cluster  
  22.                  # Note: It is recommended beginning with MySQL 5.0 that  
  23.                  # you do not specify the portnumber at all and simply allow  
  24.                  # the default value to be used instead  
  25. # Management process options:  
  26. [NDB_MGMD]                       
  27. hostname=192.168.1.251          # Hostname or IP address of MGM node  
  28. datadir=/var/lib/MySQL-cluster # Directory for MGM node logfiles  
  29. # Options for data node "A":  
  30. [NDBD]                           
  31. # (one [NDBD] section per data node)  
  32. hostname=192.168.1.251          # Hostname or IP address  
  33. datadir=/usr/local/MySQL/data  # Directory for this data node's datafiles  
  34. # SQL node options:  
  35. [MySQLD]  
  36. hostname=192.168.1.254  
  37. #[MySQLD] #這個相當于192.168.1.251  
  38.   

4. 啟動測試

在管理服務器上面(這里是192.168.1.251):

  1. shell>ndb_mgmd -f /var/lib/MySQL-cluster/config.ini 

在數(shù)據(jù)結(jié)點服務器上面(依然是192.168.1.251and more):

  1. shell>ndbd--initial (***次時加--initial參數(shù)) 

SQL結(jié)點服務器上面(192.168.1.254):

  1. shell>MySQLd & 

在251上面察看

  1. ./ndb_mgm  
  2.  
  3. -- NDB Cluster -- Management Client --  
  4. ndb_mgm> show  
  5. Connected to Management Server at: 192.168.1.251:1186  
  6. Cluster Configuration  
  7. ---------------------  
  8. [ndbd(NDB)]    1 node(s)  
  9. id=2   @192.168.1.251 (Version:5.0.22, Nodegroup: 0, Master)  
  10.    
  11. [ndb_mgmd(MGM)] 1 node(s)  
  12. id=1   @192.168.1.251 (Version:5.0.22)  
  13.    
  14. [MySQLd(API)]  1 node(s)  
  15. id=3   @192.168.1.254 (Version:5.0.22) 

ok

關閉集群:

  1. shell>ndb_mgm -e shutdown 

5.基本的集群說明

1)在MySQL集群中.當table引擎為NDBCLUSTER時才做集群,其他非NDBCLUSTER表和一般MySQL數(shù)據(jù)庫表一樣,不會共享數(shù)據(jù). NDBCLUSTER表數(shù)據(jù)存儲在Data node服務器內(nèi)存中,Data Node可以為1臺或多臺服務器,它們之間存放共享數(shù)據(jù)。Data Node服務器可以分組數(shù)據(jù)copy。

例如:2,3,4,5為四臺Data Node服務器ID. 2,3為組0。 4,5為組1。 2,3維持數(shù)據(jù)相同,4,5維持數(shù)據(jù)相同。 組0和組1維持數(shù)據(jù)不同。

2)sql node服務器中,非NDBCLUSTER數(shù)據(jù)存在本身數(shù)據(jù)庫中,table引擎為NDBCLUSTER時,數(shù)據(jù)存儲在Data Node中。當查詢NDBCLUSTER表時,它會從Data node集群中提起數(shù)據(jù).

3)Manager server

管理SQl node和Data node狀態(tài)。

6深入了解http://dev.MySQL.com/doc/refman/5.0/en/ndbcluster.html

原文鏈接:http://blog.19lou.com/10131711/viewspace-338346 

【編輯推薦】

  1. MySQL數(shù)據(jù)庫集群進行正確配置步驟
  2. MySQL 集群在Server1與Server2上如何安裝MySQL
  3. MySQL集群配置
  4. MySQL集群自動安裝腳本
  5. MySQL觸發(fā)器如何正確使用

責任編輯:彭凡 來源: 19樓
相關推薦

2015-05-06 13:34:14

MySQL集群搭建

2024-05-27 00:04:00

2011-03-02 11:25:10

vsftpd配置

2010-11-11 09:06:38

Linux集群LVS

2010-05-28 17:39:47

TortoiseSVN

2010-06-02 10:23:46

Linux mysql

2011-02-25 11:16:38

ApacheTomcat

2009-06-12 14:27:49

JBoss集群配置

2011-03-02 13:28:33

Vsftpd配置

2012-05-30 10:09:57

ApacheTomcat

2010-08-17 15:08:48

MySQL集群

2019-09-16 16:05:13

Redis集群模式

2010-01-13 13:27:07

CentOS vsft

2011-08-05 15:28:47

MySQL數(shù)據(jù)庫集群負載均衡

2019-07-04 13:10:53

Docker設計云計算

2010-06-21 14:57:32

Linux apt

2010-06-03 15:04:31

NAP IPSEC配置

2012-11-28 10:37:25

Linux集群安裝配置

2010-08-12 15:30:10

MySQL集群

2010-10-19 16:32:46

MySQL
點贊
收藏

51CTO技術棧公眾號