出于测试目的,我使用 3 个 Amazon EC2 Medium(1 个核心,2 个 ecu,3.7GB 内存,ubuntu 12.04 lts)设置了一个 MySQL 集群:1 台机器用于 mgm + sql,另外 2 台机器用于数据节点。这里是由自动安装程序生成的 config.ini(将来为我提供模板):
[NDB_MGMD DEFAULT]
Portnumber=1186
[NDB_MGMD]
NodeId=49
HostName=10.0.0.10
DataDir=/usr/local/mysql/data/49/
Portnumber=1186
[TCP DEFAULT]
SendBufferMemory=4M
ReceiveBufferMemory=4M
[NDBD DEFAULT]
BackupMaxWriteSize=1M
BackupDataBufferSize=16M
BackupLogBufferSize=4M
BackupMemory=20M
BackupReportFrequency=10
MemReportFrequency=30
LogLevelStartup=15
LogLevelShutdown=15
LogLevelCheckpoint=8
LogLevelNodeRestart=15
DataMemory=650M
IndexMemory=120M
MaxNoOfTables=4096
MaxNoOfTriggers=3500
NoOfReplicas=2
StringMemory=25
DiskPageBufferMemory=64M
SharedGlobalMemory=20M
LongMessageBuffer=32M
MaxNoOfConcurrentTransactions=16384
BatchSizePerLocalScan=512
FragmentLogFileSize=256M
NoOfFragmentLogFiles=3
RedoBuffer=32M
MaxNoOfExecutionThreads=2
StopOnError=false
LockPagesInMainMemory=1
TimeBetweenEpochsTimeout=32000
TimeBetweenWatchdogCheckInitial=60000
TransactionInactiveTimeout=60000
HeartbeatIntervalDbDb=15000
HeartbeatIntervalDbApi=15000
[NDBD]
NodeId=1
HostName=10.0.0.21
DataDir=/usr/local/mysql/data/1/
[NDBD]
NodeId=2
HostName=10.0.0.22
DataDir=/usr/local/mysql/data/2/
[MYSQLD DEFAULT]
[MYSQLD]
NodeId=53
HostName=10.0.0.10
集群启动良好。然后我尝试导入一个示例 Joomla db,我对其进行了一些更改: InnoDB 到 NDB 和一些大的 VARCHAR 字段到 TEXT 字段。但是在成功导入一些表后,我在下一个表上出现错误:Error Code: 1114. The table 'xxx' is full
. 下表非常非常简单:
CREATE TABLE IF NOT EXISTS `joomla_finder_links_terms3` (
`link_id` int(10) unsigned NOT NULL,
`term_id` int(10) unsigned NOT NULL,
`weight` float unsigned NOT NULL,
PRIMARY KEY (`link_id`,`term_id`),
KEY `idx_term_weight` (`term_id`,`weight`),
KEY `idx_link_term_weight` (`link_id`,`term_id`,`weight`)
) ENGINE=NDB DEFAULT CHARSET=utf8;
我检查了 MemoryUsage,它只有 1%:
ndb_mgm -e 'all report MemoryUsage'
Connected to Management Server at: 10.0.0.10:1186
Node 1: Data usage is 1%(286 32K pages of total 20640)
Node 1: Index usage is 1%(259 8K pages of total 14752)
Node 2: Data usage is 1%(286 32K pages of total 20640)
Node 2: Index usage is 1%(259 8K pages of total 14752)
谁能告诉我我做错了?感谢广告。
[编辑 1]
注意:示例数据库只是结构,没有数据,没有行。