##############################
1、安装zabbix仓库
##############################
[root@test ~]# rpm -Uvh https://repo.zabbix.com/zabbix/6.2/rhel/8/x86_64/zabbix-release-6.2-3.el8.noarch.rpm
Retrieving https://repo.zabbix.com/zabbix/6.2/rhel/8/x86_64/zabbix-release-6.2-3.el8.noarch.rpm
warning: /var/tmp/rpm-tmp.xfG0Ii: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:zabbix-release-6.2-3.el8 ################################# [100%]
[root@test ~]#
1:zabbix-release-6.2-3.el8 ################################# [100%]
[root@test ~]# dnf clean all
28 files removed
[root@test ~]#
##############################
2、切换PHP的DNF模块版本
##############################
[root@test ~]# dnf module switch-to php:7.4
CentOS-8.5.2111 - Base - mirrors.cloud.aliyuncs.com 11 MB/s | 4.6 MB 00:00
CentOS-8.5.2111 - Extras - mirrors.cloud.aliyuncs.com 85 kB/s | 10 kB 00:00
CentOS-8.5.2111 - AppStream - mirrors.cloud.aliyuncs.com 31 MB/s | 8.4 MB 00:00
Extra Packages for Enterprise Linux 8 - x86_64 38 MB/s | 6.4 MB 00:00
Zabbix Official Repository (Agent2 Plugins) - x86_64 1.2 kB/s | 1.7 kB 00:01
Zabbix Official Repository - x86_64 78 kB/s | 137 kB 00:01
Zabbix Official Repository (non-supported) - x86_64 945 B/s | 1.2 kB 00:01
Dependencies resolved.
====================================================================================================================================================================
Package Architecture Version Repository Size
====================================================================================================================================================================
Enabling module streams:
httpd 2.4
nginx 1.14
php 7.4
Transaction Summary
====================================================================================================================================================================
Is this ok [y/N]: Y
Complete!
[root@test ~]#
############################################################
3、安装Zabbix的服务端(Server)和Web前端(Frontend)以及数据收集端(Agent)
############################################################
[root@test ~]# dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
Last metadata expiration check: 0:01:41 ago on Thu 30 Nov 2023 01:42:30 PM CST.
Dependencies resolved.
====================================================================================================================================================================
Package Architecture Version Repository Size
====================================================================================================================================================================
Installing:
zabbix-agent x86_64 6.2.9-release1.el8 zabbix 561 k
zabbix-apache-conf noarch 6.2.9-release1.el8 zabbix 25 k
zabbix-selinux-policy x86_64 6.2.9-release1.el8 zabbix 299 k
zabbix-server-mysql x86_64 6.2.9-release1.el8 zabbix 1.8 M
zabbix-sql-scripts noarch 6.2.9-release1.el8 zabbix 7.3 M
zabbix-web-mysql noarch 6.2.9-release1.el8 zabbix 24 k
Installing dependencies:
OpenIPMI-libs x86_64 2.0.31-3.el8 base 509 k
apr x86_64 1.6.3-12.el8 AppStream 129 k
apr-util x86_64 1.6.1-6.el8 AppStream 105 k
centos-logos-httpd noarch 85.8-2.el8 base 75 k
dejavu-sans-fonts noarch 2.35-7.el8 base 1.6 M
fping x86_64 4.2-2.el8 epel-archive 43 k
gd x86_64 2.2.5-7.el8 AppStream 144 k
httpd x86_64 2.4.37-43.module_el8.5.0+1022+b541f3b1 AppStream 1.4 M
httpd-filesystem noarch 2.4.37-43.module_el8.5.0+1022+b541f3b1 AppStream 39 k
httpd-tools x86_64 2.4.37-43.module_el8.5.0+1022+b541f3b1 AppStream 107 k
jbigkit-libs x86_64 2.1-14.el8 AppStream 55 k
libXpm x86_64 3.5.12-8.el8 AppStream 58 k
libjpeg-turbo x86_64 1.5.3-12.el8 AppStream 157 k
libtiff x86_64 4.0.9-20.el8 AppStream 188 k
libtool-ltdl x86_64 2.4.6-25.el8 base 58 k
libwebp x86_64 1.0.0-5.el8 AppStream 272 k
mariadb-connector-c x86_64 3.1.11-2.el8_3 AppStream 200 k
mariadb-connector-c-config noarch 3.1.11-2.el8_3 AppStream 15 k
mod_http2 x86_64 1.15.7-3.module_el8.4.0+778+c970deab AppStream 154 k
net-snmp-libs x86_64 1:5.8-22.el8 base 827 k
nginx-filesystem noarch 1:1.14.1-9.module_el8.0.0+184+e34fea82 AppStream 24 k
php-bcmath x86_64 7.4.19-1.module_el8.5.0+815+1c4fd2e5 AppStream 80 k
php-common x86_64 7.4.19-1.module_el8.5.0+815+1c4fd2e5 AppStream 702 k
php-fpm x86_64 7.4.19-1.module_el8.5.0+815+1c4fd2e5 AppStream 1.6 M
php-gd x86_64 7.4.19-1.module_el8.5.0+815+1c4fd2e5 AppStream 85 k
php-json x86_64 7.4.19-1.module_el8.5.0+815+1c4fd2e5 AppStream 74 k
php-ldap x86_64 7.4.19-1.module_el8.5.0+815+1c4fd2e5 AppStream 86 k
php-mbstring x86_64 7.4.19-1.module_el8.5.0+815+1c4fd2e5 AppStream 484 k
php-mysqlnd x86_64 7.4.19-1.module_el8.5.0+815+1c4fd2e5 AppStream 193 k
php-pdo x86_64 7.4.19-1.module_el8.5.0+815+1c4fd2e5 AppStream 123 k
php-xml x86_64 7.4.19-1.module_el8.5.0+815+1c4fd2e5 AppStream 174 k
unixODBC x86_64 2.3.7-1.el8 AppStream 458 k
zabbix-web noarch 6.2.9-release1.el8 zabbix 8.2 M
zabbix-web-deps noarch 6.2.9-release1.el8 zabbix 25 k
Installing weak dependencies:
apr-util-bdb x86_64 1.6.1-6.el8 AppStream 25 k
apr-util-openssl x86_64 1.6.1-6.el8 AppStream 27 k
Transaction Summary
====================================================================================================================================================================
Install 42 Packages
Total download size: 28 M
Installed size: 91 M
Is this ok [y/N]: y
Downloading Packages:
(1/42): centos-logos-httpd-85.8-2.el8.noarch.rpm 1.9 MB/s | 75 kB 00:00
(2/42): libtool-ltdl-2.4.6-25.el8.x86_64.rpm 7.0 MB/s | 58 kB 00:00
(3/42): dejavu-sans-fonts-2.35-7.el8.noarch.rpm 19 MB/s | 1.6 MB 00:00
(4/42): apr-1.6.3-12.el8.x86_64.rpm 25 MB/s | 129 kB 00:00
(5/42): apr-util-1.6.1-6.el8.x86_64.rpm 4.8 MB/s | 105 kB 00:00
(6/42): net-snmp-libs-5.8-22.el8.x86_64.rpm 9.2 MB/s | 827 kB 00:00
(7/42): apr-util-bdb-1.6.1-6.el8.x86_64.rpm 893 kB/s | 25 kB 00:00
(8/42): gd-2.2.5-7.el8.x86_64.rpm 31 MB/s | 144 kB 00:00
(9/42): apr-util-openssl-1.6.1-6.el8.x86_64.rpm 984 kB/s | 27 kB 00:00
(10/42): OpenIPMI-libs-2.0.31-3.el8.x86_64.rpm 2.5 MB/s | 509 kB 00:00
(11/42): httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64.rpm 20 MB/s | 1.4 MB 00:00
(12/42): httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch.rpm 667 kB/s | 39 kB 00:00
(13/42): httpd-tools-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64.rpm 2.6 MB/s | 107 kB 00:00
(14/42): jbigkit-libs-2.1-14.el8.x86_64.rpm 1.0 MB/s | 55 kB 00:00
(15/42): libtiff-4.0.9-20.el8.x86_64.rpm 35 MB/s | 188 kB 00:00
(16/42): libjpeg-turbo-1.5.3-12.el8.x86_64.rpm 4.3 MB/s | 157 kB 00:00
(17/42): libwebp-1.0.0-5.el8.x86_64.rpm 24 MB/s | 272 kB 00:00
(18/42): libXpm-3.5.12-8.el8.x86_64.rpm 929 kB/s | 58 kB 00:00
(19/42): mod_http2-1.15.7-3.module_el8.4.0+778+c970deab.x86_64.rpm 5.4 MB/s | 154 kB 00:00
(20/42): mariadb-connector-c-3.1.11-2.el8_3.x86_64.rpm 4.1 MB/s | 200 kB 00:00
(21/42): mariadb-connector-c-config-3.1.11-2.el8_3.noarch.rpm 359 kB/s | 15 kB 00:00
(22/42): nginx-filesystem-1.14.1-9.module_el8.0.0+184+e34fea82.noarch.rpm 522 kB/s | 24 kB 00:00
(23/42): php-bcmath-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64.rpm 644 kB/s | 80 kB 00:00
(24/42): php-fpm-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64.rpm 17 MB/s | 1.6 MB 00:00
(25/42): php-common-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64.rpm 4.4 MB/s | 702 kB 00:00
(26/42): php-ldap-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64.rpm 1.1 MB/s | 86 kB 00:00
(27/42): php-gd-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64.rpm 717 kB/s | 85 kB 00:00
(28/42): php-json-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64.rpm 532 kB/s | 74 kB 00:00
(29/42): php-pdo-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64.rpm 5.1 MB/s | 123 kB 00:00
(30/42): php-xml-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64.rpm 5.8 MB/s | 174 kB 00:00
(31/42): php-mysqlnd-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64.rpm 1.8 MB/s | 193 kB 00:00
(32/42): php-mbstring-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64.rpm 3.9 MB/s | 484 kB 00:00
(33/42): unixODBC-2.3.7-1.el8.x86_64.rpm 12 MB/s | 458 kB 00:00
(34/42): fping-4.2-2.el8.x86_64.rpm 303 kB/s | 43 kB 00:00
(35/42): zabbix-agent-6.2.9-release1.el8.x86_64.rpm 450 kB/s | 561 kB 00:01
(36/42): zabbix-server-mysql-6.2.9-release1.el8.x86_64.rpm 4.2 MB/s | 1.8 MB 00:00
(37/42): zabbix-apache-conf-6.2.9-release1.el8.noarch.rpm 13 kB/s | 25 kB 00:01
(38/42): zabbix-selinux-policy-6.2.9-release1.el8.x86_64.rpm 156 kB/s | 299 kB 00:01
(39/42): zabbix-sql-scripts-6.2.9-release1.el8.noarch.rpm 16 MB/s | 7.3 MB 00:00
(40/42): zabbix-web-deps-6.2.9-release1.el8.noarch.rpm 182 kB/s | 25 kB 00:00
(41/42): zabbix-web-mysql-6.2.9-release1.el8.noarch.rpm 170 kB/s | 24 kB 00:00
(42/42): zabbix-web-6.2.9-release1.el8.noarch.rpm 321 kB/s | 8.2 MB 00:26
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 1.0 MB/s | 28 MB 00:28
warning: /var/cache/dnf/zabbix-ec9d61101606006d/packages/zabbix-agent-6.2.9-release1.el8.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY
Zabbix Official Repository - x86_64 1.6 MB/s | 1.7 kB 00:00
Importing GPG key 0xA14FE591:
Userid : "Zabbix LLC <[email protected]>"
Fingerprint: A184 8F53 52D0 22B9 471D 83D0 082A B56B A14F E591
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : php-common-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 1/42
Installing : apr-1.6.3-12.el8.x86_64 2/42
Running scriptlet: apr-1.6.3-12.el8.x86_64 2/42
Installing : apr-util-bdb-1.6.1-6.el8.x86_64 3/42
Installing : apr-util-openssl-1.6.1-6.el8.x86_64 4/42
Installing : apr-util-1.6.1-6.el8.x86_64 5/42
Running scriptlet: apr-util-1.6.1-6.el8.x86_64 5/42
Installing : libjpeg-turbo-1.5.3-12.el8.x86_64 6/42
Running scriptlet: httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch 7/42
Installing : httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch 7/42
Installing : net-snmp-libs-1:5.8-22.el8.x86_64 8/42
Installing : OpenIPMI-libs-2.0.31-3.el8.x86_64 9/42
Installing : httpd-tools-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 10/42
Installing : php-bcmath-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 11/42
Installing : php-json-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 12/42
Installing : php-ldap-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 13/42
Installing : php-mbstring-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 14/42
Installing : php-pdo-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 15/42
Installing : php-mysqlnd-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 16/42
Installing : php-xml-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 17/42
Installing : fping-4.2-2.el8.x86_64 18/42
Running scriptlet: nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34fea82.noarch 19/42
Installing : nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34fea82.noarch 19/42
Installing : php-fpm-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 20/42
Running scriptlet: php-fpm-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 20/42
Installing : mariadb-connector-c-config-3.1.11-2.el8_3.noarch 21/42
Installing : mariadb-connector-c-3.1.11-2.el8_3.x86_64 22/42
Installing : libwebp-1.0.0-5.el8.x86_64 23/42
Installing : libXpm-3.5.12-8.el8.x86_64 24/42
Installing : jbigkit-libs-2.1-14.el8.x86_64 25/42
Running scriptlet: jbigkit-libs-2.1-14.el8.x86_64 25/42
Installing : libtiff-4.0.9-20.el8.x86_64 26/42
Installing : gd-2.2.5-7.el8.x86_64 27/42
Running scriptlet: gd-2.2.5-7.el8.x86_64 27/42
Installing : php-gd-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 28/42
Installing : libtool-ltdl-2.4.6-25.el8.x86_64 29/42
Running scriptlet: libtool-ltdl-2.4.6-25.el8.x86_64 29/42
Installing : unixODBC-2.3.7-1.el8.x86_64 30/42
Running scriptlet: unixODBC-2.3.7-1.el8.x86_64 30/42
Installing : dejavu-sans-fonts-2.35-7.el8.noarch 31/42
Installing : zabbix-web-6.2.9-release1.el8.noarch 32/42
Running scriptlet: zabbix-web-6.2.9-release1.el8.noarch 32/42
Installing : zabbix-web-deps-6.2.9-release1.el8.noarch 33/42
Installing : zabbix-web-mysql-6.2.9-release1.el8.noarch 34/42
Installing : centos-logos-httpd-85.8-2.el8.noarch 35/42
Installing : mod_http2-1.15.7-3.module_el8.4.0+778+c970deab.x86_64 36/42
Installing : httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 37/42
Running scriptlet: httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 37/42
Installing : zabbix-apache-conf-6.2.9-release1.el8.noarch 38/42
Running scriptlet: zabbix-apache-conf-6.2.9-release1.el8.noarch 38/42
Running scriptlet: zabbix-server-mysql-6.2.9-release1.el8.x86_64 39/42
Installing : zabbix-server-mysql-6.2.9-release1.el8.x86_64 39/42
Running scriptlet: zabbix-server-mysql-6.2.9-release1.el8.x86_64 39/42
Installing : zabbix-sql-scripts-6.2.9-release1.el8.noarch 40/42
Installing : zabbix-selinux-policy-6.2.9-release1.el8.x86_64 41/42
Running scriptlet: zabbix-selinux-policy-6.2.9-release1.el8.x86_64 41/42
Running scriptlet: zabbix-agent-6.2.9-release1.el8.x86_64 42/42
Installing : zabbix-agent-6.2.9-release1.el8.x86_64 42/42
Running scriptlet: zabbix-agent-6.2.9-release1.el8.x86_64 42/42
Running scriptlet: httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 42/42
Running scriptlet: zabbix-agent-6.2.9-release1.el8.x86_64 42/42
Running scriptlet: php-fpm-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 42/42
Verifying : OpenIPMI-libs-2.0.31-3.el8.x86_64 1/42
Verifying : centos-logos-httpd-85.8-2.el8.noarch 2/42
Verifying : dejavu-sans-fonts-2.35-7.el8.noarch 3/42
Verifying : libtool-ltdl-2.4.6-25.el8.x86_64 4/42
Verifying : net-snmp-libs-1:5.8-22.el8.x86_64 5/42
Verifying : apr-1.6.3-12.el8.x86_64 6/42
Verifying : apr-util-1.6.1-6.el8.x86_64 7/42
Verifying : apr-util-bdb-1.6.1-6.el8.x86_64 8/42
Verifying : apr-util-openssl-1.6.1-6.el8.x86_64 9/42
Verifying : gd-2.2.5-7.el8.x86_64 10/42
Verifying : httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 11/42
Verifying : httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch 12/42
Verifying : httpd-tools-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 13/42
Verifying : jbigkit-libs-2.1-14.el8.x86_64 14/42
Verifying : libXpm-3.5.12-8.el8.x86_64 15/42
Verifying : libjpeg-turbo-1.5.3-12.el8.x86_64 16/42
Verifying : libtiff-4.0.9-20.el8.x86_64 17/42
Verifying : libwebp-1.0.0-5.el8.x86_64 18/42
Verifying : mariadb-connector-c-3.1.11-2.el8_3.x86_64 19/42
Verifying : mariadb-connector-c-config-3.1.11-2.el8_3.noarch 20/42
Verifying : mod_http2-1.15.7-3.module_el8.4.0+778+c970deab.x86_64 21/42
Verifying : nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34fea82.noarch 22/42
Verifying : php-bcmath-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 23/42
Verifying : php-common-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 24/42
Verifying : php-fpm-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 25/42
Verifying : php-gd-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 26/42
Verifying : php-json-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 27/42
Verifying : php-ldap-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 28/42
Verifying : php-mbstring-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 29/42
Verifying : php-mysqlnd-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 30/42
Verifying : php-pdo-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 31/42
Verifying : php-xml-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 32/42
Verifying : unixODBC-2.3.7-1.el8.x86_64 33/42
Verifying : fping-4.2-2.el8.x86_64 34/42
Verifying : zabbix-agent-6.2.9-release1.el8.x86_64 35/42
Verifying : zabbix-apache-conf-6.2.9-release1.el8.noarch 36/42
Verifying : zabbix-selinux-policy-6.2.9-release1.el8.x86_64 37/42
Verifying : zabbix-server-mysql-6.2.9-release1.el8.x86_64 38/42
Verifying : zabbix-sql-scripts-6.2.9-release1.el8.noarch 39/42
Verifying : zabbix-web-6.2.9-release1.el8.noarch 40/42
Verifying : zabbix-web-deps-6.2.9-release1.el8.noarch 41/42
Verifying : zabbix-web-mysql-6.2.9-release1.el8.noarch 42/42
Installed:
OpenIPMI-libs-2.0.31-3.el8.x86_64 apr-1.6.3-12.el8.x86_64
apr-util-1.6.1-6.el8.x86_64 apr-util-bdb-1.6.1-6.el8.x86_64
apr-util-openssl-1.6.1-6.el8.x86_64 centos-logos-httpd-85.8-2.el8.noarch
dejavu-sans-fonts-2.35-7.el8.noarch fping-4.2-2.el8.x86_64
gd-2.2.5-7.el8.x86_64 httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64
httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch httpd-tools-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64
jbigkit-libs-2.1-14.el8.x86_64 libXpm-3.5.12-8.el8.x86_64
libjpeg-turbo-1.5.3-12.el8.x86_64 libtiff-4.0.9-20.el8.x86_64
libtool-ltdl-2.4.6-25.el8.x86_64 libwebp-1.0.0-5.el8.x86_64
mariadb-connector-c-3.1.11-2.el8_3.x86_64 mariadb-connector-c-config-3.1.11-2.el8_3.noarch
mod_http2-1.15.7-3.module_el8.4.0+778+c970deab.x86_64 net-snmp-libs-1:5.8-22.el8.x86_64
nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34fea82.noarch php-bcmath-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64
php-common-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 php-fpm-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64
php-gd-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 php-json-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64
php-ldap-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 php-mbstring-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64
php-mysqlnd-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 php-pdo-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64
php-xml-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 unixODBC-2.3.7-1.el8.x86_64
zabbix-agent-6.2.9-release1.el8.x86_64 zabbix-apache-conf-6.2.9-release1.el8.noarch
zabbix-selinux-policy-6.2.9-release1.el8.x86_64 zabbix-server-mysql-6.2.9-release1.el8.x86_64
zabbix-sql-scripts-6.2.9-release1.el8.noarch zabbix-web-6.2.9-release1.el8.noarch
zabbix-web-deps-6.2.9-release1.el8.noarch zabbix-web-mysql-6.2.9-release1.el8.noarch
Complete!
[root@test ~]#
############################################################
4、安装mysql数据库(联网状态)
############################################################
[root@test ~]#
[root@test ~]# sudo dnf install @mysql
Last metadata expiration check: 0:04:27 ago on Thu 30 Nov 2023 01:42:30 PM CST.
Dependencies resolved.
====================================================================================================================================================================
Package Architecture Version Repository Size
====================================================================================================================================================================
Installing group/module packages:
mysql-server x86_64 8.0.26-1.module_el8.4.0+915+de215114 AppStream 25 M
Installing dependencies:
mecab x86_64 0.996-1.module_el8.4.0+589+11e12751.9 AppStream 393 k
mysql x86_64 8.0.26-1.module_el8.4.0+915+de215114 AppStream 12 M
mysql-common x86_64 8.0.26-1.module_el8.4.0+915+de215114 AppStream 134 k
mysql-errmsg x86_64 8.0.26-1.module_el8.4.0+915+de215114 AppStream 598 k
protobuf-lite x86_64 3.5.0-13.el8 AppStream 149 k
Installing module profiles:
mysql/server
Enabling module streams:
mysql 8.0
Transaction Summary
====================================================================================================================================================================
Install 6 Packages
Total download size: 38 M
Installed size: 195 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): mecab-0.996-1.module_el8.4.0+589+11e12751.9.x86_64.rpm 9.9 MB/s | 393 kB 00:00
(2/6): mysql-errmsg-8.0.26-1.module_el8.4.0+915+de215114.x86_64.rpm 17 MB/s | 598 kB 00:00
(3/6): mysql-common-8.0.26-1.module_el8.4.0+915+de215114.x86_64.rpm 1.7 MB/s | 134 kB 00:00
(4/6): protobuf-lite-3.5.0-13.el8.x86_64.rpm 3.1 MB/s | 149 kB 00:00
(5/6): mysql-8.0.26-1.module_el8.4.0+915+de215114.x86_64.rpm 43 MB/s | 12 MB 00:00
(6/6): mysql-server-8.0.26-1.module_el8.4.0+915+de215114.x86_64.rpm 67 MB/s | 25 MB 00:00
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 85 MB/s | 38 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : mysql-common-8.0.26-1.module_el8.4.0+915+de215114.x86_64 1/6
Installing : mysql-8.0.26-1.module_el8.4.0+915+de215114.x86_64 2/6
Installing : mysql-errmsg-8.0.26-1.module_el8.4.0+915+de215114.x86_64 3/6
Installing : protobuf-lite-3.5.0-13.el8.x86_64 4/6
Installing : mecab-0.996-1.module_el8.4.0+589+11e12751.9.x86_64 5/6
Running scriptlet: mecab-0.996-1.module_el8.4.0+589+11e12751.9.x86_64 5/6
Running scriptlet: mysql-server-8.0.26-1.module_el8.4.0+915+de215114.x86_64 6/6
Installing : mysql-server-8.0.26-1.module_el8.4.0+915+de215114.x86_64 6/6
Running scriptlet: mysql-server-8.0.26-1.module_el8.4.0+915+de215114.x86_64 6/6
ValueError: File context for /var/log/mysql(/.*)? already defined
Verifying : mecab-0.996-1.module_el8.4.0+589+11e12751.9.x86_64 1/6
Verifying : mysql-8.0.26-1.module_el8.4.0+915+de215114.x86_64 2/6
Verifying : mysql-common-8.0.26-1.module_el8.4.0+915+de215114.x86_64 3/6
Verifying : mysql-errmsg-8.0.26-1.module_el8.4.0+915+de215114.x86_64 4/6
Verifying : mysql-server-8.0.26-1.module_el8.4.0+915+de215114.x86_64 5/6
Verifying : protobuf-lite-3.5.0-13.el8.x86_64 6/6
Installed:
mecab-0.996-1.module_el8.4.0+589+11e12751.9.x86_64 mysql-8.0.26-1.module_el8.4.0+915+de215114.x86_64
mysql-common-8.0.26-1.module_el8.4.0+915+de215114.x86_64 mysql-errmsg-8.0.26-1.module_el8.4.0+915+de215114.x86_64
mysql-server-8.0.26-1.module_el8.4.0+915+de215114.x86_64 protobuf-lite-3.5.0-13.el8.x86_64
Complete!
[root@test ~]#
############################################################
4、安装mysql数据库(联网状态)
############################################################
**********************************************
sudo dnf install @mysql 安装包
**********************************************
[root@test ~]#
[root@test ~]# sudo dnf install @mysql
Last metadata expiration check: 0:04:27 ago on Thu 30 Nov 2023 01:42:30 PM CST.
Dependencies resolved.
====================================================================================================================================================================
Package Architecture Version Repository Size
====================================================================================================================================================================
Installing group/module packages:
mysql-server x86_64 8.0.26-1.module_el8.4.0+915+de215114 AppStream 25 M
Installing dependencies:
mecab x86_64 0.996-1.module_el8.4.0+589+11e12751.9 AppStream 393 k
mysql x86_64 8.0.26-1.module_el8.4.0+915+de215114 AppStream 12 M
mysql-common x86_64 8.0.26-1.module_el8.4.0+915+de215114 AppStream 134 k
mysql-errmsg x86_64 8.0.26-1.module_el8.4.0+915+de215114 AppStream 598 k
protobuf-lite x86_64 3.5.0-13.el8 AppStream 149 k
Installing module profiles:
mysql/server
Enabling module streams:
mysql 8.0
Transaction Summary
====================================================================================================================================================================
Install 6 Packages
Total download size: 38 M
Installed size: 195 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): mecab-0.996-1.module_el8.4.0+589+11e12751.9.x86_64.rpm 9.9 MB/s | 393 kB 00:00
(2/6): mysql-errmsg-8.0.26-1.module_el8.4.0+915+de215114.x86_64.rpm 17 MB/s | 598 kB 00:00
(3/6): mysql-common-8.0.26-1.module_el8.4.0+915+de215114.x86_64.rpm 1.7 MB/s | 134 kB 00:00
(4/6): protobuf-lite-3.5.0-13.el8.x86_64.rpm 3.1 MB/s | 149 kB 00:00
(5/6): mysql-8.0.26-1.module_el8.4.0+915+de215114.x86_64.rpm 43 MB/s | 12 MB 00:00
(6/6): mysql-server-8.0.26-1.module_el8.4.0+915+de215114.x86_64.rpm 67 MB/s | 25 MB 00:00
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 85 MB/s | 38 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : mysql-common-8.0.26-1.module_el8.4.0+915+de215114.x86_64 1/6
Installing : mysql-8.0.26-1.module_el8.4.0+915+de215114.x86_64 2/6
Installing : mysql-errmsg-8.0.26-1.module_el8.4.0+915+de215114.x86_64 3/6
Installing : protobuf-lite-3.5.0-13.el8.x86_64 4/6
Installing : mecab-0.996-1.module_el8.4.0+589+11e12751.9.x86_64 5/6
Running scriptlet: mecab-0.996-1.module_el8.4.0+589+11e12751.9.x86_64 5/6
Running scriptlet: mysql-server-8.0.26-1.module_el8.4.0+915+de215114.x86_64 6/6
Installing : mysql-server-8.0.26-1.module_el8.4.0+915+de215114.x86_64 6/6
Running scriptlet: mysql-server-8.0.26-1.module_el8.4.0+915+de215114.x86_64 6/6
ValueError: File context for /var/log/mysql(/.*)? already defined
Verifying : mecab-0.996-1.module_el8.4.0+589+11e12751.9.x86_64 1/6
Verifying : mysql-8.0.26-1.module_el8.4.0+915+de215114.x86_64 2/6
Verifying : mysql-common-8.0.26-1.module_el8.4.0+915+de215114.x86_64 3/6
Verifying : mysql-errmsg-8.0.26-1.module_el8.4.0+915+de215114.x86_64 4/6
Verifying : mysql-server-8.0.26-1.module_el8.4.0+915+de215114.x86_64 5/6
Verifying : protobuf-lite-3.5.0-13.el8.x86_64 6/6
Installed:
mecab-0.996-1.module_el8.4.0+589+11e12751.9.x86_64 mysql-8.0.26-1.module_el8.4.0+915+de215114.x86_64
mysql-common-8.0.26-1.module_el8.4.0+915+de215114.x86_64 mysql-errmsg-8.0.26-1.module_el8.4.0+915+de215114.x86_64
mysql-server-8.0.26-1.module_el8.4.0+915+de215114.x86_64 protobuf-lite-3.5.0-13.el8.x86_64
Complete!
[root@test ~]#
**********************************************
sudo systemctl enable --now mysqld 设置开机启动
**********************************************
[root@test ~]# sudo systemctl enable --now mysqld
Created symlink /etc/systemd/system/multi-user.target.wants/mysqld.service → /usr/lib/systemd/system/mysqld.service.
[root@test ~]#
**********************************************
sudo systemctl status mysqld 检查状态
**********************************************
[root@test ~]# sudo systemctl status mysqld
● mysqld.service - MySQL 8.0 database server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2023-11-30 13:50:02 CST; 1min 0s ago
Process: 2434877 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
Process: 2434469 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mysqld.service (code=exited, status=0/SUCCESS)
Process: 2434443 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
Main PID: 2434810 (mysqld)
Status: "Server is operational"
Tasks: 37 (limit: 10768)
Memory: 450.3M
CGroup: /system.slice/mysqld.service
└─2434810 /usr/libexec/mysqld --basedir=/usr
Nov 30 13:49:57 test systemd[1]: Starting MySQL 8.0 database server...
Nov 30 13:49:57 test mysql-prepare-db-dir[2434469]: Initializing MySQL database
Nov 30 13:50:02 test systemd[1]: Started MySQL 8.0 database server.
[root@test ~]#
**********************************************
sudo mysql_secure_installation 添加密码安全策略
**********************************************
【要求你配置VALIDATE PASSWORD component(验证密码组件): 输入y
选择密码验证策略等级, 我这里选择1 (medium)
输入新密码两次 z*****@8****?
确认是否继续使用提供的密码?输入y
移除匿名用户? 输入y
不允许root远程登陆? 我这里需要远程登陆,所以输入n
移除test数据库? 输入y
重新载入权限表? 输入y】
[root@test ~]# sudo mysql_secure_installation
Securing the MySQL server deployment.
Connecting to MySQL using a blank password.
VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?
Press y|Y for Yes, any other key for No: y
There are three levels of password validation policy:
LOW Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 1
Please set the password for root here.
New password:
Re-enter new password:
Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL 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? (Press y|Y for Yes, any other key for No) : y
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? (Press y|Y for Yes, any other key for No) : n
... skipping.
By default, MySQL 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? (Press y|Y for Yes, any other key for No) : y
- 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? (Press y|Y for Yes, any other key for No) : y
Success.
All done!
[root@test ~]#
**********************************************
设置远程访问
**********************************************
mysql -uroot -p
输入密码
use mysql;
update user set host=‘%’ where user=‘root’;
flush privileges;
[root@test ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.26 Source distribution
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> update user set host=‘%’ where user=‘root’;
ERROR 1054 (42S22): Unknown column '‘root’' in 'where clause'
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql>
**********************************************
开启3306端口
**********************************************
sudo firewall-cmd --add-port=3306/tcp --permanent
sudo firewall-cmd --reload
[root@test ~]# sudo firewall-cmd --add-port=3306/tcp --permanent
FirewallD is not running
[root@test ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
[root@test ~]# systemctl start firewalld
[root@test ~]# sudo firewall-cmd --add-port=3306/tcp --permanent
success
[root@test ~]# sudo firewall-cmd --reload
success
**********************************************
关闭主机查询DNS【可选】
**********************************************
打开/etc/my.cnf文件,添加以下配置:
[mysqld]
skip-name-resolve
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[mysqld]
skip-name-resolve
~
-- INSERT --
**********************************************
重启
**********************************************
sudo systemctl restart mysqld
[root@test etc]# sudo systemctl restart mysqld
[root@test etc]#
####################################
5、创建zabbix数据库,赋权限
####################################
mysql -uroot -p
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by ‘Z*****@8*****’;
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;
####################################
6、在ZabbixMysql数据库导入初始模式和数据
####################################
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -pZ*****@8***** zabbix
####################################
7、禁止创建或修改存储函数
####################################
mysql -uroot -p
Z*****@8*****
mysql> set global log_bin_trust_function_creators = 0;
####################################
8、编辑 /etc/zabbix/zabbix_server.conf
####################################
[root@test etc]# vi /etc/zabbix/zabbix_server.conf
[root@test etc]#
DBPassword=Z*****@8*****
####################################
9、重启服务
####################################
systemctl restart zabbix-server zabbix-agent httpd php-fpm
systemctl enable zabbix-server zabbix-agent httpd php-fpm
####################################
10、查看端口
####################################
[root@test zabbix]# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2024502/sshd
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 3030955/zabbix_agen
tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 3031255/zabbix_serv
tcp6 0 0 :::10050 :::* LISTEN 3030955/zabbix_agen
tcp6 0 0 :::10051 :::* LISTEN 3031255/zabbix_serv
tcp6 0 0 :::33060 :::* LISTEN 2661856/mysqld
tcp6 0 0 :::3306 :::* LISTEN 2661856/mysqld
tcp6 0 0 :::80 :::* LISTEN 3031028/httpd
[root@test zabbix]#
####################################
11、防火墙查看并开放80端口
####################################
[root@test zabbix]# firewall-cmd --list-ports
3306/tcp
[root@test zabbix]# sudo firewall-cmd --add-port=10051/tcp --permanent
success
[root@test zabbix]# sudo firewall-cmd --reload
success
[root@test zabbix]# firewall-cmd --list-ports
3306/tcp 10051/tcp
[root@test zabbix]# sudo firewall-cmd --add-port=10050/tcp --permanent
success
[root@test zabbix]# sudo firewall-cmd --reload
success
[root@test zabbix]# sudo firewall-cmd --add-port=80/tcp --permanent
success
[root@test zabbix]# sudo firewall-cmd --reload
success
[root@test zabbix]#
####################################
12、访问http://ip/zabbix/setup.php执行安装
####################################
####################################
13、登录访问
####################################
Admin/zabbix
注意及时修改密码
标签:00,x86,ZABBIX6.2,42,笔记,Centos8.4,el8,64,module From: https://blog.51cto.com/yunlongzheng/8633249