mysql集群经常无法truncate_失败的mysql cluster配置-无法顺利转换已有数据
本文轉自:http://bbs.chinaunix.net/archiver/?tid-819640.html
失敗的mysql cluster配置-無法順利轉換已有數據
額配置了1個cluster,但測試下來始終無法體會到高性
能,在初始轉換表的過程中就落敗下來,表通過alter table,以及直接執行sql創建,都無法成功;
配置的ndb節點數據增長迅速,原來mysql下只有不到200M的文件,在ndb
cluster下達到6G之多.最后是出現ndb節點意外down掉.
請教成功運行的各位:
(1)你們的表結構中是否很少定義有vchar 255這樣字節的變量?
查看cluster的mail list和 論壇,懷疑因為現有表中有定義過多256個字節變量導致數據增長迅猛的;
(2)重啟cluster花費的時間很長嗎?
測試下來,隨著ndb notes data的不斷增加,每次重啟cluster服務,需要等待nodes從starting狀態到正常這段時間也越長
(3)是否還有其他的參數需要配置,才能
下面是相關配置:
按文檔,配置完成2個節點運行cluster. 1臺作為ndb管理節點+ndb節點+sql 節點; 1臺作為ndb節點+sql 節點;
mysql 為5.0.24, 沒有用max版本,是編譯出來的(不知是否會有影響--without-debug
--with-extra-charsets=complex --prefix=/usr/local/mysql --without-bench
--with-archive-storage-engine --with-ndbcluster)
欲轉換已有1個db,在ndb下運行, 初始使用alter table engine=ndbcluster ,按ndb_size.pl工具測得參數如下:
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
實際配置文件中大小均有增加:
(有些參數是在alter table是出現table is full以及truncate
timeout之類的錯誤后進行調整添加的,比如TimeBetweenLocalCheckpoints,NoOfFragmentLogFiles,
很多參數調整或者出錯后都運行了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個了
(3)是否還有其他的參數需要配置,從而優化cluster?
(4)cluster中,對于一張表是否能同時存在primary key 以及unique key?
alter table遇到的error:
1.??ERROR 1114 (HY000): The table '#sql-7157_2' is full
出現這個是配置的DataMemory數值不夠,需要加大;
2. ERROR 1297 (HY000): Got temporary error 410 'REDO log files
overloaded, consult online manual (decrease
TimeBetweenLocalCheckpoints, and|or incre' from ndbcluster
出現這個錯誤后,調整了TimeBetweenLocalCheckpoints=2; NoOfFragmentLogFiles=100 這2個參數,
而且要--initial才能生效;
3. Internal program error (failed ndbrequire) (Internal error, programming error or missing error message, please report a bug)
ndb note 的服務自動停止, 每次重啟cluster無法啟動(這時該節點上的數據data dir占用空間6G多),后來只有 --initial
執行sql語句創建表時遇到的問題:
1. ERROR 1022 (23000) at line 49: Can't write; duplicate key in table 'members'
懷疑是此表有1個unique key ,加上cluster中每個表都必須要有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
在執行delete 刪表的時候出現的錯誤,但后來通過 truncate table 刪表成功;
請配置過cluster的各位發表一下建議阿, cluster 應該沒那么弱吧, 難道免費的性能就不好嗎?
總結
以上是生活随笔為你收集整理的mysql集群经常无法truncate_失败的mysql cluster配置-无法顺利转换已有数据的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 什么数据库比mysql效率高_牛x!一款
- 下一篇: mysql 删除原理_MySQL权限原理