zabbix4.4基础环境安装

zabbix4.4基础环境安装

zabbix安装

一、设定yum仓库

1、安装官方库
# rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
# yum clean all
2、修改 /etc/yum.repos.d/zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/zabbix  /zabbix/4.4/rhel/7/$basearch/ #将此处更换为国内源地址
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591

[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=http://repo.zabbix.com/zabbix/4.4/rhel/7/$basearch/debuginfo/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=1

[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1
3、安装zabbix server、web前端、agent
# yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
(注:Error: Package: zabbix-server-mysql-4.4.4-1.el7.x86_64 (zabbix)
           Requires: fping
解决办法:yum -y install epel-release)
4、安装数据库
# yum –y install mariadb-server
# systemctl start mariadb.service
# systemctl enable mariadb.service 
# mysql_secure_installation (初始化数据库,主要设置数据库密码)

5、创建初始数据库
# mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';
mysql> quit;

# 导入初始架构和数据,系统将提示您输入新创建的密码
# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

6、配置数据库

编辑配置文件 /etc/zabbix/zabbix_server.conf,修改以下内容

DBPassword=password (password为创建初始数据库设置的)
7、为zabbix前端配置PHP

编辑配置文件 /etc/httpd/conf.d/zabbix.conf,此处设置的上海

# php_value date.timezone Asia/Shanghai
8、安装Apache(如已安装请跳过)
# yum -y install httpd
# systemctl start httpd
# systemctl enable httpd
9、启动zabbix-server zabbix-agent
# systemctl start zabbix-server zabbix-agent
# systemctl enable zabbix-server zabbix-agent

你可能感兴趣的:(zabbix)