突然发现cacti所载的syslog无法各主机发来的日志了,打开一片空白,之前还能正常显示呢?
再进一步进入数据库,找到syslog表,想浏览一下里面的数据,结果显示
#144 - Table './cacti/syslog' is marked as crashed and last (automatic?) repair failed
打不开syslog的表,再查此表的大小
# ls -l | more
-rw-rw---- 1 mysql mysql 8427720500 Jun 4 00:00 syslog.MYD
-rw-rw---- 1 mysql mysql 1024 Jun 16 11:03 syslog.MYI
# du -m syslog.MYD
7965 syslog.MYD
嗯,接近8G的,严重超标大表呀,根据提示,先修改一下表吧。
# service mysqld stop
Stopping mysqld: [ OK ]
# myisamchk -r syslog.MYI
- recovering (with sort) MyISAM-table 'syslog.MYI'
Data records: 13192263
- Fixing index 1
- Fixing index 2
- Fixing index 3
- Fixing index 4
- Fixing index 5