ZABBIX安装过程遇到的坑

ZABBIX3.4 安装  CentOs7 


参考链接:http://blog.csdn.net/xiegh2014/article/details/77571965


vim /etc/selinux/config
SELINUX=disabled


systemctl stop firewalld.service
systemctl disable firewalld.service
firewall-cmd --state


rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
yum install zabbix-server-mysql zabbix-web-mysql -y
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
#zcat /usr/share/doc/zabbix-server-mysql-3.4.5/create.sql.gz | mysql -uroot -p123456 zabbix
use zabbix
source /usr/share/doc/zabbix-server-mysql-3.4.5/create.sql
修改用户
grep -n '^'[a-Z] /etc/zabbix/zabbix_server.conf
设置开机启动


systemctl enable zabbix-server
systemctl start zabbix-server
systemctl status zabbix-server
journalctl -xe


---------------------------------------------------------------------------------
遇到问题 
/usr/sbin/zabbix_server: error while loading shared libraries: libmysqlclient.so.18
解决
可以网上下载libmysqlclient.so.18 或者重命名
在/usr/local/mysql/lib 下  ll 列出链接关系  
发现libmysqlclient.so -> libmysqlclient.so.20
然后我们改变链接关系 删掉原来的链接  重新建立链接
rm -rf libmysqlclient.so
ln -s libmysqlclient.so.18 libmysqlclient.so
ln -s /usr/local/mysql/lib/libmysqlclient.so.18  /usr/lib64/
systemctl start zabbix-server
启动成功


---------------------------------------------------------------------------------


vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
systemctl start httpd
systemctl enable httpd


--------------------------------------------------------------------
报错
进入http://ip/zabbix/时web报404
解决
查找了很多资料后发现zabbix web默认页面路径是/var/www/html/
修改 /etc/httpd/conf/httpd.conf
将其改为 DocumentRoot "/var/www/html/"
重启 /bin/systemctl restart  httpd.service
systemctl restart zabbix-server
成功进入页面


---------------------------------------------------------------------
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
在my.cnf 里面加上
[mysqladmin]
 user = zabbix
 password = zabbix
 socket = /var/lib/mysql/mysql.sock
 
 出现了新问题
 Access deny 
 授权GRANT ALL PRIVILEGES ON *.* TO 'zabbix'@'%' IDENTIFIED BY 'zabbix' WITH GRANT OPTION;
 成功
 
------------------------------------------------------------------------------------------


 
 

你可能感兴趣的:(ZABBIX)