亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫
12下一頁
最近訪問板塊 發(fā)新帖
查看: 8787 | 回復(fù): 10
打印 上一主題 下一主題

MYSQL集群中NDB如何同步數(shù)據(jù)? [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2009-09-19 20:40 |只看該作者 |倒序?yàn)g覽
在某運(yùn)營商的HLR設(shè)備上,是有MYSQL集群來做的,總共6塊板卡,每個(gè)上相當(dāng)于一個(gè)小電腦,

A,B兩個(gè)做MGMD管理節(jié)點(diǎn),也做SQLD節(jié)點(diǎn)

其余C,D,E,F四塊板卡做NDB節(jié)點(diǎn)

請(qǐng)問下這四個(gè)NDB節(jié)點(diǎn)如何進(jìn)行數(shù)據(jù)的同步呢?

我在網(wǎng)上搜索MYSQL集群,沒看到關(guān)于NDB之間的同步的說明啊,

請(qǐng)問誰呢說明下呢?

SQLD過來數(shù)據(jù),NDB不是如何向四個(gè)節(jié)點(diǎn)發(fā)數(shù)據(jù)呢?他們?nèi)绾芜M(jìn)行數(shù)據(jù)的同步呢?
如果一次數(shù)據(jù)在節(jié)點(diǎn)C上,一次在節(jié)點(diǎn)D上,那數(shù)據(jù)不就是不一樣了嗎?

謝謝,請(qǐng)幫忙看看。

另外,四塊NDB節(jié)點(diǎn)之間怎么做均衡呢?他們是平均的嗎?

如果想改一下呢?比如C,D做一組,C主D備,然后E,F一組,E主F備,一次數(shù)據(jù)過來,隨即發(fā)送到C,E上嗎?然后再同步?

謝謝了啊。

我不是做集群的,我就是好奇而已,對(duì)LINUX下的服務(wù)好奇,謝謝了啊。

論壇徽章:
0
2 [報(bào)告]
發(fā)表于 2009-09-20 13:25 |只看該作者
咋沒有人幫幫忙呢?

哪位帥哥靚妹高手們指點(diǎn)指點(diǎn)?

論壇徽章:
0
3 [報(bào)告]
發(fā)表于 2009-09-20 13:32 |只看該作者
這是config.ini文件

# file "config.ini" - showing minimal setup with 1 DB node
# This file is placed in the start directory of ndb_mgmd,
# the management server.

[TCP DEFAULT]
SendBufferMemory=2M
PortNumber = 28020

[API DEFAULT]

[NDB_MGMD DEFAULT]
PortNumber = 1186
DataDir=/var/local/nectar/log

# ndb_mgmd is the cluster manager
# it can run on pilot stations
[NDB_MGMD]
id=1
hostname=STATION_A
ArbitrationRank: 1
LogDestination=FILE:filename=ndb_1_cluster.log,maxsize=10000000,maxfiles=5

[NDB_MGMD]
id=2
hostname=STATION_B
ArbitrationRank: 1
LogDestination=FILE:filename=ndb_2_cluster.log,maxsize=10000000,maxfiles=5


[NDBD DEFAULT]
DataDir=/user/database/log
#DataDir=/var/local/nectar/log/
NoOfReplicas: 2
DataMemory = 1900M
IndexMemory: 250M
#MaxNoOfSavedMessages: 5
LockPagesInMainMemory: 2
#StartPartialTimeout: 10000
StartPartitionedTimeout: 60000
StartFailureTimeout: 0
HeartbeatIntervalDbDb:  600
#HeartbeatIntervalDbApi: 3000
MaxNoOfOrderedIndexes: 200
MaxNoOfTables: 250
MaxNoOfUniqueHashIndexes: 200
MaxNoOfAttributes:  5000
MaxNoOfOpenFiles: 107
InitialNoOfOpenFiles: 106
TimebetweenLocalCheckpoints: 20
TimebetweenGlobalCheckpoints: 1000
#TransactionDeadlockDetectionTimeout: 1000000000
#TransactionDeadlockDetectionTimeout: 50
TransactionDeadlockDetectionTimeout: 1000
TransactionInactiveTimeout: 300000
TimeBetweenInactiveTransactionAbortCheck: 1000
NoOfFragmentLogFiles: 128
MaxNoOfConcurrentTransactions: 7000
RedoBuffer: 48M
LogLevelStartup: 15
LogLevelShutdown: 15
LogLevelConnection: 15
LogLevelInfo: 15
LogLevelError: 15
LogLevelNodeRestart: 15
LogLevelCheckpoint: 1
StopOnError: Y

