最近一台zabbix服务器在搬机房后,起来了但是数据都查询不到,查看log发现一段错误日志,数据表被损坏无法读取数据。
16214:20150514:132717.547 [Z3005] query failed: [145] Table './zabbix/history_uint' is marked as crashed and should be repaired [select clock,ns,value from history_uint where itemid=30692 and clock>1431574409 and clock<=1431581237] 16214:20150514:132720.553 [Z3005] query failed: [145] Table './zabbix/history_uint' is marked as crashed and should be repaired [select clock,ns,value from history_uint where itemid=30692 and clock>1431574409 and clock<=1431581240]
解决办法:
mysql有自带的myisamchk 工具会帮助你恢复数据表的索引。
myisamchk工具在mysql文件夹的bin路径下,另外找到报错的/zabbix/history_uint的MYI文件
命令如下:
myisamchk -c -r /usr/local/mysql/var/zabbix/history_uint.MYI
成功后如图显示
最后重启mysql即可。

聂扬帆博客
一个分享IT运维相关工作经验和实战技巧的个人博客
2015年5月15日 上午10:03 沙发
不止一次的来访,一如既往的支持。