技术栈
cacti系统服务器异常关机后不显示图形的解决方案
由于部门使用的Cacti系统添加交换机到了1900多台,图形数量更是达到了59738个,数据源也到了60644个,各位大神,国内罕见吧!
不过真心佩服老外的技术,其实我想说的是linux系统,要是windows早就崩了,其实我更想说的是中间件apache,要是IIS之类的,就这并发,估计要“烧掉了”吧!
不过俺们公司可是上市公司,用着两核,4G内存,80G硬盘的服务器实在是太丢人,其实是系统也确实有点卡了哈!正好有闲置资源,所以就找系统工程师扩内存、CPU,当时出于对linux的信任,又不是生产环境,所以就跟系统服务的小哥说,直接给硬关机就行,结果悲剧了,等配置扩完后,系统起来所有图形看不到了,其实是无法画图了。
我的1900台交换机啊,关键是怕兄弟们骂我呀,百度了下各种原因都有,有说log日志满了的,硬盘满了的,数据库损坏的,哎,突然想起来了,妈的,还有个数据库啊,我相信linux,相信apache,但是mysql可不行啊!不能能直接硬关机啊,不光mysql,oracle,mssql等都不能这么直接搞呀,很容易丢数据,所以我就开始检查数据库,可是像我这种二把刀哪能对mysql排错呀,也就会个select和delete,所以总会有适合咱二把刀的工具,那就是Navicat,我大学的时候就用过,后来因为接触过很多php+mysql的系统,所以也用过很多次,这个软件里有个维护-修复表,好傻瓜呀!点击一下,会卡顿一段时间,修复完了,会有修复结果。问题解决了哈,对,就这么简单。
等等,请允许我再装一会B,那么我是怎么判断出数据库出问题了呢,我是通过命令行发现的。
[root@Cnyunwei ~]# tail -f /var/log/mysqld.log 191106 19:22:15 [ERROR] /usr/libexec/mysqld: Table './cacti/poller_output' is marked as crashed and should be repaired 191106 19:22:15 [ERROR] /usr/libexec/mysqld: Table './cacti/poller_output' is marked as crashed and should be repaired 191106 19:22:15 [ERROR] /usr/libexec/mysqld: Table './cacti/poller_output' is marked as crashed and should be repaired 191106 19:22:16 [ERROR] /usr/libexec/mysqld: Table './cacti/poller_output' is marked as crashed and should be repaired 191106 19:22:16 [ERROR] /usr/libexec/mysqld: Table './cacti/poller_output' is marked as crashed and should be repaired 191106 19:22:16 [ERROR] /usr/libexec/mysqld: Table './cacti/poller_output' is marked as crashed and should be repaired 191106 19:22:17 [ERROR] /usr/libexec/mysqld: Table './cacti/poller_output' is marked as crashed and should be repaired 191106 19:22:18 [ERROR] /usr/libexec/mysqld: Table './cacti/poller_output' is marked as crashed and should be repaired 191106 19:22:49 [Note] Retrying repair of: './cacti/poller_output' with keycache 191106 19:22:49 [Note] Found 1602 of 37 rows when repairing './cacti/poller_output'
对,就是tail -f /var/log/mysqld.log,你会发现会有很多报错,而且不断快速的增长,通过日志发现是cacti的这张表出现了错误,经过,排查经过修复表结构,报错结束,以下是修复过程。
通过使用 mysqlcheck --auto-repair --databases cacti -u root -p 来进行修复。
[root@Cnyunwei ~]# mysqlcheck --auto-repair --databases cacti -u root -p Enter password: cacti.cdef OK cacti.cdef_items OK cacti.colors OK cacti.data_input OK cacti.data_input_data OK cacti.data_input_fields OK cacti.data_local OK cacti.data_template OK cacti.data_template_data OK cacti.data_template_data_rra OK cacti.data_template_rrd OK cacti.graph_local OK cacti.graph_template_input OK cacti.graph_template_input_defs OK cacti.graph_templates OK cacti.graph_templates_gprint OK cacti.graph_templates_graph OK cacti.graph_templates_item OK cacti.graph_tree OK cacti.graph_tree_items OK cacti.host OK cacti.host_graph OK cacti.host_snmp_cache OK cacti.host_snmp_query OK cacti.host_template OK cacti.host_template_graph OK cacti.host_template_snmp_query OK cacti.plugin_aggregate_color_template_items OK cacti.plugin_aggregate_color_templates OK cacti.plugin_config OK cacti.plugin_db_changes OK cacti.plugin_hooks OK cacti.plugin_nectar OK cacti.plugin_nectar_items OK cacti.plugin_realms OK cacti.plugin_thold_contacts OK cacti.plugin_thold_log OK cacti.plugin_thold_template_contact OK cacti.plugin_thold_threshold_contact OK cacti.poller OK cacti.poller_command OK cacti.poller_item OK cacti.poller_output OK cacti.poller_output_rt OK cacti.poller_reindex OK cacti.poller_time OK cacti.rra OK cacti.rra_cf OK cacti.settings OK cacti.settings_graphs OK cacti.settings_tree OK cacti.snmp_query OK cacti.snmp_query_graph OK cacti.snmp_query_graph_rrd OK cacti.snmp_query_graph_rrd_sv OK cacti.snmp_query_graph_sv OK cacti.syslog_alarm_log OK cacti.thold_data OK cacti.thold_template OK cacti.user_auth OK cacti.user_auth_perms OK cacti.user_auth_realm OK cacti.user_log OK cacti.version OK cacti.weathermap_auth OK cacti.weathermap_data OK cacti.weathermap_groups OK cacti.weathermap_maps OK cacti.weathermap_settings OK
好了装B完毕,出来了漂亮的图形
相关文章
linux常用命令
更改IP修改IP:vi /etc/sysconfig/network-scripts/ifcfg-eth0输入i进入编辑模式DNS1="8.8.8.8"GATEWAY="...
Wireshark使用教程(界面说明、捕获过滤器表达式、显示过滤器表达式)
一、说明1.1 背景说明对于大多数刚开始接触wireshark的使用者而言,经常是开始的时候时候看到wireshark能把所有数据包都拦截下来觉得强无敌,但是面对一大堆的数据包要问有什么用或者说想要找...
华三交换机配置本地端口镜像
华三交换机配置本地端口镜像...
华为交换机常用命令
1、华为HUAWEI交换机查看cpu:dis cpu-usage 2、华为HUAWEI交换机查看ip地址冲突display arp ip-conflict track3、华为HUAWEI交换...
网站排名搜索结果跳转到其他网站--网站安全(搜索引擎流量劫持)
网站辛辛苦苦的seo优化成果出来了,可点击百度排名结果居然跳转到黄色网站!!作为一个seo,恐怕这种事情是最让人上火的情况之一了。最进不少排名较...
discuz群组转换为论坛版块
操作方法:直接访问以下地址:http://你的论坛地址/admin.php?mod=forum&action=forums&operation=edit&fid=48&...