標籤:cacti should be repaired
在查看cactiez發現登入不上去,登入上去發現磁碟空間不足了,最後發現mysql報錯日誌高達10G,通過日誌發現:
[[email protected] bin]# tail -f /var/log/mysqld.log2018-03-02 15:54:17 31645 [ERROR] /usr/sbin/mysqld: Table ‘./cacti/poller_item‘ is marked as crashed and should be repaired2018-03-02 15:54:17 31645 [ERROR] /usr/sbin/mysqld: Table ‘./cacti/poller_item‘ is marked as crashed and should be repaired2018-03-02 15:54:17 31645 [ERROR] /usr/sbin/mysqld: Table ‘./cacti/poller_item‘ is marked as crashed and should be repaired2018-03-02 15:54:17 31645 [ERROR] /usr/sbin/mysqld: Table ‘./cacti/poller_item‘ is marked as crashed and should be repaired2018-03-02 15:54:17 31645 [ERROR] /usr/sbin/mysqld: Table ‘./cacti/poller_item‘ is marked as crashed and should be repaired2018-03-02 15:54:17 31645 [ERROR] /usr/sbin/mysqld: Table ‘./cacti/poller_item‘ is marked as crashed and should be repaired2018-03-02 15:54:17 31645 [ERROR] /usr/sbin/mysqld: Table ‘./cacti/poller_item‘ is marked as crashed and should be repaired2018-03-02 15:54:17 31645 [ERROR] /usr/sbin/mysqld: Table ‘./cacti/poller_item‘ is marked as crashed and should be repaired2018-03-02 15:54:17 31645 [ERROR] /usr/sbin/mysqld: Table ‘./cacti/poller_item‘ is marked as crashed and should be repaired
而且不斷快速的增長,通過日誌發現是cacti的這張表出現了錯誤,經過,排查經過修複表結構,報錯結束,以下是修複過程。
通過使用 mysqlcheck --auto-repair --databases cacti -u root -p 來進行修複。
[[email protected] bin]# mysqlcheck --auto-repair --databases cacti -u root -pEnter password: cacti.cdef OKcacti.cdef_items OKcacti.colors OKcacti.data_input OKcacti.data_input_data OKcacti.data_input_fields OKcacti.data_local OKcacti.data_template OKcacti.data_template_data OKcacti.data_template_data_rra OKcacti.data_template_rrd OKcacti.graph_local OKcacti.graph_template_input OKcacti.graph_template_input_defs OKcacti.graph_templates OKcacti.graph_templates_gprint OKcacti.graph_templates_graph OKcacti.graph_templates_item OKcacti.graph_tree OKcacti.graph_tree_items OKcacti.host OKcacti.host_graph OKcacti.host_snmp_cache OKcacti.host_snmp_query OKcacti.host_template OKcacti.host_template_graph OKcacti.host_template_snmp_query OKcacti.plugin_config OKcacti.plugin_db_changes OKcacti.plugin_hooks OKcacti.plugin_realms OKcacti.poller OKcacti.poller_command OKcacti.poller_itemwarning : Table is marked as crashedwarning : 2 clients are using or haven‘t closed the table properlyerror : Unexpected byte: 0 at link: 95080error : Corruptcacti.poller_output OKcacti.poller_reindex OKcacti.poller_time OKcacti.rra OKcacti.rra_cf OKcacti.settings OKcacti.settings_graphs OKcacti.settings_tree OKcacti.snmp_query OKcacti.snmp_query_graph OKcacti.snmp_query_graph_rrd OKcacti.snmp_query_graph_rrd_sv OKcacti.snmp_query_graph_sv OKcacti.user_auth OKcacti.user_auth_perms OKcacti.user_auth_realm OKcacti.user_log OKcacti.version OKcacti.weathermap_auth OKcacti.weathermap_data OKcacti.weathermap_groups OKcacti.weathermap_maps OKcacti.weathermap_settings OKRepairing tablescacti.poller_iteminfo : Wrong bytesec: 0- 0- 0 at 20912; Skippedinfo : Found block with too small length at 87732; Skippedinfo : Wrong bytesec: 0- 0- 0 at 21096; Skippedinfo : Wrong bytesec: 57- 48- 57 at 21164; Skippedinfo : Wrong bytesec: 46- 49- 48 at 28040; Skippedinfo : Found block that points outside data file at 92696info : Wrong bytesec: 0- 0- 0 at 20884; Skippedinfo : Found block with too small length at 104116; Skippedinfo : Wrong bytesec: 0- 0- 0 at 27264; Skippedinfo : Wrong bytesec: 0- 0- 0 at 28208; Skippedinfo : Wrong bytesec: 0- 0- 0 at 27980; Skippedinfo : Wrong block with wrong total length starting at 108504info : Found block with too small length at 109952; Skippedinfo : Wrong block with wrong total length starting at 112812info : Wrong bytesec: 0- 0- 0 at 21132; Skippedinfo : Wrong block with wrong total length starting at 114852info : Wrong bytesec: 46- 49- 48 at 28012; Skippedinfo : Found block with too small length at 117068; Skippedinfo : Wrong block with wrong total length starting at 117292info : Wrong bytesec: 0- 0- 0 at 9320; Skippedinfo : Wrong bytesec: 49- 46- 49 at 28360; Skippedinfo : Wrong block with wrong total length starting at 120876info : Wrong block with wrong total length starting at 121468info : Wrong bytesec: 46- 49- 46 at 28304; Skippedinfo : Wrong block with wrong total length starting at 124488info : Wrong block with wrong total length starting at 125820warning : Number of rows changed from 652 to 624status : OK
再次查看日誌:
[email protected] bin]# tail -f /var/log/mysqld.log2018-03-02 16:01:53 1824 [Note] InnoDB: Waiting for purge to start2018-03-02 16:01:53 1824 [Note] InnoDB: 5.6.37 started; log sequence number 14982631096442018-03-02 16:01:53 1824 [Note] Server hostname (bind-address): ‘*‘; port: 33062018-03-02 16:01:53 1824 [Note] IPv6 is available.2018-03-02 16:01:53 1824 [Note] - ‘::‘ resolves to ‘::‘;2018-03-02 16:01:53 1824 [Note] Server socket created on IP: ‘::‘.2018-03-02 16:01:53 1824 [Note] Event Scheduler: Loaded 0 events2018-03-02 16:01:53 1824 [Note] /usr/sbin/mysqld: ready for connections.Version: ‘5.6.37‘ socket: ‘/var/lib/mysql/mysql.sock‘ port: 3306 MySQL Community Server (GPL)2018-03-02 16:01:54 1824 [Warning] IP address ‘172.20.66.26‘ could not be resolved: Name or service not known
錯誤得到解決了。
cactiez使用mysql資料庫出現以下報錯:“[ERROR] /usr/sbin/mysqld”