[Z3001] connection to database 'zabbix' fail

时间:2022-06-07 01:11:07

问题:启动zabbix-server的时候,使用ss -tnl发现15001并未被监听,查看/var/log/zabbixsrv/zabbix_server.log 日志,提示:

2628:20190918:214402.782 [Z3001] connection to database ‘zabbix‘ failed: [2003] Can‘t connect to MySQL server on ‘192.168.6.7‘ (13)
2628:20190918:214402.782 Database is down. Reconnecting in 10 seconds.

 

主机程序运行状态:

service zabbix-service status 程序运行正常

service iptables status 显示防火墙已关闭

getenforce 显示Enforcing

配置参数:

DBHost=192.168.6.7

DBName=zabbix

DBUser=zbxuser

DBPassword=zbxpass

# ListenIP=0.0.0.0  # 开启的话,只监听IPV4,不开启,IPV4/IPV6都监听。

数据库配置:

| zbxuser | 192.168.%.% | *24E65C3D3577DA6C2A596788CEAA02923A74B75D |
| zbxuser | localhost | *24E65C3D3577DA6C2A596788CEAA02923A74B75D |

 

原因:SELINUX未关闭,setenforce 0,然后重新启动zabbix-service,端口监听正常。

[Z3001] connection to database 'zabbix' fail