基础环境如下:
系统统一采用Centos-stream-9,使用mini模式,系统防火墙,Selinux均已关闭
Zabbix01 | 192.168.10.133 | Server, Frontend, Agent,Apache |
Zabbix02 | 192.168.10.134 | Server, Frontend, Agent,Apache |
DB01 | 192.168.10.135 | MySQL |
根据以上环境,首先先在zabbix01与zabbix02安装软件包
[root@zabbix01 ~]# rpm -Uvh https://repo.zabbix.com/zabbix/6.5/alma/9/x86_64/zabbix-release-6.5-2.el9.noarch.rpm
Retrieving https://repo.zabbix.com/zabbix/6.5/alma/9/x86_64/zabbix-release-6.5-2.el9.noarch.rpm
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:zabbix-release-6.5-2.el9 ################################# [ 50%]
Cleaning up / removing...
2:zabbix-release-6.4-1.el9 ################################# [100%]
[root@zabbix01 ~]# dnf clean all
21 files removed
[root@zabbix01 ~]# dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
CentOS Stream 9 - BaseOS 2.8 MB/s | 8.0 MB 00:02
CentOS Stream 9 - AppStream 676 kB/s | 19 MB 00:28
CentOS Stream 9 - Extras packages 19 kB/s | 15 kB 00:00
Zabbix Official Repository - x86_64 55 kB/s | 192 kB 00:03
Zabbix Official Repository non-supported - x86_ 458 B/s | 1.1 kB 00:02
Dependencies resolved.
=============================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================
Upgrading:
zabbix-agent x86_64 7.0.0-beta1.release1.el9 zabbix 580 k
zabbix-apache-conf noarch 7.0.0-beta1.release1.el9 zabbix 12 k
zabbix-selinux-policy x86_64 7.0.0-beta1.release1.el9 zabbix 276 k
zabbix-server-mysql x86_64 7.0.0-beta1.release1.el9 zabbix 2.1 M
zabbix-sql-scripts noarch 7.0.0-beta1.release1.el9 zabbix 7.4 M
zabbix-web noarch 7.0.0-beta1.release1.el9 zabbix 7.9 M
zabbix-web-deps noarch 7.0.0-beta1.release1.el9 zabbix 12 k
zabbix-web-mysql noarch 7.0.0-beta1.release1.el9 zabbix 11 k
Transaction Summary
=============================================================================================================================================================
Upgrade 8 Packages
Total download size: 18 M
Downloading Packages:
(1/8): zabbix-apache-conf-7.0.0-beta1.release1.el9.noarch.rpm 9.3 kB/s | 12 kB 00:01
(2/8): zabbix-selinux-policy-7.0.0-beta1.release1.el9.x86_64.rpm 125 kB/s | 276 kB 00:02
(3/8): zabbix-agent-7.0.0-beta1.release1.el9.x86_64.rpm 169 kB/s | 580 kB 00:03
(4/8): zabbix-server-mysql-7.0.0-beta1.release1.el9.x86_64.rpm 974 kB/s | 2.1 MB 00:02
(5/8): zabbix-web-deps-7.0.0-beta1.release1.el9.noarch.rpm 16 kB/s | 12 kB 00:00
(6/8): zabbix-web-mysql-7.0.0-beta1.release1.el9.noarch.rpm 13 kB/s | 11 kB 00:00
(7/8): zabbix-sql-scripts-7.0.0-beta1.release1.el9.noarch.rpm 2.4 MB/s | 7.4 MB 00:03
(8/8): zabbix-web-7.0.0-beta1.release1.el9.noarch.rpm 2.0 MB/s | 7.9 MB 00:03
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 2.5 MB/s | 18 MB 00:07
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Upgrading : zabbix-web-7.0.0-beta1.release1.el9.noarch 1/16
Running scriptlet: zabbix-web-7.0.0-beta1.release1.el9.noarch 1/16
Upgrading : zabbix-web-deps-7.0.0-beta1.release1.el9.noarch 2/16
Upgrading : zabbix-web-mysql-7.0.0-beta1.release1.el9.noarch 3/16
Upgrading : zabbix-apache-conf-7.0.0-beta1.release1.el9.noarch 4/16
Running scriptlet: zabbix-apache-conf-7.0.0-beta1.release1.el9.noarch 4/16
Upgrading : zabbix-sql-scripts-7.0.0-beta1.release1.el9.noarch 5/16
Running scriptlet: zabbix-server-mysql-7.0.0-beta1.release1.el9.x86_64 6/16
Upgrading : zabbix-server-mysql-7.0.0-beta1.release1.el9.x86_64 6/16
warning: /etc/zabbix/zabbix_server.conf created as /etc/zabbix/zabbix_server.conf.rpmnew
Running scriptlet: zabbix-server-mysql-7.0.0-beta1.release1.el9.x86_64 6/16
Upgrading : zabbix-selinux-policy-7.0.0-beta1.release1.el9.x86_64 7/16
Running scriptlet: zabbix-selinux-policy-7.0.0-beta1.release1.el9.x86_64 7/16
Running scriptlet: zabbix-agent-7.0.0-beta1.release1.el9.x86_64 8/16
Upgrading : zabbix-agent-7.0.0-beta1.release1.el9.x86_64 8/16
Running scriptlet: zabbix-agent-7.0.0-beta1.release1.el9.x86_64 8/16
Cleanup : zabbix-apache-conf-6.4.11-release1.el9.noarch 9/16
Cleanup : zabbix-web-deps-6.4.11-release1.el9.noarch 10/16
Cleanup : zabbix-web-mysql-6.4.11-release1.el9.noarch 11/16
Running scriptlet: zabbix-web-6.4.11-release1.el9.noarch 12/16
Cleanup : zabbix-web-6.4.11-release1.el9.noarch 12/16
Cleanup : zabbix-sql-scripts-6.4.11-release1.el9.noarch 13/16
Cleanup : zabbix-selinux-policy-6.4.11-release1.el9.x86_64 14/16
Running scriptlet: zabbix-selinux-policy-6.4.11-release1.el9.x86_64 14/16
Running scriptlet: zabbix-server-mysql-6.4.11-release1.el9.x86_64 15/16
Cleanup : zabbix-server-mysql-6.4.11-release1.el9.x86_64 15/16
Running scriptlet: zabbix-server-mysql-6.4.11-release1.el9.x86_64 15/16
Running scriptlet: zabbix-agent-6.4.11-release1.el9.x86_64 16/16
Cleanup : zabbix-agent-6.4.11-release1.el9.x86_64 16/16
Running scriptlet: zabbix-agent-6.4.11-release1.el9.x86_64 16/16
Running scriptlet: zabbix-agent-7.0.0-beta1.release1.el9.x86_64 16/16
Running scriptlet: zabbix-agent-6.4.11-release1.el9.x86_64 16/16
Verifying : zabbix-agent-7.0.0-beta1.release1.el9.x86_64 1/16
Verifying : zabbix-agent-6.4.11-release1.el9.x86_64 2/16
Verifying : zabbix-apache-conf-7.0.0-beta1.release1.el9.noarch 3/16
Verifying : zabbix-apache-conf-6.4.11-release1.el9.noarch 4/16
Verifying : zabbix-selinux-policy-7.0.0-beta1.release1.el9.x86_64 5/16
Verifying : zabbix-selinux-policy-6.4.11-release1.el9.x86_64 6/16
Verifying : zabbix-server-mysql-7.0.0-beta1.release1.el9.x86_64 7/16
Verifying : zabbix-server-mysql-6.4.11-release1.el9.x86_64 8/16
Verifying : zabbix-sql-scripts-7.0.0-beta1.release1.el9.noarch 9/16
Verifying : zabbix-sql-scripts-6.4.11-release1.el9.noarch 10/16
Verifying : zabbix-web-7.0.0-beta1.release1.el9.noarch 11/16
Verifying : zabbix-web-6.4.11-release1.el9.noarch 12/16
Verifying : zabbix-web-deps-7.0.0-beta1.release1.el9.noarch 13/16
Verifying : zabbix-web-deps-6.4.11-release1.el9.noarch 14/16
Verifying : zabbix-web-mysql-7.0.0-beta1.release1.el9.noarch 15/16
Verifying : zabbix-web-mysql-6.4.11-release1.el9.noarch 16/16
Upgraded:
zabbix-agent-7.0.0-beta1.release1.el9.x86_64 zabbix-apache-conf-7.0.0-beta1.release1.el9.noarch
zabbix-selinux-policy-7.0.0-beta1.release1.el9.x86_64 zabbix-server-mysql-7.0.0-beta1.release1.el9.x86_64
zabbix-sql-scripts-7.0.0-beta1.release1.el9.noarch zabbix-web-7.0.0-beta1.release1.el9.noarch
zabbix-web-deps-7.0.0-beta1.release1.el9.noarch zabbix-web-mysql-7.0.0-beta1.release1.el9.noarch
Complete!
[root@zabbix01 ~]#
在DB01安装配置MySQL
[root@DB01 ~]# dnf -y install mysql-server
^CCentOS Stream 9 - AppStream 0.0 B/s | 0 B 00:00
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: Interrupted by signal
[root@DB01 ~]# dnf -y install mysql-server -y
Last metadata expiration check: 1:05:47 ago on Wed 31 Jan 2024 08:54:07 AM CST.
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
mysql-server x86_64 8.0.32-1.el9 appstream 17 M
Installing dependencies:
checkpolicy x86_64 3.6-1.el9 appstream 353 k
libicu x86_64 67.1-9.el9 baseos 9.6 M
mariadb-connector-c-config noarch 3.2.6-1.el9 appstream 11 k
mecab x86_64 0.996-3.el9.4 appstream 356 k
mysql x86_64 8.0.32-1.el9 appstream 2.8 M
mysql-common x86_64 8.0.32-1.el9 appstream 75 k
mysql-errmsg x86_64 8.0.32-1.el9 appstream 494 k
mysql-selinux noarch 1.0.5-1.el9 appstream 36 k
perl-AutoLoader noarch 5.74-481.el9 appstream 21 k
perl-B x86_64 1.80-481.el9 appstream 180 k
perl-Carp noarch 1.50-460.el9 appstream 30 k
perl-Class-Struct noarch 0.66-481.el9 appstream 22 k
perl-Data-Dumper x86_64 2.174-462.el9 appstream 56 k
perl-Digest noarch 1.19-4.el9 appstream 26 k
perl-Digest-MD5 x86_64 2.58-4.el9 appstream 37 k
perl-Encode x86_64 4:3.08-462.el9 appstream 1.7 M
perl-Errno x86_64 1.30-481.el9 appstream 14 k
perl-Exporter noarch 5.74-461.el9 appstream 32 k
perl-Fcntl x86_64 1.13-481.el9 appstream 20 k
perl-File-Basename noarch 2.85-481.el9 appstream 17 k
perl-File-Path noarch 2.18-4.el9 appstream 36 k
perl-File-Temp noarch 1:0.231.100-4.el9 appstream 60 k
perl-File-stat noarch 1.09-481.el9 appstream 17 k
perl-FileHandle noarch 2.03-481.el9 appstream 15 k
perl-Getopt-Long noarch 1:2.52-4.el9 appstream 61 k
perl-Getopt-Std noarch 1.12-481.el9 appstream 15 k
perl-HTTP-Tiny noarch 0.076-462.el9 appstream 54 k
perl-IO x86_64 1.43-481.el9 appstream 88 k
perl-IO-Socket-IP noarch 0.41-5.el9 appstream 43 k
perl-IO-Socket-SSL noarch 2.073-1.el9 appstream 219 k
perl-IPC-Open3 noarch 1.21-481.el9 appstream 22 k
perl-MIME-Base64 x86_64 3.16-4.el9 appstream 31 k
perl-Mozilla-CA noarch 20200520-6.el9 appstream 13 k
perl-Net-SSLeay x86_64 1.92-2.el9 appstream 388 k
perl-POSIX x86_64 1.94-481.el9 appstream 96 k
perl-PathTools x86_64 3.78-461.el9 appstream 88 k
perl-Pod-Escapes noarch 1:1.07-460.el9 appstream 21 k
perl-Pod-Perldoc noarch 3.28.01-461.el9 appstream 87 k
perl-Pod-Simple noarch 1:3.42-4.el9 appstream 225 k
perl-Pod-Usage noarch 4:2.01-4.el9 appstream 41 k
perl-Scalar-List-Utils x86_64 4:1.56-461.el9 appstream 73 k
perl-SelectSaver noarch 1.02-481.el9 appstream 11 k
perl-Socket x86_64 4:2.031-4.el9 appstream 56 k
perl-Storable x86_64 1:3.21-460.el9 appstream 96 k
perl-Symbol noarch 1.08-481.el9 appstream 14 k
perl-Term-ANSIColor noarch 5.01-461.el9 appstream 49 k
perl-Term-Cap noarch 1.17-460.el9 appstream 23 k
perl-Text-ParseWords noarch 3.30-460.el9 appstream 17 k
perl-Text-Tabs+Wrap noarch 2013.0523-460.el9 appstream 24 k
perl-Time-Local noarch 2:1.300-7.el9 appstream 34 k
perl-URI noarch 5.09-3.el9 appstream 121 k
perl-base noarch 2.27-481.el9 appstream 16 k
perl-constant noarch 1.33-461.el9 appstream 24 k
perl-if noarch 0.60.800-481.el9 appstream 14 k
perl-interpreter x86_64 4:5.32.1-481.el9 appstream 71 k
perl-libnet noarch 3.13-4.el9 appstream 130 k
perl-libs x86_64 4:5.32.1-481.el9 appstream 2.2 M
perl-mro x86_64 1.23-481.el9 appstream 28 k
perl-overload noarch 1.31-481.el9 appstream 45 k
perl-overloading noarch 0.02-481.el9 appstream 12 k
perl-parent noarch 1:0.238-460.el9 appstream 15 k
perl-podlators noarch 1:4.14-460.el9 appstream 114 k
perl-subs noarch 1.03-481.el9 appstream 11 k
perl-vars noarch 1.05-481.el9 appstream 13 k
policycoreutils-python-utils noarch 3.5-2.el9 appstream 78 k
protobuf-lite x86_64 3.14.0-13.el9 appstream 232 k
python3-audit x86_64 3.0.7-104.el9 appstream 83 k
python3-distro noarch 1.5.0-7.el9 baseos 37 k
python3-libsemanage x86_64 3.5-2.el9 appstream 80 k
python3-policycoreutils noarch 3.5-2.el9 appstream 2.1 M
python3-setools x86_64 4.4.4-1.el9 baseos 605 k
python3-setuptools noarch 53.0.0-12.el9 baseos 944 k
Installing weak dependencies:
perl-NDBM_File x86_64 1.15-481.el9 appstream 22 k
Transaction Summary
================================================================================
Install 74 Packages
Total download size: 41 M
Installed size: 251 M
Downloading Packages:
(1/74): python3-distro-1.5.0-7.el9.noarch.rpm 236 kB/s | 37 kB 00:00
(2/74): python3-setools-4.4.4-1.el9.x86_64.rpm 1.0 MB/s | 605 kB 00:00
(3/74): python3-setuptools-53.0.0-12.el9.noarch 1.7 MB/s | 944 kB 00:00
(4/74): mariadb-connector-c-config-3.2.6-1.el9. 40 kB/s | 11 kB 00:00
(5/74): checkpolicy-3.6-1.el9.x86_64.rpm 390 kB/s | 353 kB 00:00
(6/74): mecab-0.996-3.el9.4.x86_64.rpm 306 kB/s | 356 kB 00:01
(7/74): mysql-common-8.0.32-1.el9.x86_64.rpm 291 kB/s | 75 kB 00:00
(8/74): mysql-8.0.32-1.el9.x86_64.rpm 1.3 MB/s | 2.8 MB 00:02
(9/74): mysql-errmsg-8.0.32-1.el9.x86_64.rpm 343 kB/s | 494 kB 00:01
(10/74): mysql-selinux-1.0.5-1.el9.noarch.rpm 239 kB/s | 36 kB 00:00
(11/74): perl-AutoLoader-5.74-481.el9.noarch.rp 150 kB/s | 21 kB 00:00
(12/74): libicu-67.1-9.el9.x86_64.rpm 2.3 MB/s | 9.6 MB 00:04
(13/74): perl-B-1.80-481.el9.x86_64.rpm 588 kB/s | 180 kB 00:00
(14/74): perl-Class-Struct-0.66-481.el9.noarch. 412 kB/s | 22 kB 00:00
(15/74): perl-Carp-1.50-460.el9.noarch.rpm 184 kB/s | 30 kB 00:00
(16/74): perl-Data-Dumper-2.174-462.el9.x86_64. 699 kB/s | 56 kB 00:00
(17/74): perl-Digest-1.19-4.el9.noarch.rpm 436 kB/s | 26 kB 00:00
(18/74): perl-Digest-MD5-2.58-4.el9.x86_64.rpm 473 kB/s | 37 kB 00:00
(19/74): perl-Errno-1.30-481.el9.x86_64.rpm 261 kB/s | 14 kB 00:00
(20/74): perl-Exporter-5.74-461.el9.noarch.rpm 453 kB/s | 32 kB 00:00
(21/74): perl-Fcntl-1.13-481.el9.x86_64.rpm 178 kB/s | 20 kB 00:00
(22/74): perl-File-Basename-2.85-481.el9.noarch 96 kB/s | 17 kB 00:00
(23/74): perl-File-Path-2.18-4.el9.noarch.rpm 149 kB/s | 36 kB 00:00
(24/74): perl-File-Temp-0.231.100-4.el9.noarch. 214 kB/s | 60 kB 00:00
(25/74): perl-Encode-3.08-462.el9.x86_64.rpm 1.6 MB/s | 1.7 MB 00:01
(26/74): perl-File-stat-1.09-481.el9.noarch.rpm 116 kB/s | 17 kB 00:00
(27/74): perl-FileHandle-2.03-481.el9.noarch.rp 284 kB/s | 15 kB 00:00
(28/74): perl-Getopt-Std-1.12-481.el9.noarch.rp 284 kB/s | 15 kB 00:00
(29/74): perl-Getopt-Long-2.52-4.el9.noarch.rpm 728 kB/s | 61 kB 00:00
(30/74): perl-HTTP-Tiny-0.076-462.el9.noarch.rp 660 kB/s | 54 kB 00:00
(31/74): perl-IO-1.43-481.el9.x86_64.rpm 922 kB/s | 88 kB 00:00
(32/74): perl-IO-Socket-IP-0.41-5.el9.noarch.rp 462 kB/s | 43 kB 00:00
(33/74): perl-IO-Socket-SSL-2.073-1.el9.noarch. 1.6 MB/s | 219 kB 00:00
(34/74): perl-IPC-Open3-1.21-481.el9.noarch.rpm 323 kB/s | 22 kB 00:00
(35/74): perl-MIME-Base64-3.16-4.el9.x86_64.rpm 646 kB/s | 31 kB 00:00
(36/74): perl-Mozilla-CA-20200520-6.el9.noarch. 268 kB/s | 13 kB 00:00
(37/74): perl-NDBM_File-1.15-481.el9.x86_64.rpm 410 kB/s | 22 kB 00:00
(38/74): perl-POSIX-1.94-481.el9.x86_64.rpm 1.3 MB/s | 96 kB 00:00
(39/74): perl-PathTools-3.78-461.el9.x86_64.rpm 1.3 MB/s | 88 kB 00:00
(40/74): perl-Net-SSLeay-1.92-2.el9.x86_64.rpm 1.6 MB/s | 388 kB 00:00
(41/74): perl-Pod-Escapes-1.07-460.el9.noarch.r 365 kB/s | 21 kB 00:00
(42/74): perl-Pod-Simple-3.42-4.el9.noarch.rpm 1.9 MB/s | 225 kB 00:00
(43/74): perl-Pod-Perldoc-3.28.01-461.el9.noarc 647 kB/s | 87 kB 00:00
(44/74): perl-Pod-Usage-2.01-4.el9.noarch.rpm 599 kB/s | 41 kB 00:00
(45/74): perl-Scalar-List-Utils-1.56-461.el9.x8 762 kB/s | 73 kB 00:00
(46/74): perl-SelectSaver-1.02-481.el9.noarch.r 220 kB/s | 11 kB 00:00
(47/74): perl-Storable-3.21-460.el9.x86_64.rpm 820 kB/s | 96 kB 00:00
(48/74): perl-Socket-2.031-4.el9.x86_64.rpm 388 kB/s | 56 kB 00:00
(49/74): perl-Term-ANSIColor-5.01-461.el9.noarc 229 kB/s | 49 kB 00:00
(50/74): perl-Symbol-1.08-481.el9.noarch.rpm 48 kB/s | 14 kB 00:00
(51/74): perl-Term-Cap-1.17-460.el9.noarch.rpm 279 kB/s | 23 kB 00:00
(52/74): perl-Text-ParseWords-3.30-460.el9.noar 402 kB/s | 17 kB 00:00
(53/74): perl-Text-Tabs+Wrap-2013.0523-460.el9. 428 kB/s | 24 kB 00:00
(54/74): perl-Time-Local-1.300-7.el9.noarch.rpm 322 kB/s | 34 kB 00:00
(55/74): perl-URI-5.09-3.el9.noarch.rpm 1.1 MB/s | 121 kB 00:00
(56/74): perl-base-2.27-481.el9.noarch.rpm 206 kB/s | 16 kB 00:00
(57/74): perl-constant-1.33-461.el9.noarch.rpm 417 kB/s | 24 kB 00:00
(58/74): perl-if-0.60.800-481.el9.noarch.rpm 269 kB/s | 14 kB 00:00
(59/74): perl-interpreter-5.32.1-481.el9.x86_64 965 kB/s | 71 kB 00:00
(60/74): perl-libnet-3.13-4.el9.noarch.rpm 1.8 MB/s | 130 kB 00:00
(61/74): perl-mro-1.23-481.el9.x86_64.rpm 225 kB/s | 28 kB 00:00
(62/74): perl-overload-1.31-481.el9.noarch.rpm 852 kB/s | 45 kB 00:00
(63/74): perl-overloading-0.02-481.el9.noarch.r 265 kB/s | 12 kB 00:00
(64/74): perl-parent-0.238-460.el9.noarch.rpm 210 kB/s | 15 kB 00:00
(65/74): perl-podlators-4.14-460.el9.noarch.rpm 1.2 MB/s | 114 kB 00:00
(66/74): perl-subs-1.03-481.el9.noarch.rpm 220 kB/s | 11 kB 00:00
(67/74): perl-vars-1.05-481.el9.noarch.rpm 266 kB/s | 13 kB 00:00
(68/74): policycoreutils-python-utils-3.5-2.el9 1.1 MB/s | 78 kB 00:00
(69/74): protobuf-lite-3.14.0-13.el9.x86_64.rpm 1.1 MB/s | 232 kB 00:00
(70/74): python3-audit-3.0.7-104.el9.x86_64.rpm 941 kB/s | 83 kB 00:00
(71/74): python3-libsemanage-3.5-2.el9.x86_64.r 1.1 MB/s | 80 kB 00:00
(72/74): python3-policycoreutils-3.5-2.el9.noar 2.2 MB/s | 2.1 MB 00:00
(73/74): perl-libs-5.32.1-481.el9.x86_64.rpm 645 kB/s | 2.2 MB 00:03
(74/74): mysql-server-8.0.32-1.el9.x86_64.rpm 1.5 MB/s | 17 MB 00:11
--------------------------------------------------------------------------------
Total 2.6 MB/s | 41 MB 00:15
CentOS Stream 9 - BaseOS 94 kB/s | 1.6 kB 00:00
Importing GPG key 0x8483C65D:
Userid : "CentOS (CentOS Official Signing Key) <security@centos.org>"
Fingerprint: 99DB 70FA E1D7 CE22 7FB6 4882 05B5 55B3 8483 C65D
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : mariadb-connector-c-config-3.2.6-1.el9.noarch 1/74
Installing : mysql-common-8.0.32-1.el9.x86_64 2/74
Installing : python3-setuptools-53.0.0-12.el9.noarch 3/74
Installing : python3-distro-1.5.0-7.el9.noarch 4/74
Installing : python3-setools-4.4.4-1.el9.x86_64 5/74
Installing : mysql-8.0.32-1.el9.x86_64 6/74
Installing : mysql-errmsg-8.0.32-1.el9.x86_64 7/74
Installing : perl-Digest-1.19-4.el9.noarch 8/74
Installing : perl-Digest-MD5-2.58-4.el9.x86_64 9/74
Installing : perl-B-1.80-481.el9.x86_64 10/74
Installing : perl-FileHandle-2.03-481.el9.noarch 11/74
Installing : perl-Data-Dumper-2.174-462.el9.x86_64 12/74
Installing : perl-libnet-3.13-4.el9.noarch 13/74
Installing : perl-base-2.27-481.el9.noarch 14/74
Installing : perl-URI-5.09-3.el9.noarch 15/74
Installing : perl-AutoLoader-5.74-481.el9.noarch 16/74
Installing : perl-Mozilla-CA-20200520-6.el9.noarch 17/74
Installing : perl-if-0.60.800-481.el9.noarch 18/74
Installing : perl-IO-Socket-IP-0.41-5.el9.noarch 19/74
Installing : perl-Time-Local-2:1.300-7.el9.noarch 20/74
Installing : perl-File-Path-2.18-4.el9.noarch 21/74
Installing : perl-Pod-Escapes-1:1.07-460.el9.noarch 22/74
Installing : perl-Text-Tabs+Wrap-2013.0523-460.el9.noarch 23/74
Installing : perl-IO-Socket-SSL-2.073-1.el9.noarch 24/74
Installing : perl-Net-SSLeay-1.92-2.el9.x86_64 25/74
Installing : perl-Class-Struct-0.66-481.el9.noarch 26/74
Installing : perl-POSIX-1.94-481.el9.x86_64 27/74
Installing : perl-Term-ANSIColor-5.01-461.el9.noarch 28/74
Installing : perl-IPC-Open3-1.21-481.el9.noarch 29/74
Installing : perl-subs-1.03-481.el9.noarch 30/74
Installing : perl-File-Temp-1:0.231.100-4.el9.noarch 31/74
Installing : perl-Term-Cap-1.17-460.el9.noarch 32/74
Installing : perl-Pod-Simple-1:3.42-4.el9.noarch 33/74
Installing : perl-HTTP-Tiny-0.076-462.el9.noarch 34/74
Installing : perl-Socket-4:2.031-4.el9.x86_64 35/74
Installing : perl-SelectSaver-1.02-481.el9.noarch 36/74
Installing : perl-Symbol-1.08-481.el9.noarch 37/74
Installing : perl-File-stat-1.09-481.el9.noarch 38/74
Installing : perl-podlators-1:4.14-460.el9.noarch 39/74
Installing : perl-Pod-Perldoc-3.28.01-461.el9.noarch 40/74
Installing : perl-Fcntl-1.13-481.el9.x86_64 41/74
Installing : perl-Text-ParseWords-3.30-460.el9.noarch 42/74
Installing : perl-mro-1.23-481.el9.x86_64 43/74
Installing : perl-IO-1.43-481.el9.x86_64 44/74
Installing : perl-overloading-0.02-481.el9.noarch 45/74
Installing : perl-Pod-Usage-4:2.01-4.el9.noarch 46/74
Installing : perl-Errno-1.30-481.el9.x86_64 47/74
Installing : perl-File-Basename-2.85-481.el9.noarch 48/74
Installing : perl-Getopt-Std-1.12-481.el9.noarch 49/74
Installing : perl-MIME-Base64-3.16-4.el9.x86_64 50/74
Installing : perl-Scalar-List-Utils-4:1.56-461.el9.x86_64 51/74
Installing : perl-constant-1.33-461.el9.noarch 52/74
Installing : perl-Storable-1:3.21-460.el9.x86_64 53/74
Installing : perl-overload-1.31-481.el9.noarch 54/74
Installing : perl-parent-1:0.238-460.el9.noarch 55/74
Installing : perl-vars-1.05-481.el9.noarch 56/74
Installing : perl-Getopt-Long-1:2.52-4.el9.noarch 57/74
Installing : perl-Carp-1.50-460.el9.noarch 58/74
Installing : perl-Exporter-5.74-461.el9.noarch 59/74
Installing : perl-NDBM_File-1.15-481.el9.x86_64 60/74
Installing : perl-PathTools-3.78-461.el9.x86_64 61/74
Installing : perl-Encode-4:3.08-462.el9.x86_64 62/74
Installing : perl-libs-4:5.32.1-481.el9.x86_64 63/74
Installing : perl-interpreter-4:5.32.1-481.el9.x86_64 64/74
Installing : python3-libsemanage-3.5-2.el9.x86_64 65/74
Installing : python3-audit-3.0.7-104.el9.x86_64 66/74
Installing : protobuf-lite-3.14.0-13.el9.x86_64 67/74
Installing : mecab-0.996-3.el9.4.x86_64 68/74
Installing : checkpolicy-3.6-1.el9.x86_64 69/74
Installing : python3-policycoreutils-3.5-2.el9.noarch 70/74
Installing : policycoreutils-python-utils-3.5-2.el9.noarch 71/74
Running scriptlet: mysql-selinux-1.0.5-1.el9.noarch 72/74
Installing : mysql-selinux-1.0.5-1.el9.noarch 72/74
Running scriptlet: mysql-selinux-1.0.5-1.el9.noarch 72/74
libsemanage.semanage_direct_install_info: Overriding mysql module at lower priority 100 with module at priority 200.
Installing : libicu-67.1-9.el9.x86_64 73/74
Running scriptlet: mysql-server-8.0.32-1.el9.x86_64 74/74
Installing : mysql-server-8.0.32-1.el9.x86_64 74/74
Running scriptlet: mysql-server-8.0.32-1.el9.x86_64 74/74
Running scriptlet: mysql-selinux-1.0.5-1.el9.noarch 74/74
Running scriptlet: mysql-server-8.0.32-1.el9.x86_64 74/74
Verifying : libicu-67.1-9.el9.x86_64 1/74
Verifying : python3-distro-1.5.0-7.el9.noarch 2/74
Verifying : python3-setools-4.4.4-1.el9.x86_64 3/74
Verifying : python3-setuptools-53.0.0-12.el9.noarch 4/74
Verifying : checkpolicy-3.6-1.el9.x86_64 5/74
Verifying : mariadb-connector-c-config-3.2.6-1.el9.noarch 6/74
Verifying : mecab-0.996-3.el9.4.x86_64 7/74
Verifying : mysql-8.0.32-1.el9.x86_64 8/74
Verifying : mysql-common-8.0.32-1.el9.x86_64 9/74
Verifying : mysql-errmsg-8.0.32-1.el9.x86_64 10/74
Verifying : mysql-selinux-1.0.5-1.el9.noarch 11/74
Verifying : mysql-server-8.0.32-1.el9.x86_64 12/74
Verifying : perl-AutoLoader-5.74-481.el9.noarch 13/74
Verifying : perl-B-1.80-481.el9.x86_64 14/74
Verifying : perl-Carp-1.50-460.el9.noarch 15/74
Verifying : perl-Class-Struct-0.66-481.el9.noarch 16/74
Verifying : perl-Data-Dumper-2.174-462.el9.x86_64 17/74
Verifying : perl-Digest-1.19-4.el9.noarch 18/74
Verifying : perl-Digest-MD5-2.58-4.el9.x86_64 19/74
Verifying : perl-Encode-4:3.08-462.el9.x86_64 20/74
Verifying : perl-Errno-1.30-481.el9.x86_64 21/74
Verifying : perl-Exporter-5.74-461.el9.noarch 22/74
Verifying : perl-Fcntl-1.13-481.el9.x86_64 23/74
Verifying : perl-File-Basename-2.85-481.el9.noarch 24/74
Verifying : perl-File-Path-2.18-4.el9.noarch 25/74
Verifying : perl-File-Temp-1:0.231.100-4.el9.noarch 26/74
Verifying : perl-File-stat-1.09-481.el9.noarch 27/74
Verifying : perl-FileHandle-2.03-481.el9.noarch 28/74
Verifying : perl-Getopt-Long-1:2.52-4.el9.noarch 29/74
Verifying : perl-Getopt-Std-1.12-481.el9.noarch 30/74
Verifying : perl-HTTP-Tiny-0.076-462.el9.noarch 31/74
Verifying : perl-IO-1.43-481.el9.x86_64 32/74
Verifying : perl-IO-Socket-IP-0.41-5.el9.noarch 33/74
Verifying : perl-IO-Socket-SSL-2.073-1.el9.noarch 34/74
Verifying : perl-IPC-Open3-1.21-481.el9.noarch 35/74
Verifying : perl-MIME-Base64-3.16-4.el9.x86_64 36/74
Verifying : perl-Mozilla-CA-20200520-6.el9.noarch 37/74
Verifying : perl-NDBM_File-1.15-481.el9.x86_64 38/74
Verifying : perl-Net-SSLeay-1.92-2.el9.x86_64 39/74
Verifying : perl-POSIX-1.94-481.el9.x86_64 40/74
Verifying : perl-PathTools-3.78-461.el9.x86_64 41/74
Verifying : perl-Pod-Escapes-1:1.07-460.el9.noarch 42/74
Verifying : perl-Pod-Perldoc-3.28.01-461.el9.noarch 43/74
Verifying : perl-Pod-Simple-1:3.42-4.el9.noarch 44/74
Verifying : perl-Pod-Usage-4:2.01-4.el9.noarch 45/74
Verifying : perl-Scalar-List-Utils-4:1.56-461.el9.x86_64 46/74
Verifying : perl-SelectSaver-1.02-481.el9.noarch 47/74
Verifying : perl-Socket-4:2.031-4.el9.x86_64 48/74
Verifying : perl-Storable-1:3.21-460.el9.x86_64 49/74
Verifying : perl-Symbol-1.08-481.el9.noarch 50/74
Verifying : perl-Term-ANSIColor-5.01-461.el9.noarch 51/74
Verifying : perl-Term-Cap-1.17-460.el9.noarch 52/74
Verifying : perl-Text-ParseWords-3.30-460.el9.noarch 53/74
Verifying : perl-Text-Tabs+Wrap-2013.0523-460.el9.noarch 54/74
Verifying : perl-Time-Local-2:1.300-7.el9.noarch 55/74
Verifying : perl-URI-5.09-3.el9.noarch 56/74
Verifying : perl-base-2.27-481.el9.noarch 57/74
Verifying : perl-constant-1.33-461.el9.noarch 58/74
Verifying : perl-if-0.60.800-481.el9.noarch 59/74
Verifying : perl-interpreter-4:5.32.1-481.el9.x86_64 60/74
Verifying : perl-libnet-3.13-4.el9.noarch 61/74
Verifying : perl-libs-4:5.32.1-481.el9.x86_64 62/74
Verifying : perl-mro-1.23-481.el9.x86_64 63/74
Verifying : perl-overload-1.31-481.el9.noarch 64/74
Verifying : perl-overloading-0.02-481.el9.noarch 65/74
Verifying : perl-parent-1:0.238-460.el9.noarch 66/74
Verifying : perl-podlators-1:4.14-460.el9.noarch 67/74
Verifying : perl-subs-1.03-481.el9.noarch 68/74
Verifying : perl-vars-1.05-481.el9.noarch 69/74
Verifying : policycoreutils-python-utils-3.5-2.el9.noarch 70/74
Verifying : protobuf-lite-3.14.0-13.el9.x86_64 71/74
Verifying : python3-audit-3.0.7-104.el9.x86_64 72/74
Verifying : python3-libsemanage-3.5-2.el9.x86_64 73/74
Verifying : python3-policycoreutils-3.5-2.el9.noarch 74/74
Installed:
checkpolicy-3.6-1.el9.x86_64
libicu-67.1-9.el9.x86_64
mariadb-connector-c-config-3.2.6-1.el9.noarch
mecab-0.996-3.el9.4.x86_64
mysql-8.0.32-1.el9.x86_64
mysql-common-8.0.32-1.el9.x86_64
mysql-errmsg-8.0.32-1.el9.x86_64
mysql-selinux-1.0.5-1.el9.noarch
mysql-server-8.0.32-1.el9.x86_64
perl-AutoLoader-5.74-481.el9.noarch
perl-B-1.80-481.el9.x86_64
perl-Carp-1.50-460.el9.noarch
perl-Class-Struct-0.66-481.el9.noarch
perl-Data-Dumper-2.174-462.el9.x86_64
perl-Digest-1.19-4.el9.noarch
perl-Digest-MD5-2.58-4.el9.x86_64
perl-Encode-4:3.08-462.el9.x86_64
perl-Errno-1.30-481.el9.x86_64
perl-Exporter-5.74-461.el9.noarch
perl-Fcntl-1.13-481.el9.x86_64
perl-File-Basename-2.85-481.el9.noarch
perl-File-Path-2.18-4.el9.noarch
perl-File-Temp-1:0.231.100-4.el9.noarch
perl-File-stat-1.09-481.el9.noarch
perl-FileHandle-2.03-481.el9.noarch
perl-Getopt-Long-1:2.52-4.el9.noarch
perl-Getopt-Std-1.12-481.el9.noarch
perl-HTTP-Tiny-0.076-462.el9.noarch
perl-IO-1.43-481.el9.x86_64
perl-IO-Socket-IP-0.41-5.el9.noarch
perl-IO-Socket-SSL-2.073-1.el9.noarch
perl-IPC-Open3-1.21-481.el9.noarch
perl-MIME-Base64-3.16-4.el9.x86_64
perl-Mozilla-CA-20200520-6.el9.noarch
perl-NDBM_File-1.15-481.el9.x86_64
perl-Net-SSLeay-1.92-2.el9.x86_64
perl-POSIX-1.94-481.el9.x86_64
perl-PathTools-3.78-461.el9.x86_64
perl-Pod-Escapes-1:1.07-460.el9.noarch
perl-Pod-Perldoc-3.28.01-461.el9.noarch
perl-Pod-Simple-1:3.42-4.el9.noarch
perl-Pod-Usage-4:2.01-4.el9.noarch
perl-Scalar-List-Utils-4:1.56-461.el9.x86_64
perl-SelectSaver-1.02-481.el9.noarch
perl-Socket-4:2.031-4.el9.x86_64
perl-Storable-1:3.21-460.el9.x86_64
perl-Symbol-1.08-481.el9.noarch
perl-Term-ANSIColor-5.01-461.el9.noarch
perl-Term-Cap-1.17-460.el9.noarch
perl-Text-ParseWords-3.30-460.el9.noarch
perl-Text-Tabs+Wrap-2013.0523-460.el9.noarch
perl-Time-Local-2:1.300-7.el9.noarch
perl-URI-5.09-3.el9.noarch
perl-base-2.27-481.el9.noarch
perl-constant-1.33-461.el9.noarch
perl-if-0.60.800-481.el9.noarch
perl-interpreter-4:5.32.1-481.el9.x86_64
perl-libnet-3.13-4.el9.noarch
perl-libs-4:5.32.1-481.el9.x86_64
perl-mro-1.23-481.el9.x86_64
perl-overload-1.31-481.el9.noarch
perl-overloading-0.02-481.el9.noarch
perl-parent-1:0.238-460.el9.noarch
perl-podlators-1:4.14-460.el9.noarch
perl-subs-1.03-481.el9.noarch
perl-vars-1.05-481.el9.noarch
policycoreutils-python-utils-3.5-2.el9.noarch
protobuf-lite-3.14.0-13.el9.x86_64
python3-audit-3.0.7-104.el9.x86_64
python3-distro-1.5.0-7.el9.noarch
python3-libsemanage-3.5-2.el9.x86_64
python3-policycoreutils-3.5-2.el9.noarch
python3-setools-4.4.4-1.el9.x86_64
python3-setuptools-53.0.0-12.el9.noarch
Complete!
[root@DB01 ~]#
在DB01配置MySQL
[root@DB01 ~]# vi /etc/my.cnf.d/charset.cnf
[root@DB01 ~]# cat /etc/my.cnf.d/charset.cnf
# create new
# set default charset
# for the case of 4 bytes UTF-8, specify [utf8mb4]
[mysqld]
character-set-server = utf8mb4
[client]
default-character-set = utf8mb4
[root@DB01 ~]# systemctl enable --now mysqld
Created symlink /etc/systemd/system/multi-user.target.wants/mysqld.service → /usr/lib/systemd/system/mysqld.service.
[root@DB01 ~]# mysql_secure_installation
mysql_secure_installation: [ERROR] unknown variable 'default-character-set=utf8mb4'.
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: 0
Please set the password for root here.
New password:
Re-enter new password:
Estimated strength of the password: 50
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!
创建zabbix所需的数据库,并初始化数据库
[root@DB01 ~]# 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.32 Source distribution
Copyright (c) 2000, 2023, 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> create database zabbix character set utf8mb4 collate utf8mb4_bin;
Query OK, 1 row affected (0.01 sec)
mysql> create user 'zabbix'@'%' identified by 'password';
Query OK, 0 rows affected (0.01 sec)
mysql> grant all privileges on zabbix.* to 'zabbix'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> set global log_bin_trust_function_creators = 1;
Query OK, 0 rows affected (0.00 sec)
mysql> quit;
Bye
[root@DB01 ~]#
在zabbix01或者zabbix02拷贝数据库文件至DB01数据库,并导入数据库
[root@zabbix01 ~]# scp /usr/share/zabbix-sql-scripts/mysql/server.sql.gz root@db01:/root/
root@db01's password:
server.sql.gz 100% 3954KB 47.5MB/s 00:00
[root@DB01 ~]# zcat server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
Enter password:
[root@DB01 ~]#
参照zabbix官网意见,数据库导入完毕后,禁用log_bin_trust_function_creators
mysql> set global log_bin_trust_function_creators = 0;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
在zabbix01和zabbix02修改zabbix配置文件
1)zabbix01
[root@zabbix01 ~]# vi /etc/zabbix/zabbix_server.conf
[root@zabbix01 ~]# cat /etc/zabbix/zabbix_server.conf | grep -v '^$' | grep -v '^#'
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/run/zabbix/zabbix_server.pid
SocketDir=/run/zabbix
DBHost=DB01
DBName=zabbix
DBUser=zabbix
DBPassword=password
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
LogSlowQueries=3000
StatsAllowedIP=127.0.0.1
[root@zabbix01 ~]#
2)zabbix02
[root@zabbix02 ~]# vi /etc/zabbix/zabbix_server.conf
[root@zabbix02 ~]# cat /etc/zabbix/zabbix_server.conf | grep -v '^$' | grep -v '^#'
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/run/zabbix/zabbix_server.pid
SocketDir=/run/zabbix
DBHost=DB01
DBName=zabbix
DBUser=zabbix
DBPassword=password
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
LogSlowQueries=3000
StatsAllowedIP=127.0.0.1
[root@zabbix02 ~]#
在zabbix01和zabbix02启动服务
zabbix01
[root@zabbix01 ~]# systemctl start zabbix-server zabbix-agent httpd php-fpm
[root@zabbix01 ~]# systemctl enable zabbix-server zabbix-agent httpd php-fpm
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-server.service → /usr/lib/systemd/system/zabbix-server.service.
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-agent.service → /usr/lib/systemd/system/zabbix-agent.service.
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
Created symlink /etc/systemd/system/multi-user.target.wants/php-fpm.service → /usr/lib/systemd/system/php-fpm.service.
[root@zabbix01 ~]#
zabbix02
[root@zabbix02 ~]# systemctl start zabbix-server zabbix-agent httpd php-fpm
[root@zabbix02 ~]# systemctl enable zabbix-server zabbix-agent httpd php-fpm
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-server.service → /usr/lib/systemd/system/zabbix-server.service.
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-agent.service → /usr/lib/systemd/system/zabbix-agent.service.
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
Created symlink /etc/systemd/system/multi-user.target.wants/php-fpm.service → /usr/lib/systemd/system/php-fpm.service.
[root@zabbix02 ~]#
访问http://192.168.10.133/zabbix/setup.php
至此zabbix安装完毕,下一节将在此章节基础上配置zabbix HAcluster!