Chinaunix首页 | 论坛 | 博客
  • 博客访问: 207918
  • 博文数量: 53
  • 博客积分: 2059
  • 博客等级: 大尉
  • 技术积分: 577
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-30 03:03
文章分类
文章存档

2012年(4)

2011年(19)

2010年(30)

分类: Mysql/postgreSQL

2011-05-27 18:46:49

由于监控平台由于一位同事的异常操作,导致异常关机,所以当重启启动的时候,发现其他的一切正常,就是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,出现图像。
异常解决。
阅读(3432) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

lff6422015-05-13 15:15:09

按上面的提示来看,你数据丢了些~~

yifangyou2011-06-03 21:22:57

数据修复后,有没有少数据啊