我收到了来自Zabbix服务器的电子邮件警报,其数据库已关闭,我已检查日志并找到以下条目。有谁能解释一下这是什么意思以及它为什么会发生?
1828:20160224:073113.549 [Z3005] query failed: [1317] Query execution was interrupted [select h.hostid,h.host,h.name,t.httptestid,t.name,t.variables,t.headers,t.agent,t.authentication,t.http_user,t.http_password,t.http_proxy,t.retries,t.ssl_cert_file,t.ssl_key_file,t.ssl_key_password,t.verify_peer,t.verify_host from httptest t,hosts h where t.hostid=h.hostid and t.nextcheck<=1456320673 and mod(t.httptestid,10)=5 and t.status=0 and h.proxy_hostid is null and h.status=0 and (h.maintenance_status=0 or h.maintenance_type=0)]
1828:20160224:073113.549 [Z3005] query failed: [2006] MySQL server has gone away [select min(t.nextcheck) from httptest t,hosts h where t.hostid=h.hostid and mod(t.httptestid,10)=5 and t.status=0 and h.proxy_hostid is null and h.status=0 and (h.maintenance_status=0 or h.maintenance_type=0)]
1828:20160224:073113.549 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
1828:20160224:073113.549 database is down: reconnecting in 10 seconds
然后我看到这些日志:
1843:20160224:073119.428 [Z3005] query failed: [2006] MySQL server has gone away [begin;]
1828:20160224:073123.549 database connection re-established
不确定它是如何连接的!
答案 0 :(得分:0)
在zabbix_server运行时,看起来你的mysql服务器已重新启动。
如果不是这种情况,您可能已经进行了复制设置并且数据库zabbix已连接进入无法接受查询的状态。
这方面的一个例子是galera复制wsrep_ready不是ON