免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2144 | 回复: 0

Mysql数据库异常宕机 [复制链接]

论坛徽章:
0
发表于 2011-12-21 08:42 |显示全部楼层
由于监控平台由于一位同事的异常操作,导致异常关机,所以当重启启动的时候,发现其他的一切正常,就是cacti监控没有出现图像,比较郁闷。
查看cacti日志发现有如下记录:
  1. 05/27/2011 06:36:57 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"select poller_output.output, poller_output.time, poller_output.local_data_id, poller_item.rrd_path, poller_item.rrd_name, poller_item.rrd_num from (poller_output,poller_item) where (poller_output.local_data_id=poller_item.local_data_id and poller_output.rrd_name=poller_item.rrd_name) LIMIT 10000"
  2. 05/27/2011 06:36:56 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'145', SQL:"select poller_output.output, poller_output.time, poller_output.local_data_id, poller_item.rrd_path, poller_item.rrd_name, poller_item.rrd_num from (poller_output,poller_item) where (poller_output.local_data_id=poller_item.local_data_id and poller_output.rrd_name=poller_item.rrd_name) LIMIT 10000"
通过分析,可以知道是数据库出现异常导致的,其中有一个表损坏,进入数据库
查询该表出现如下错误:
  1. select * from poller_item;
  2. ERROR 145 (HY000): Table './cacti/poller_item' is marked as crashed and should be repaired
这就可以找到问题了
于是进去该数据库目录:
执行如下数据库修复;
  1. myisamchk -r poller_item
  2. - recovering (with sort) MyISAM-table 'poller_item'
  3. Data records: 2417
  4. - Fixing index 1
  5. Wrong bytesec: 0- 0- 0 at 515400; Skipped
  6. Wrong bytesec: 0- 0- 0 at 515400; Skipped
  7. Wrong bytesec: 0- 0- 0 at 515400; Skipped
  8. Wrong bytesec: 0- 0- 0 at 515400; Skipped
  9. Wrong bytesec: 0- 0- 0 at 515400; Skipped
  10. myisamchk: warning: Duplicate key for record at 484800 against record at 356364
  11. - Fixing index 2
  12. - Fixing index 3
  13. - Fixing index 4
  14. - Fixing index 5
  15. Data records: 2404
  16. myisamchk: warning: 1 records have been removed
稍等,从新打开cacti,出现图像。
异常解决。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP