CentOS 7 二进制安装Zabbix 5.0 LTS

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS 7 二进制安装Zabbix 5.0 LTS相关的知识,希望对你有一定的参考价值。

Zabbix监控系统的Web采用php编写而成,需要安装PHP动态解析组件,并用PHP操作数据库。httpd与PHP的交互式通过php-fpm完成的,需要在httpd服务的配置文件中开启FastCGI。

Zabbix 5.0 LTS于2020年5月发布第一个更新,Zabbix 5.0的部署安装不同于之前的1、2、3、4大版本,改动比较大。目前发现的是Zabbix前端安装配置与之前的大版本有较大的区别,以下是二进制安装包的踩坑过程:

安装完毕CentOS71908后,先做OS环境初始化,执行脚本如下:

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.original
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all && yum makecache
yum -y update
yum install -y ntpdate
ntpdate cn.ntp.org.cn
systemctl stop firewalld && systemctl disable firewalld
sed -i ‘s/^SELINUX=./SELINUX=disabled/‘ /etc/selinux/config && setenforce 0
wget https://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm
yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
sed -i ‘s|^#baseurl=https://download.fedoraproject.org/pub|baseurl=https://mirrors.aliyun.com|‘ /etc/yum.repos.d/epel

sed -i ‘s|^metalink|#metalink|‘ /etc/yum.repos.d/epel*
yum clean all && yum makecache
yum -y update
init 6

安装部署Zabbix 5.0 LTS:

[googlebigtable@localhost ~]$ su - root
Password:
Last login: Sun May 31 23:11:02 EDT 2020 on pts/0
[root@localhost ~]# rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
Retrieving https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
warning: /var/tmp/rpm-tmp.IFk6Td: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:zabbix-release-5.0-1.el7 ################################# [100%]
[root@localhost ~]# sed -i ‘s#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#‘ /etc/yum.repos.d/zabbix.repo
[root@localhost ~]# yum clean all && yum makecache
Loaded plugins: fastestmirror, langpacks
Cleaning repos: base extras updates zabbix zabbix-non-supported
Cleaning up list of fastest mirrors
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
zabbix | 2.9 kB 00:00:00
zabbix-non-supported | 951 B 00:00:00
(1/13): base/7/x86_64/group_gz | 153 kB 00:00:00
(2/13): base/7/x86_64/primary_db | 6.1 MB 00:00:03
(3/13): extras/7/x86_64/primary_db | 194 kB 00:00:00
(4/13): extras/7/x86_64/other_db | 122 kB 00:00:00
(5/13): base/7/x86_64/filelists_db | 7.1 MB 00:00:04
(6/13): updates/7/x86_64/filelists_db | 980 kB 00:00:00
(7/13): extras/7/x86_64/filelists_db | 205 kB 00:00:00
(8/13): updates/7/x86_64/primary_db | 1.3 MB 00:00:00
(9/13): updates/7/x86_64/other_db | 183 kB 00:00:00
(10/13): zabbix/x86_64/primary_db | 19 kB 00:00:00
(11/13): zabbix/x86_64/filelists_db | 6.9 kB 00:00:00
(12/13): zabbix/x86_64/other_db | 26 kB 00:00:00
(13/13): base/7/x86_64/other_db | 2.6 MB 00:00:01
(1/3): zabbix-non-supported/x86_64/primary | 1.6 kB 00:00:00
(2/3): zabbix-non-supported/x86_64/other | 1.5 kB 00:00:00
(3/3): zabbix-non-supported/x86_64/filelists | 660 B 00:00:00
zabbix-non-supported 4/4
zabbix-non-supported 4/4
zabbix-non-supported 4/4
Metadata Cache Created
[root@localhost ~]# yum install zabbix-server-mysql zabbix-agent -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package zabbix-agent.x86_64 0:5.0.1-1.el7 will be installed
---> Package zabbix-server-mysql.x86_64 0:5.0.1-1.el7 will be installed
--> Processing Dependency: fping for package: zabbix-server-mysql-5.0.1-1.el7.x86_64
--> Processing Dependency: libOpenIPMIposix.so.0()(64bit) for package: zabbix-server-mysql-5.0.1-1.el7.x86_64
--> Processing Dependency: libOpenIPMI.so.0()(64bit) for package: zabbix-server-mysql-5.0.1-1.el7.x86_64
--> Processing Dependency: libodbc.so.2()(64bit) for package: zabbix-server-mysql-5.0.1-1.el7.x86_64
--> Running transaction check
---> Package OpenIPMI-libs.x86_64 0:2.0.27-1.el7 will be installed
--> Processing Dependency: OpenIPMI-modalias = 2.0.27-1.el7 for package: OpenIPMI-libs-2.0.27-1.el7.x86_64
---> Package fping.x86_64 0:3.10-1.el7 will be installed
---> Package unixODBC.x86_64 0:2.3.1-14.el7 will be installed
--> Running transaction check
---> Package OpenIPMI-modalias.x86_64 0:2.0.27-1.el7 will be installed
--> Processing Dependency: OpenIPMI for package: OpenIPMI-modalias-2.0.27-1.el7.x86_64
--> Running transaction check
---> Package OpenIPMI.x86_64 0:2.0.27-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================
Package Arch Version Repository Size