# There are 4 data nodes
DataMemory2 = 300M
[NDBD]
id=3
hostname=STATION_C
FileSystemPath: /user/database/ndbd

[NDBD]
id=4
hostname=STATION_D
FileSystemPath: /user/database/ndbd

[NDBD]
id=5
hostname=STATION_E
FileSystemPath: /user/database/ndbd

[NDBD]
id=6
hostname=STATION_F
FileSystemPath: /user/database/ndbd

# mysqld is the mysql server daemon, it can run on both pilot stations
[MYSQLD]
id=7
hostname=STATION_A

[MYSQLD]
id=8
hostname=STATION_B

論壇徽章:
0
4 [報(bào)告]
發(fā)表于 2009-09-21 00:17 |只看該作者
首先,4個(gè)ndb節(jié)點(diǎn)的數(shù)據(jù)是有冗余的
你的配置文件里NoOfReplicas=2,所以每一行記錄會(huì)在ndb節(jié)點(diǎn)上存2份
ndb有nodegroup的概念,在你的配置情況下,4個(gè)ndb節(jié)點(diǎn)會(huì)分為2個(gè)nodegroup,每個(gè)nodegrup中的每個(gè)節(jié)點(diǎn)的數(shù)據(jù)都是一樣的,所以只要不是整個(gè)nodegroup中的所有節(jié)點(diǎn)都掛掉,就不會(huì)出現(xiàn)數(shù)據(jù)丟失。
NoOfNodes = NoOfNodegroups * NoOfReplicas
在你的配置中,ndb節(jié)點(diǎn)的id分別為3、4、5、6,一般情況下,ndb會(huì)自動(dòng)將3、4作為一個(gè)nodegroup,5、6作為另一個(gè)nodegroup
至于ndb節(jié)點(diǎn)內(nèi)部的數(shù)據(jù)是如何同步的,都是MySQL Cluster內(nèi)部的事情,手工沒法干預(yù)的

另,很想知道您這個(gè)MySQL Cluster是做什么類型的應(yīng)用

評(píng)分

參與人數(shù) 1可用積分 +5 收起 理由
楓影誰用了 + 5 精品文章

查看全部評(píng)分

論壇徽章:
0
5 [報(bào)告]
發(fā)表于 2009-09-21 11:00 |只看該作者
可以參考一下mysql cluster的官文,上面說的很清楚。

論壇徽章:
1
白銀圣斗士
日期:2015-11-23 08:33:04
6 [報(bào)告]
發(fā)表于 2009-09-21 17:54 |只看該作者
原帖由 shujun579 于 2009-9-21 00:17 發(fā)表
首先,4個(gè)ndb節(jié)點(diǎn)的數(shù)據(jù)是有冗余的
你的配置文件里NoOfReplicas=2,所以每一行記錄會(huì)在ndb節(jié)點(diǎn)上存2份
ndb有nodegroup的概念,在你的配置情況下,4個(gè)ndb節(jié)點(diǎn)會(huì)分為2個(gè)nodegroup,每個(gè)nodegrup中的每個(gè)節(jié)點(diǎn)的數(shù) ...

恩,很不錯(cuò)

論壇徽章:
0
7 [報(bào)告]
發(fā)表于 2009-09-21 22:05 |只看該作者
這個(gè)是某廠家的通信行業(yè)里的HLR產(chǎn)品,現(xiàn)在正在用的

就是這個(gè)東西,而且是新產(chǎn)品哦,是在線用的產(chǎn)品哦

論壇徽章:
0
8 [報(bào)告]
發(fā)表于 2009-09-21 22:12 |只看該作者
NoOfReplicas=2,所以每一行記錄會(huì)在ndb節(jié)點(diǎn)上存2份

是啥意思?是每個(gè)NDB上一個(gè)記錄存兩份?

NoOfNodes = NoOfNodegroups * NoOfReplicas

如果NoOfReplicas是每個(gè)節(jié)點(diǎn)存兩份,那這個(gè)公式怎么解釋呢?謝謝


