mysql集群经常无法truncate_失败的mysql cluster配置-无法顺利转换已有数据
本文轉(zhuǎn)自:http://bbs.chinaunix.net/archiver/?tid-819640.html
失敗的mysql cluster配置-無(wú)法順利轉(zhuǎn)換已有數(shù)據(jù)
額配置了1個(gè)cluster,但測(cè)試下來(lái)始終無(wú)法體會(huì)到高性
能,在初始轉(zhuǎn)換表的過(guò)程中就落敗下來(lái),表通過(guò)alter table,以及直接執(zhí)行sql創(chuàng)建,都無(wú)法成功;
配置的ndb節(jié)點(diǎn)數(shù)據(jù)增長(zhǎng)迅速,原來(lái)mysql下只有不到200M的文件,在ndb
cluster下達(dá)到6G之多.最后是出現(xiàn)ndb節(jié)點(diǎn)意外down掉.
請(qǐng)教成功運(yùn)行的各位:
(1)你們的表結(jié)構(gòu)中是否很少定義有vchar 255這樣字節(jié)的變量?
查看cluster的mail list和 論壇,懷疑因?yàn)楝F(xiàn)有表中有定義過(guò)多256個(gè)字節(jié)變量導(dǎo)致數(shù)據(jù)增長(zhǎng)迅猛的;
(2)重啟cluster花費(fèi)的時(shí)間很長(zhǎng)嗎?
測(cè)試下來(lái),隨著ndb notes data的不斷增加,每次重啟cluster服務(wù),需要等待nodes從starting狀態(tài)到正常這段時(shí)間也越長(zhǎng)
(3)是否還有其他的參數(shù)需要配置,才能
下面是相關(guān)配置:
按文檔,配置完成2個(gè)節(jié)點(diǎn)運(yùn)行cluster. 1臺(tái)作為ndb管理節(jié)點(diǎn)+ndb節(jié)點(diǎn)+sql 節(jié)點(diǎn); 1臺(tái)作為ndb節(jié)點(diǎn)+sql 節(jié)點(diǎn);
mysql 為5.0.24, 沒(méi)有用max版本,是編譯出來(lái)的(不知是否會(huì)有影響--without-debug
--with-extra-charsets=complex --prefix=/usr/local/mysql --without-bench
--with-archive-storage-engine --with-ndbcluster)
欲轉(zhuǎn)換已有1個(gè)db,在ndb下運(yùn)行, 初始使用alter table engine=ndbcluster ,按ndb_size.pl工具測(cè)得參數(shù)如下:
Parameter??? ? ? ? 4.1??? ? ? ? 5.0??? ? ? ? 5.1
DataMemory (kb) ? ? ? ? 1335136 ? ? ? ? 1335136 ? ? ? ? 239072
IndexMemory (kb) ? ? ? ? 161168 ? ? ? ? 81136 ? ? ? ? 81136
MaxNoOfTables ? ? ? ? 88 ? ? ? ? 88 ? ? ? ? 88
MaxNoOfAttributes ? ? ? ? 529 ? ? ? ? 529 ? ? ? ? 529
MaxNoOfOrderedIndexes ? ? ? ? 91 ? ? ? ? 91 ? ? ? ? 91
MaxNoOfUniqueHashIndexes ? ? ? ? 91 ? ? ? ? 91 ? ? ? ? 91
MaxNoOfTriggers ? ? ? ? 364 ? ? ? ? 364 ? ? ? ? 364
實(shí)際配置文件中大小均有增加:
(有些參數(shù)是在alter table是出現(xiàn)table is full以及truncate
timeout之類(lèi)的錯(cuò)誤后進(jìn)行調(diào)整添加的,比如TimeBetweenLocalCheckpoints,NoOfFragmentLogFiles,
很多參數(shù)調(diào)整或者出錯(cuò)后都運(yùn)行了ndbd --initial)
# Options affecting ndbd processes on all data nodes:
[NDBD DEFAULT]
NoOfReplicas=2
DataMemory=1800M
IndexMemory=200M
MaxNoOfAttributes=10000
MaxNoOfTables=1760
MaxNoOfUniqueHashIndexes=5000
MaxNoOfOrderedIndexes=5000
MaxNoOfTriggers=4000
TimeBetweenLocalCheckpoints=2
NoOfFragmentLogFiles=100
# TCP/IP options:
[TCP DEFAULT]
portnumber=2202
# Management process options:
[NDB_MGMD]
id = 1
hostname=192.168.100.225
datadir=/usr/local/mysql-cluster
# Options for data node "A":
[NDBD]
id = 2
hostname=192.168.100.206
datadir=/usr/local/mysql/data
# Options for data node "B":
[NDBD]
id = 3
hostname=192.168.100.225
datadir=/usr/local/mysql/data
# SQL node options:
[MYSQLD]
id = 4
hostname=192.168.100.206
# SQL node options:
[MYSQLD]
id = 5
hostname=192.168.100.225
2006-8-29 16:06
stlaw
漏了這2個(gè)了
(3)是否還有其他的參數(shù)需要配置,從而優(yōu)化cluster?
(4)cluster中,對(duì)于一張表是否能同時(shí)存在primary key 以及unique key?
alter table遇到的error:
1.??ERROR 1114 (HY000): The table '#sql-7157_2' is full
出現(xiàn)這個(gè)是配置的DataMemory數(shù)值不夠,需要加大;
2. ERROR 1297 (HY000): Got temporary error 410 'REDO log files
overloaded, consult online manual (decrease
TimeBetweenLocalCheckpoints, and|or incre' from ndbcluster
出現(xiàn)這個(gè)錯(cuò)誤后,調(diào)整了TimeBetweenLocalCheckpoints=2; NoOfFragmentLogFiles=100 這2個(gè)參數(shù),
而且要--initial才能生效;
3. Internal program error (failed ndbrequire) (Internal error, programming error or missing error message, please report a bug)
ndb note 的服務(wù)自動(dòng)停止, 每次重啟cluster無(wú)法啟動(dòng)(這時(shí)該節(jié)點(diǎn)上的數(shù)據(jù)data dir占用空間6G多),后來(lái)只有 --initial
執(zhí)行sql語(yǔ)句創(chuàng)建表時(shí)遇到的問(wèn)題:
1. ERROR 1022 (23000) at line 49: Can't write; duplicate key in table 'members'
懷疑是此表有1個(gè)unique key ,加上cluster中每個(gè)表都必須要有primary key,有所沖突造成;
2. mysql> delete from members;
ERROR 1297 (HY000): Got temporary error 233 'Out of operation records
in transaction coordinator (increase MaxNoOfConcurrentOperations)' from
ndbcluster
在執(zhí)行delete 刪表的時(shí)候出現(xiàn)的錯(cuò)誤,但后來(lái)通過(guò) truncate table 刪表成功;
請(qǐng)配置過(guò)cluster的各位發(fā)表一下建議阿, cluster 應(yīng)該沒(méi)那么弱吧, 難道免費(fèi)的性能就不好嗎?
總結(jié)
以上是生活随笔為你收集整理的mysql集群经常无法truncate_失败的mysql cluster配置-无法顺利转换已有数据的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 什么数据库比mysql效率高_牛x!一款
- 下一篇: mysql 删除原理_MySQL权限原理