网络环境原因,更换为国内镜像源即可
过程: 根据官方给出的指示步骤Download and install Zabbix
报错:
Error downloading packages:
zabbix-server-mysql-5.0.2-1.el7.x86_64: [Errno 256] No more mirrors to try.
zabbix-agent-5.0.2-1.el7.x86_64: [Errno 256] No more mirrors to try.
解决方法:
$ cat /etc/yum.repos.d/zabbix.repo
# 篇幅有限只给出会修改的baseurl字段显示
[zabbix]
baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/
[zabbix-frontend]
baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/
[zabbix-debuginfo]
baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/
[zabbix-non-supported]
baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/
编辑zabbix.repo文件,替换baseurl为阿里云镜像源地址
可以到阿里云Zabbix镜像查看对应的镜像源地址
# 注意路径中是 /zabbix/zabbix/
[zabbix]
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/$basearch/
[zabbix-frontend]
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/$basearch/frontend
[zabbix-debuginfo]
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/$basearch/debuginfo/
# 注意路径中要有一个 /zabbbix/
[zabbix-non-supported]
baseurl=https://mirrors.aliyun.com/zabbix/non-supported/rhel/7/$basearch/
再次执行安装命令
$ yum clean all
$ yum install zabbix-server-mysql zabbix-agent
提示安装完成
Installed:
zabbix-agent.x86_64 0:5.0.2-1.el7 zabbix-server-mysql.x86_64 0:5.0.2-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-4.el7 net-snmp-libs.x86_64 1:5.7.2-48.el7_8.1 unixODBC.x86_64 0:2.3.1-14.el7
Complete!