Installing:
zabbix-agent x86_64 5.0.1-1.el7 zabbix 442 k
zabbix-server-mysql x86_64 5.0.1-1.el7 zabbix 2.6 M
Installing for dependencies:
OpenIPMI x86_64 2.0.27-1.el7 base 243 k
OpenIPMI-libs x86_64 2.0.27-1.el7 base 523 k
OpenIPMI-modalias x86_64 2.0.27-1.el7 base 16 k
fping x86_64 3.10-1.el7 zabbix-non-supported 40 k
unixODBC x86_64 2.3.1-14.el7 base 413 k

Transaction Summary

Install 2 Packages (+5 Dependent packages)

Total download size: 4.2 M
Installed size: 12 M
Downloading packages:
(1/7): OpenIPMI-2.0.27-1.el7.x86_64.rpm | 243 kB 00:00:00
(2/7): OpenIPMI-modalias-2.0.27-1.el7.x86_64.rpm | 16 kB 00:00:00
(3/7): OpenIPMI-libs-2.0.27-1.el7.x86_64.rpm | 523 kB 00:00:00
(4/7): unixODBC-2.3.1-14.el7.x86_64.rpm | 413 kB 00:00:00
warning: /var/cache/yum/x86_64/7/zabbix-non-supported/packages/fping-3.10-1.el7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 79ea5ed4: NOKEY
Public key for fping-3.10-1.el7.x86_64.rpm is not installed
(5/7): fping-3.10-1.el7.x86_64.rpm | 40 kB 00:00:00
warning: /var/cache/yum/x86_64/7/zabbix/packages/zabbix-agent-5.0.1-1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEYB/s | 1.2 MB 00:00:04 ETA
Public key for zabbix-agent-5.0.1-1.el7.x86_64.rpm is not installed
(6/7): zabbix-agent-5.0.1-1.el7.x86_64.rpm | 442 kB 00:00:00
(7/7): zabbix-server-mysql-5.0.1-1.el7.x86_64.rpm | 2.6 MB 00:00:05

Total 699 kB/s | 4.2 MB 00:00:06
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
Importing GPG key 0xA14FE591:
Userid : "Zabbix LLC <packager@zabbix.com>"
Fingerprint: a184 8f53 52d0 22b9 471d 83d0 082a b56b a14f e591
Package : zabbix-release-5.0-1.el7.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
Importing GPG key 0x79EA5ED4:
Userid : "Zabbix SIA <packager@zabbix.com>"
Fingerprint: fbab d5fb 2025 5eca b22e e194 d13d 58e4 79ea 5ed4
Package : zabbix-release-5.0-1.el7.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : OpenIPMI-libs-2.0.27-1.el7.x86_64 1/7
Installing : OpenIPMI-2.0.27-1.el7.x86_64 2/7
Installing : OpenIPMI-modalias-2.0.27-1.el7.x86_64 3/7
Installing : unixODBC-2.3.1-14.el7.x86_64 4/7
Installing : fping-3.10-1.el7.x86_64 5/7
Installing : zabbix-server-mysql-5.0.1-1.el7.x86_64 6/7
Installing : zabbix-agent-5.0.1-1.el7.x86_64 7/7
WARNING: ipmi_devintf module isn‘t available.
WARNING: ipmi_msghandler module isn‘t available.
Verifying : zabbix-server-mysql-5.0.1-1.el7.x86_64 1/7
Verifying : fping-3.10-1.el7.x86_64 2/7
Verifying : OpenIPMI-2.0.27-1.el7.x86_64 3/7
Verifying : unixODBC-2.3.1-14.el7.x86_64 4/7
Verifying : OpenIPMI-libs-2.0.27-1.el7.x86_64 5/7
Verifying : zabbix-agent-5.0.1-1.el7.x86_64 6/7
Verifying : OpenIPMI-modalias-2.0.27-1.el7.x86_64 7/7

