标签:虚拟机 解决办法 normal convert imp isp gen weight spl
本人在虚拟机上安装了ZABBIX,同时安装server和agent端,但无法通过
[root@centos7 ~]# netstat -nalptu | grep zabbix
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 2176/zabbix_agentd
监测到监听10051端口,服务端没有正常起来,通过查看zabbix日志zabbix_server.conf (所在目录/tmp/zabbix_server.log)发现报错
73415:20181011:184245.845 [Z3001] connection to database ‘zabbix‘ failed: [2002] Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (2)
由于/var/lib/mysql/mysql.sock 文件并不存在,mysql.sock正确目录是/tmp/mysql.sock,最终的解决办法是: my.cnf里面socket路径改成/tmp/mysql.sock,同时mkdir -p /var/lib/mysql ; touch /var/lib/mysql/mysql.sock ,
并做了一个软链接:ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock 后才正常
然后重起zabbix_server和zabbix_agentd端,才正常监听10051端口
/etc/init.d/zabbix_server restart
/etc/init.d/zabbix_agentd restart
[root@centos7 ~]# netstat -nalptu | grep zabbix
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 2588/zabbix_agentd
tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 2499/zabbix_server
标签:虚拟机 解决办法 normal convert imp isp gen weight spl
原文地址:https://www.cnblogs.com/linux-china/p/9775592.html