rpm -ivh http://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-1.el7.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
yum install zabbix-server-mysql zabbix-web-mysql zabbix-get zabbix-agent
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
###nginx配置个域名 重启下Nginx
cp -r /usr/share/zabbix /data/httpd/
chown www:www -R /data/httpd/zabbix/
访问Nginx里刚才配置的那个域名 进入web端安装页面 安装完成后
vim /etc/zabbix/zabbix_server.conf 查看日志存储地方 LogFile=/var/log/zabbix/zabbix_server.log
vim /var/log/zabbix/zabbix_server.log
15057:20190517:111319.707 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
15057:20190517:111319.707 database is down: reconnecting in 10 seconds
测试连接mysql 正常连接的
/usr/local/mysql56/bin/mysqlcheck -A --user=zabbix --password=zabbix 检测也是ok的
但zabbix server服务就是启不来
后来命令行连接mysql带上了--socket参数
mysql -uzabbix -pzabbix --socket=/var/lib/mysql/mysql.sock
Warning: Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
原来自己的mysql5.6.33 用的是 socket: /tmp/mysql.sock
vim /etc/zabbix/zabbix_server.conf
设置DBSocket=/tmp/mysql.sock
service zabbix-server restart
zabbix-server服务起来了
启用Zabbix Agent
vim /etc/zabbix/zabbix_agentd.conf
service zabbix-agent start