Installed:
zabbix-agent.x86_64 0:5.0.1-1.el7 zabbix-server-mysql.x86_64 0:5.0.1-1.el7

Dependency Installed:
OpenIPMI.x86_64 0:2.0.27-1.el7 OpenIPMI-libs.x86_64 0:2.0.27-1.el7 OpenIPMI-modalias.x86_64 0:2.0.27-1.el7 fping.x86_64 0:3.10-1.el7 unixODBC.x86_64 0:2.3.1-14.el7

Complete!
[root@localhost ~]# yum install centos-release-scl -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package centos-release-scl.noarch 0:2-3.el7.centos will be installed
--> Processing Dependency: centos-release-scl-rh for package: centos-release-scl-2-3.el7.centos.noarch
--> Running transaction check
---> Package centos-release-scl-rh.noarch 0:2-3.el7.centos will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================
Package Arch Version Repository Size

Installing:
centos-release-scl noarch 2-3.el7.centos extras 12 k
Installing for dependencies:
centos-release-scl-rh noarch 2-3.el7.centos extras 12 k

Transaction Summary

Install 1 Package (+1 Dependent package)

Total download size: 24 k
Installed size: 39 k
Downloading packages:
(1/2): centos-release-scl-2-3.el7.centos.noarch.rpm | 12 kB 00:00:00
(2/2): centos-release-scl-rh-2-3.el7.centos.noarch.rpm | 12 kB 00:00:00

Total 151 kB/s | 24 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : centos-release-scl-rh-2-3.el7.centos.noarch 1/2
Installing : centos-release-scl-2-3.el7.centos.noarch 2/2
Verifying : centos-release-scl-2-3.el7.centos.noarch 1/2
Verifying : centos-release-scl-rh-2-3.el7.centos.noarch 2/2

Installed:
centos-release-scl.noarch 0:2-3.el7.centos

Dependency Installed:
centos-release-scl-rh.noarch 0:2-3.el7.centos

Complete!
[root@localhost ~]# gedit /etc/yum.repos.d/zabbix.repo

(gedit:3278): WARNING : 14:19:56.230: Set document metadata failed: Setting attribute metadata::gedit-spell-language not supported

(gedit:3278): WARNING : 14:19:56.230: Set document metadata failed: Setting attribute metadata::gedit-encoding not supported