我已經(jīng)理解了,NODE之間備份是在一個(gè)組里的,因此肯定是NOD NUMBER/NoOfReplicas=node group的

因此在倆NODE的話,比如NoOfReplicas=1的話,那就是倆組,一個(gè)NODE一般數(shù)據(jù),所以掛了任何一個(gè)都不行。而NoOfReplicas=2的話,因?yàn)橐袀浞荩加脗zNODE,因此只能有一個(gè)組了。而一個(gè)每一個(gè)NODE里有完整的數(shù)據(jù),因此掛了任何一個(gè)都不會(huì)壞。

在四個(gè)NODE的話,NoOfReplicas=2,因此每個(gè)組占倆NODE,那可以分成兩個(gè)組,每個(gè)組里有一半的數(shù)據(jù),因此不能整個(gè)組壞掉。
在四個(gè)NODE的話,NoOfReplicas=4的話,因此每個(gè)組就占用4個(gè)NODE,因此只能有一個(gè)組,每個(gè)NODE有四份數(shù)據(jù),因此壞了任何一個(gè)NODE都不能壞。

[ 本帖最后由 wuhen33400 于 2009-9-21 23:46 編輯 ]

論壇徽章:
0
9 [報(bào)告]
發(fā)表于 2009-09-21 22:24 |只看該作者
The following diagram illustrates a MySQL Cluster with four data nodes, arranged in two node groups of two nodes each; nodes 1 and 2 belong to node group 0, and nodes 3 and 4 belong to node group 1. Note that only data (ndbd) nodes are shown here; although a working cluster requires an ndb_mgm process for cluster management and at least one SQL node to access the data stored by the cluster, these have been omitted in the figure for clarity.


The data stored by the cluster is divided into four partitions, numbered 0, 1, 2, and 3. Each partition is stored — in multiple copies — on the same node group. Partitions are stored on alternate node groups:
•        Partition 0 is stored on node group 0; a primary replica (primary copy) is stored on node 1, and a backup replica (backup copy of the partition) is stored on node 2.
•        Partition 1 is stored on the other node group (node group 1); this partition's primary replica is on node 3, and its backup replica is on node 4.
•        Partition 2 is stored on node group 0. However, the placing of its two replicas is reversed from that of Partition 0; for Partition 2, the primary replica is stored on node 2, and the backup on node 1.
•        Partition 3 is stored on node group 1, and the placement of its two replicas are reversed from those of partition 1. That is, its primary replica is located on node 4, with the backup on node 3.

[ 本帖最后由 wuhen33400 于 2009-9-21 23:25 編輯 ]

replicas-groups-1-1.png (12.02 KB, 下載次數(shù): 48)

replicas-groups-1-1.png

論壇徽章:
0
10 [報(bào)告]
發(fā)表于 2009-09-21 23:34 |只看該作者
原帖由 shujun579 于 2009-9-21 00:17 發(fā)表
首先,4個(gè)ndb節(jié)點(diǎn)的數(shù)據(jù)是有冗余的
你的配置文件里NoOfReplicas=2,所以每一行記錄會(huì)在ndb節(jié)點(diǎn)上存2份
ndb有nodegroup的概念,在你的配置情況下,4個(gè)ndb節(jié)點(diǎn)會(huì)分為2個(gè)nodegroup,每個(gè)nodegrup中的每個(gè)節(jié)點(diǎn)的數(shù) ...


在這個(gè)里面比如CD一組,EF一組,那只要CD或者EF不同時(shí)壞就沒有問題,

那么其實(shí)在簇里,其實(shí)整個(gè)簇里的數(shù)據(jù)是被分成了NOD NUMER份的對(duì)吧?

在這個(gè)例子里就是分成了4份對(duì)吧?

CD是一樣的,EF是一樣的,但是CD,EF不能同時(shí)壞,可以壞CE、CF、DE、DF,但是不能CD同時(shí)壞,和EF壞對(duì)吧?

繼續(xù)請(qǐng)教,謝謝。

看上面文章是那樣寫的。

就是不知道MYSQLD在查數(shù)據(jù)的時(shí)候怎么知道數(shù)據(jù)到底在哪個(gè)組里了,是在CD組還是在EF組里?

還是多多指教。

[ 本帖最后由 wuhen33400 于 2009-9-21 23:36 編輯 ]
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP