title: Zabbix系列之(二):CentOS7官方YUM方式安装Zabbix 4.0LTS
categories: Linux
tags:
- Zabbix
timezone: Asia/Shanghai
date: 2019-01-12
环境
[root@localhost ~]# cat /etc/centos-release
CentOS Linux release 7.5.1804 (Core)
第一步:关闭系统默认防火墙
setenforce 0
sed -i -r "/^SELINUX=/c SELINUX=disabled" /etc/selinux/config
which systemctl && systemctl stop firewalld
which systemctl && systemctl disable firewalld
which systemctl && systemctl stop iptables || service iptables stop
which systemctl && systemctl disable iptables || chkconfig iptables off
第二步:使用官方指导文件安装Zabbix
1.打开以下网址然后选择您Zabbix服务器的平台
https://www.zabbix.com/cn/download
2.安装配置Zabbix server
a.配置官方yum源
rpm -ivh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
b.安装Zabbix server,Web前端,agent,mysql
yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent
c.安装MariaDB创建初始数据库(具体安装步骤参见之前文章)
[root@localhost home]# mysql -u root -p
Enter password:
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'xiaoliu';
MariaDB [(none)]> quit
# 导入初始架构和数据,系统将提示您输入新创建的密码。
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
d.为Zabbix server配置数据库密码
vim /etc/zabbix/zabbix_server.conf
DBPassword=xiaoliu
e.为Zabbix前端配置PHP时区参数
# 增加以下行
vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
f.启动Zabbix server和agent进程,并为它们设置开机自启
systemctl restart zabbix-server zabbix-agent httpd
systemctl enable zabbix-server zabbix-agent httpd
systemctl status zabbix-server zabbix-agent httpd
现在您的Zabbix server已经安装完成并开始运行!
3.配置Zabbix前端
打开http://10.0.1.66/zabbix
1.Next step(欢迎页面)
2.Next step(先决条件检查,如果以上步骤都没有问题的话,这里状态全部都是OK)
3.配置数据库连接
输入之前设置的数据库里zabbix用户的密码,其他保持默认,下一步
4.Zabbix server details(直接默认下一步)
5.Pre-installation summary(安装前总结:直接下一步)
6.安装完成页面(Finish)
Configuration file "/etc/zabbix/web/zabbix.conf.php" created.
4.安装完成可以登录了。
http://10.0.1.66/zabbix
Enter the user name Admin with password zabbix to log in as a Zabbix superuser.
附录:
Zabbix官网:https://www.zabbix.com/cn/download
网友评论