(gedit:3278): WARNING : 14:19:57.632: Set document metadata failed: Setting attribute metadata::gedit-position not supported
[root@localhost ~]# yum install zabbix-web-mysql-scl zabbix-apache-conf-scl -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile

  • centos-sclo-rh: mirrors.aliyun.com
  • centos-sclo-sclo: mirrors.aliyun.com
    centos-sclo-rh | 3.0 kB 00:00:00
    centos-sclo-sclo | 3.0 kB 00:00:00
    zabbix | 2.9 kB 00:00:00
    zabbix-frontend | 2.9 kB 00:00:00
    zabbix-non-supported | 951 B 00:00:00
    (1/3): centos-sclo-sclo/x86_64/primary_db | 289 kB 00:00:00
    (2/3): zabbix-frontend/x86_64/primary_db | 5.4 kB 00:00:00
    (3/3): centos-sclo-rh/x86_64/primary_db | 2.6 MB 00:00:01
    Resolving Dependencies
    --> Running transaction check
    ---> Package zabbix-apache-conf-scl.noarch 0:5.0.1-1.el7 will be installed
    --> Processing Dependency: httpd for package: zabbix-apache-conf-scl-5.0.1-1.el7.noarch
    ---> Package zabbix-web-mysql-scl.noarch 0:5.0.1-1.el7 will be installed
    --> Processing Dependency: zabbix-web-deps-scl for package: zabbix-web-mysql-scl-5.0.1-1.el7.noarch
    --> Processing Dependency: zabbix-web for package: zabbix-web-mysql-scl-5.0.1-1.el7.noarch
    --> Processing Dependency: rh-php72-php-mysqlnd for package: zabbix-web-mysql-scl-5.0.1-1.el7.noarch
    --> Running transaction check
    ---> Package httpd.x86_64 0:2.4.6-93.el7.centos will be installed
    --> Processing Dependency: httpd-tools = 2.4.6-93.el7.centos for package: httpd-2.4.6-93.el7.centos.x86_64
    --> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-93.el7.centos.x86_64
    ---> Package rh-php72-php-mysqlnd.x86_64 0:7.2.24-1.el7 will be installed
    --> Processing Dependency: rh-php72-php-pdo(x86-64) = 7.2.24-1.el7 for package: rh-php72-php-mysqlnd-7.2.24-1.el7.x86_64
    ---> Package zabbix-web.noarch 0:5.0.1-1.el7 will be installed
    ---> Package zabbix-web-deps-scl.noarch 0:5.0.1-1.el7 will be installed
    --> Processing Dependency: rh-php72-php-mbstring for package: zabbix-web-deps-scl-5.0.1-1.el7.noarch
    --> Processing Dependency: rh-php72-php-xml for package: zabbix-web-deps-scl-5.0.1-1.el7.noarch
    --> Processing Dependency: rh-php72-php-bcmath for package: zabbix-web-deps-scl-5.0.1-1.el7.noarch
    --> Processing Dependency: rh-php72-php-ldap for package: zabbix-web-deps-scl-5.0.1-1.el7.noarch
    --> Processing Dependency: rh-php72-php-fpm for package: zabbix-web-deps-scl-5.0.1-1.el7.noarch
    --> Processing Dependency: rh-php72 for package: zabbix-web-deps-scl-5.0.1-1.el7.noarch
    --> Processing Dependency: rh-php72-php-gd for package: zabbix-web-deps-scl-5.0.1-1.el7.noarch
    --> Running transaction check
    ---> Package httpd-tools.x86_64 0:2.4.6-93.el7.centos will be installed
    ---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
    ---> Package rh-php72.x86_64 0:1-2.el7 will be installed
    --> Processing Dependency: rh-php72-runtime(x86-64) = 1-2.el7 for package: rh-php72-1-2.el7.x86_64
    --> Processing Dependency: rh-php72-runtime for package: rh-php72-1-2.el7.x86_64
    --> Processing Dependency: rh-php72-php-common(x86-64) for package: rh-php72-1-2.el7.x86_64
    --> Processing Dependency: rh-php72-php-cli(x86-64) for package: rh-php72-1-2.el7.x86_64
    --> Processing Dependency: rh-php72-php-pear for package: rh-php72-1-2.el7.x86_64
    ---> Package rh-php72-php-bcmath.x86_64 0:7.2.24-1.el7 will be installed
    ---> Package rh-php72-php-fpm.x86_64 0:7.2.24-1.el7 will be installed
    ---> Package rh-php72-php-gd.x86_64 0:7.2.24-1.el7 will be installed
    ---> Package rh-php72-php-ldap.x86_64 0:7.2.24-1.el7 will be installed
    ---> Package rh-php72-php-mbstring.x86_64 0:7.2.24-1.el7 will be installed
    ---> Package rh-php72-php-pdo.x86_64 0:7.2.24-1.el7 will be installed
    ---> Package rh-php72-php-xml.x86_64 0:7.2.24-1.el7 will be installed
    --> Running transaction check
    ---> Package rh-php72-php-cli.x86_64 0:7.2.24-1.el7 will be installed
    ---> Package rh-php72-php-common.x86_64 0:7.2.24-1.el7 will be installed
    --> Processing Dependency: rh-php72-php-json(x86-64) = 7.2.24-1.el7 for package: rh-php72-php-common-7.2.24-1.el7.x86_64
    --> Processing Dependency: rh-php72-php-zip(x86-64) = 7.2.24-1.el7 for package: rh-php72-php-common-7.2.24-1.el7.x86_64
    ---> Package rh-php72-php-pear.noarch 1:1.10.5-1.el7 will be installed
    --> Processing Dependency: rh-php72-php-posix for package: 1:rh-php72-php-pear-1.10.5-1.el7.noarch
    ---> Package rh-php72-runtime.x86_64 0:1-2.el7 will be installed
    --> Running transaction check
    ---> Package rh-php72-php-json.x86_64 0:7.2.24-1.el7 will be installed
    ---> Package rh-php72-php-process.x86_64 0:7.2.24-1.el7 will be installed
    ---> Package rh-php72-php-zip.x86_64 0:7.2.24-1.el7 will be installed
    --> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================
Package Arch Version Repository Size

Installing:
zabbix-apache-conf-scl noarch 5.0.1-1.el7 zabbix-frontend 13 k
zabbix-web-mysql-scl noarch 5.0.1-1.el7 zabbix-frontend 12 k
Installing for dependencies:
httpd x86_64 2.4.6-93.el7.centos base 2.7 M
httpd-tools x86_64 2.4.6-93.el7.centos base 92 k
mailcap noarch 2.1.41-2.el7 base 31 k
rh-php72 x86_64 1-2.el7 centos-sclo-rh 4.3 k
rh-php72-php-bcmath x86_64 7.2.24-1.el7 centos-sclo-rh 60 k
rh-php72-php-cli x86_64 7.2.24-1.el7 centos-sclo-rh 2.9 M
rh-php72-php-common x86_64 7.2.24-1.el7 centos-sclo-rh 680 k
rh-php72-php-fpm x86_64 7.2.24-1.el7 centos-sclo-rh 1.5 M
rh-php72-php-gd x86_64 7.2.24-1.el7 centos-sclo-rh 151 k
rh-php72-php-json x86_64 7.2.24-1.el7 centos-sclo-rh 54 k
rh-php72-php-ldap x86_64 7.2.24-1.el7 centos-sclo-rh 59 k
rh-php72-php-mbstring x86_64 7.2.24-1.el7 centos-sclo-rh 553 k
rh-php72-php-mysqlnd x86_64 7.2.24-1.el7 centos-sclo-rh 166 k
rh-php72-php-pdo x86_64 7.2.24-1.el7 centos-sclo-rh 101 k
rh-php72-php-pear noarch 1:1.10.5-1.el7 centos-sclo-rh 357 k
rh-php72-php-process x86_64 7.2.24-1.el7 centos-sclo-rh 62 k
rh-php72-php-xml x86_64 7.2.24-1.el7 centos-sclo-rh 160 k
rh-php72-php-zip x86_64 7.2.24-1.el7 centos-sclo-rh 90 k
rh-php72-runtime x86_64 1-2.el7 centos-sclo-rh 1.1 M
zabbix-web noarch 5.0.1-1.el7 zabbix-frontend 3.1 M
zabbix-web-deps-scl noarch 5.0.1-1.el7 zabbix-frontend 13 k

Transaction Summary

Install 2 Packages (+21 Dependent packages)

Total download size: 14 M
Installed size: 53 M
Downloading packages:
(1/23): httpd-tools-2.4.6-93.el7.centos.x86_64.rpm | 92 kB 00:00:00
(2/23): mailcap-2.1.41-2.el7.noarch.rpm | 31 kB 00:00:00
warning: /var/cache/yum/x86_64/7/centos-sclo-rh/packages/rh-php72-1-2.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f2ee9d55: NOKEY0 B/s | 519 kB --:--:-- ETA
Public key for rh-php72-1-2.el7.x86_64.rpm is not installed
(3/23): rh-php72-1-2.el7.x86_64.rpm | 4.3 kB 00:00:00
(4/23): rh-php72-php-bcmath-7.2.24-1.el7.x86_64.rpm | 60 kB 00:00:00
(5/23): rh-php72-php-gd-7.2.24-1.el7.x86_64.rpm | 151 kB 00:00:00
(6/23): rh-php72-php-json-7.2.24-1.el7.x86_64.rpm | 54 kB 00:00:00
(7/23): rh-php72-php-ldap-7.2.24-1.el7.x86_64.rpm | 59 kB 00:00:00
(8/23): rh-php72-php-common-7.2.24-1.el7.x86_64.rpm | 680 kB 00:00:00
(9/23): rh-php72-php-mysqlnd-7.2.24-1.el7.x86_64.rpm | 166 kB 00:00:00
(10/23): rh-php72-php-mbstring-7.2.24-1.el7.x86_64.rpm | 553 kB 00:00:00
(11/23): rh-php72-php-pdo-7.2.24-1.el7.x86_64.rpm | 101 kB 00:00:00
(12/23): rh-php72-php-process-7.2.24-1.el7.x86_64.rpm | 62 kB 00:00:00
(13/23): rh-php72-php-pear-1.10.5-1.el7.noarch.rpm | 357 kB 00:00:00
(14/23): rh-php72-php-xml-7.2.24-1.el7.x86_64.rpm | 160 kB 00:00:00
(15/23): rh-php72-php-zip-7.2.24-1.el7.x86_64.rpm | 90 kB 00:00:00
(16/23): rh-php72-php-fpm-7.2.24-1.el7.x86_64.rpm | 1.5 MB 00:00:01
(17/23): zabbix-apache-conf-scl-5.0.1-1.el7.noarch.rpm | 13 kB 00:00:00
(18/23): zabbix-web-deps-scl-5.0.1-1.el7.noarch.rpm | 13 kB 00:00:00
(19/23): zabbix-web-mysql-scl-5.0.1-1.el7.noarch.rpm | 12 kB 00:00:00
(20/23): rh-php72-runtime-1-2.el7.x86_64.rpm | 1.1 MB 00:00:00
(21/23): httpd-2.4.6-93.el7.centos.x86_64.rpm | 2.7 MB 00:00:02
(22/23): zabbix-web-5.0.1-1.el7.noarch.rpm | 3.1 MB 00:00:01
(23/23): rh-php72-php-cli-7.2.24-1.el7.x86_64.rpm | 2.9 MB 00:00:04

Total 3.0 MB/s | 14 MB 00:00:04
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
Importing GPG key 0xF2EE9D55:
Userid : "CentOS SoftwareCollections SIG (https://wiki.centos.org/SpecialInterestGroup/SCLo) <security@centos.org>"
Fingerprint: c4db d535 b1fb ba14 f8ba 64a8 4eb8 4e71 f2ee 9d55
Package : centos-release-scl-rh-2-3.el7.centos.noarch (@extras)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : rh-php72-runtime-1-2.el7.x86_64 1/23
Installing : rh-php72-php-zip-7.2.24-1.el7.x86_64 2/23
Installing : rh-php72-php-json-7.2.24-1.el7.x86_64 3/23
Installing : rh-php72-php-common-7.2.24-1.el7.x86_64 4/23
Installing : rh-php72-php-xml-7.2.24-1.el7.x86_64 5/23
Installing : rh-php72-php-cli-7.2.24-1.el7.x86_64 6/23
Installing : rh-php72-php-fpm-7.2.24-1.el7.x86_64 7/23
Installing : rh-php72-php-bcmath-7.2.24-1.el7.x86_64 8/23
Installing : rh-php72-php-gd-7.2.24-1.el7.x86_64 9/23
Installing : rh-php72-php-process-7.2.24-1.el7.x86_64 10/23
Installing : 1:rh-php72-php-pear-1.10.5-1.el7.noarch 11/23
Installing : rh-php72-1-2.el7.x86_64 12/23
Installing : rh-php72-php-pdo-7.2.24-1.el7.x86_64 13/23
Installing : rh-php72-php-mysqlnd-7.2.24-1.el7.x86_64 14/23
Installing : rh-php72-php-ldap-7.2.24-1.el7.x86_64 15/23
Installing : rh-php72-php-mbstring-7.2.24-1.el7.x86_64 16/23
Installing : zabbix-web-deps-scl-5.0.1-1.el7.noarch 17/23
Installing : httpd-tools-2.4.6-93.el7.centos.x86_64 18/23
Installing : zabbix-web-5.0.1-1.el7.noarch 19/23
Installing : zabbix-web-mysql-scl-5.0.1-1.el7.noarch 20/23
Installing : mailcap-2.1.41-2.el7.noarch 21/23
Installing : httpd-2.4.6-93.el7.centos.x86_64 22/23
Installing : zabbix-apache-conf-scl-5.0.1-1.el7.noarch 23/23
Verifying : rh-php72-php-xml-7.2.24-1.el7.x86_64 1/23
Verifying : mailcap-2.1.41-2.el7.noarch 2/23
Verifying : httpd-2.4.6-93.el7.centos.x86_64 3/23
Verifying : rh-php72-php-fpm-7.2.24-1.el7.x86_64 4/23
Verifying : zabbix-web-mysql-scl-5.0.1-1.el7.noarch 5/23
Verifying : rh-php72-runtime-1-2.el7.x86_64 6/23
Verifying : rh-php72-php-common-7.2.24-1.el7.x86_64 7/23
Verifying : rh-php72-php-zip-7.2.24-1.el7.x86_64 8/23
Verifying : zabbix-web-5.0.1-1.el7.noarch 9/23
Verifying : rh-php72-php-bcmath-7.2.24-1.el7.x86_64 10/23
Verifying : rh-php72-php-gd-7.2.24-1.el7.x86_64 11/23
Verifying : zabbix-web-deps-scl-5.0.1-1.el7.noarch 12/23
Verifying : zabbix-apache-conf-scl-5.0.1-1.el7.noarch 13/23
Verifying : rh-php72-php-json-7.2.24-1.el7.x86_64 14/23
Verifying : rh-php72-php-process-7.2.24-1.el7.x86_64 15/23
Verifying : rh-php72-php-pdo-7.2.24-1.el7.x86_64 16/23
Verifying : httpd-tools-2.4.6-93.el7.centos.x86_64 17/23
Verifying : rh-php72-php-ldap-7.2.24-1.el7.x86_64 18/23
Verifying : rh-php72-php-mysqlnd-7.2.24-1.el7.x86_64 19/23
Verifying : rh-php72-php-mbstring-7.2.24-1.el7.x86_64 20/23
Verifying : 1:rh-php72-php-pear-1.10.5-1.el7.noarch 21/23
Verifying : rh-php72-1-2.el7.x86_64 22/23
Verifying : rh-php72-php-cli-7.2.24-1.el7.x86_64 23/23

Installed:
zabbix-apache-conf-scl.noarch 0:5.0.1-1.el7 zabbix-web-mysql-scl.noarch 0:5.0.1-1.el7

Dependency Installed:
httpd.x86_64 0:2.4.6-93.el7.centos httpd-tools.x86_64 0:2.4.6-93.el7.centos mailcap.noarch 0:2.1.41-2.el7
rh-php72.x86_64 0:1-2.el7 rh-php72-php-bcmath.x86_64 0:7.2.24-1.el7 rh-php72-php-cli.x86_64 0:7.2.24-1.el7
rh-php72-php-common.x86_64 0:7.2.24-1.el7 rh-php72-php-fpm.x86_64 0:7.2.24-1.el7 rh-php72-php-gd.x86_64 0:7.2.24-1.el7
rh-php72-php-json.x86_64 0:7.2.24-1.el7 rh-php72-php-ldap.x86_64 0:7.2.24-1.el7 rh-php72-php-mbstring.x86_64 0:7.2.24-1.el7
rh-php72-php-mysqlnd.x86_64 0:7.2.24-1.el7 rh-php72-php-pdo.x86_64 0:7.2.24-1.el7 rh-php72-php-pear.noarch 1:1.10.5-1.el7
rh-php72-php-process.x86_64 0:7.2.24-1.el7 rh-php72-php-xml.x86_64 0:7.2.24-1.el7 rh-php72-php-zip.x86_64 0:7.2.24-1.el7
rh-php72-runtime.x86_64 0:1-2.el7 zabbix-web.noarch 0:5.0.1-1.el7 zabbix-web-deps-scl.noarch 0:5.0.1-1.el7

Complete!
[root@localhost ~]# yum install mariadb-server -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile

  • centos-sclo-rh: mirrors.163.com
  • centos-sclo-sclo: mirrors.cn99.com
    Resolving Dependencies
    --> Running transaction check
    ---> Package mariadb-server.x86_64 1:5.5.65-1.el7 will be installed
    --> Processing Dependency: mariadb(x86-64) = 1:5.5.65-1.el7 for package: 1:mariadb-server-5.5.65-1.el7.x86_64
    --> Processing Dependency: perl-DBI for package: 1:mariadb-server-5.5.65-1.el7.x86_64
    --> Processing Dependency: perl-DBD-MySQL for package: 1:mariadb-server-5.5.65-1.el7.x86_64
    --> Processing Dependency: perl(DBI) for package: 1:mariadb-server-5.5.65-1.el7.x86_64
    --> Running transaction check
    ---> Package mariadb.x86_64 1:5.5.65-1.el7 will be installed
    ---> Package perl-DBD-MySQL.x86_64 0:4.023-6.el7 will be installed
    ---> Package perl-DBI.x86_64 0:1.627-4.el7 will be installed
    --> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.el7.x86_64
    --> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.el7.x86_64
    --> Running transaction check
    ---> Package perl-PlRPC.noarch 0:0.2020-14.el7 will be installed
    --> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.el7.noarch
    --> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.el7.noarch
    --> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch
    --> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch
    --> Running transaction check
    ---> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed
    --> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
    --> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
    ---> Package perl-Net-Daemon.noarch 0:0.48-5.el7 will be installed
    --> Running transaction check
    ---> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed
    ---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed
    --> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================
Package Arch Version Repository Size

Installing:
mariadb-server x86_64 1:5.5.65-1.el7 base 11 M
Installing for dependencies:
mariadb x86_64 1:5.5.65-1.el7 base 8.7 M
perl-Compress-Raw-Bzip2 x86_64 2.061-3.el7 base 32 k
perl-Compress-Raw-Zlib x86_64 1:2.061-4.el7 base 57 k
perl-DBD-MySQL x86_64 4.023-6.el7 base 140 k
perl-DBI x86_64 1.627-4.el7 base 802 k
perl-IO-Compress noarch 2.061-2.el7 base 260 k
perl-Net-Daemon noarch 0.48-5.el7 base 51 k
perl-PlRPC noarch 0.2020-14.el7 base 36 k

Transaction Summary

Install 1 Package (+8 Dependent packages)

Total download size: 21 M
Installed size: 110 M
Downloading packages:
(1/9): mariadb-5.5.65-1.el7.x86_64.rpm | 8.7 MB 00:00:05
(2/9): perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm | 32 kB 00:00:00
(3/9): perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm | 57 kB 00:00:00
(4/9): perl-DBD-MySQL-4.023-6.el7.x86_64.rpm | 140 kB 00:00:00
(5/9): mariadb-server-5.5.65-1.el7.x86_64.rpm | 11 MB 00:00:06
(6/9): perl-IO-Compress-2.061-2.el7.noarch.rpm | 260 kB 00:00:00
(7/9): perl-Net-Daemon-0.48-5.el7.noarch.rpm | 51 kB 00:00:00
(8/9): perl-DBI-1.627-4.el7.x86_64.rpm | 802 kB 00:00:00
(9/9): perl-PlRPC-0.2020-14.el7.noarch.rpm | 36 kB 00:00:00

Total 3.2 MB/s | 21 MB 00:00:06
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:mariadb-5.5.65-1.el7.x86_64 1/9
Installing : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 2/9
Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 3/9
Installing : perl-IO-Compress-2.061-2.el7.noarch 4/9
Installing : perl-Net-Daemon-0.48-5.el7.noarch 5/9
Installing : perl-PlRPC-0.2020-14.el7.noarch 6/9
Installing : perl-DBI-1.627-4.el7.x86_64 7/9
Installing : perl-DBD-MySQL-4.023-6.el7.x86_64 8/9
Installing : 1:mariadb-server-5.5.65-1.el7.x86_64 9/9
Verifying : 1:mariadb-server-5.5.65-1.el7.x86_64 1/9
Verifying : perl-Net-Daemon-0.48-5.el7.noarch 2/9
Verifying : perl-DBD-MySQL-4.023-6.el7.x86_64 3/9
Verifying : perl-IO-Compress-2.061-2.el7.noarch 4/9
Verifying : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 5/9
Verifying : perl-DBI-1.627-4.el7.x86_64 6/9
Verifying : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 7/9
Verifying : perl-PlRPC-0.2020-14.el7.noarch 8/9
Verifying : 1:mariadb-5.5.65-1.el7.x86_64 9/9

Installed:
mariadb-server.x86_64 1:5.5.65-1.el7

Dependency Installed:
mariadb.x86_64 1:5.5.65-1.el7 perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 perl-DBD-MySQL.x86_64 0:4.023-6.el7
perl-DBI.x86_64 0:1.627-4.el7 perl-IO-Compress.noarch 0:2.061-2.el7 perl-Net-Daemon.noarch 0:0.48-5.el7 perl-PlRPC.noarch 0:0.2020-14.el7

Complete!
[root@localhost ~]# systemctl enable --now mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
[root@localhost ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we‘ll need the current
password for the root user. If you‘ve just installed MariaDB, and
you haven‘t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n]
... Success!

Normally, root should only be allowed to connect from ‘localhost‘. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]
... Success!

By default, MariaDB comes with a database named ‘test‘ that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n]

  • Dropping test database...
    ... Success!
  • Removing privileges on test database...
    ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n]
... Success!

Cleaning up...

All done! If you‘ve completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[root@localhost ~]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or g.
Your MariaDB connection id is 10
Server version: 5.5.65-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;‘ or ‘h‘ for help. Type ‘c‘ to clear the current input statement.

MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> create user zabbix@localhost identified by ‘password‘;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> quit;
Bye
[root@localhost ~]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
Enter password:
[root@localhost ~]# gedit /etc/zabbix/zabbix_server.conf

(gedit:3934): WARNING : 14:24:38.546: Set document metadata failed: Setting attribute metadata::gedit-spell-language not supported

(gedit:3934): WARNING : 14:24:38.551: Set document metadata failed: Setting attribute metadata::gedit-encoding not supported

(gedit:3934): WARNING : 14:24:39.840: Set document metadata failed: Setting attribute metadata::gedit-position not supported
[root@localhost ~]# gedit /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf

(gedit:3954): WARNING : 14:25:08.954: Set document metadata failed: Setting attribute metadata::gedit-spell-language not supported

(gedit:3954): WARNING : 14:25:08.955: Set document metadata failed: Setting attribute metadata::gedit-encoding not supported

(gedit:3954): WARNING : 14:25:10.519: Set document metadata failed: Setting attribute metadata::gedit-position not supported
[root@localhost ~]# systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm

以下是Web安装配置界面:

技术图片

孟伯,20200531

交流联系:微信 1807479153 ,QQ 1807479153

以上是关于CentOS 7 二进制安装Zabbix 5.0 LTS的主要内容,如果未能解决你的问题,请参考以下文章

CentOS 7 源码安装Zabbix 5.0 LTS

CentOS 7 源码安装Zabbix 5.0 LTS

centos7安装zabbix5.0

Ubuntu16.04.7LTS 安装zabbix-agent5.0

Centos7.5安装mysql5.7.24二进制包方式部署(主从复制)

使用 Zabbix 监控私有信息-邮件报警