CentOS7.0下Zabbix3.4至Zabbix4.0的升级步骤(Proxy)

作者:@skyflask
转载本文请注明出处:https://www.cnblogs.com/skyflask/p/12703721.html


目录

一、查看当前各软件版本号
OS层面
业务层面
二、备份数据
1、备份数据库
 2、文件备份
三、升级zabbix-proxy
1、停止服务
2、升级zabbix源
3、升级zabbix
 四、升级中遇到的问题
1、Processing Dependency: libpcre.so.0()(64bit) for package

一、查看当前各软件版本号

OS层面

操作系统版本为centos6.5

1
2
[root@reg zabbix]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

  

内核版本为2.6.32,64bit

1
2
[root@reg zabbix]# uname -a
Linux reg.xuequn.com 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

  

业务层面

 zabbix-proxy版本3.0.3

1
2
3
4
5
6
7
8
9
[root@reg zabbix]# zabbix_proxy -V
zabbix_proxy (Zabbix) 3.0.3
Revision 60173 18 May 2016, compilation time: May 23 2016 08:57:57
 
Copyright (C) 2016 Zabbix SIA
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it according to
the license. There is NO WARRANTY, to the extent permitted by law.
[root@reg zabbix]#

  

1
2
3
4
5
6
[root@reg zabbix]# rpm -qa|grep zabbix
zabbix-proxy-mysql-3.0.3-1.el7.x86_64
zabbix-get-3.0.30-2.el7.x86_64
zabbix-release-3.0-1.el7.noarch
zabbix-agent-3.0.3-1.el7.x86_64
[root@reg zabbix]#

  

二、备份数据

1、备份数据库

说明:proxy库文件不大,可使用mysqldump方式备份

1
mysqldump -uzabbix –pzabbix --skip-lock-tables zabbix_proxy > zabbix_proxybak.sql

  

 2、文件备份

主要是备份配置文件,其他可不备份

 cat /etc/zabbix/zabbix_proxy.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
LogFile=/var/log/zabbix/zabbix_proxy.log
PidFile=/var/run/zabbix/zabbix_proxy.pid
Server=10.11.100.99
Hostname=private-proxy
DBName=zabbix_proxy
DBUser=zabbix
DBPassword=zabbix
ProxyLocalBuffer=24
ProxyOfflineBuffer=24
ConfigFrequency=300
DataSenderFrequency=3
StartPollers=100
StartIPMIPollers=2
StartPollersUnreachable=2
StartTrappers=10
StartPingers=15
StartHTTPPollers=3
StartVMwareCollectors=3
VMwareCacheSize=40M
StartSNMPTrapper=0
CacheSize=256M
StartDBSyncers=4
HistoryCacheSize=256M
Timeout=30
LogSlowQueries=10000

  

三、升级zabbix-proxy

1、停止服务

1
2
service zabbix-proxy stop
service zabbix-agent stop

  

2、升级zabbix源

CentOS6

1
rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/6/x86_64/zabbix-release-4.0-2.el6.noarch.rpm

  

CentOS7

1
rpm -Uvh http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm

  

3、升级zabbix

1
2
yum clean all
yum upgrade  zabbix-sender zabbix-agent zabbix-proxy-mysql  zabbix-java-gateway

  

 四、升级中遇到的问题

1、Processing Dependency: libpcre.so.0()(64bit) for package

报错信息如下:

yum upgrade  zabbix-sender zabbix-agent zabbix-proxy-mysql  zabbix-java-gateway

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
[root@reg zabbix-install]# yum upgrade  zabbix-sender zabbix-agent zabbix-proxy-mysql  zabbix-java-gateway
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror-hk.koddos.net
 * epel: mirrors.aliyun.com
 * extras: mirror-hk.koddos.net
 * updates: mirror-hk.koddos.net
Package(s) zabbix-sender available, but not installed.
Package(s) zabbix-java-gateway available, but not installed.
Resolving Dependencies
--> Running transaction check
---> Package zabbix-agent.x86_64 0:3.0.3-1.el7 will be updated
---> Package zabbix-agent.x86_64 0:4.0.19-1.el6 will be an update
--> Processing Dependency: libpcre.so.0()(64bit) for package: zabbix-agent-4.0.19-1.el6.x86_64
---> Package zabbix-proxy-mysql.x86_64 0:3.0.3-1.el7 will be updated
---> Package zabbix-proxy-mysql.x86_64 0:4.0.19-1.el6 will be an update
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: zabbix-proxy-mysql-4.0.19-1.el6.x86_64
--> Processing Dependency: libevent-1.4.so.2()(64bit) for package: zabbix-proxy-mysql-4.0.19-1.el6.x86_64
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: zabbix-proxy-mysql-4.0.19-1.el6.x86_64
--> Processing Dependency: libpcre.so.0()(64bit) for package: zabbix-proxy-mysql-4.0.19-1.el6.x86_64
--> Processing Dependency: libnetsnmp.so.20()(64bit) for package: zabbix-proxy-mysql-4.0.19-1.el6.x86_64
--> Finished Dependency Resolution
Error: Package: zabbix-proxy-mysql-4.0.19-1.el6.x86_64 (zabbix)
           Requires: libpcre.so.0()(64bit)
Error: Package: zabbix-agent-4.0.19-1.el6.x86_64 (zabbix)
           Requires: libpcre.so.0()(64bit)
Error: Package: zabbix-proxy-mysql-4.0.19-1.el6.x86_64 (zabbix)
           Requires: libevent-1.4.so.2()(64bit)
Error: Package: zabbix-proxy-mysql-4.0.19-1.el6.x86_64 (zabbix)
           Requires: libmysqlclient.so.16(libmysqlclient_16)(64bit)
Error: Package: zabbix-proxy-mysql-4.0.19-1.el6.x86_64 (zabbix)
           Requires: libnetsnmp.so.20()(64bit)
Error: Package: zabbix-proxy-mysql-4.0.19-1.el6.x86_64 (zabbix)
           Requires: libmysqlclient.so.16()(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

  

错误原因:在CentOS7下,安装的zabbix源为CentOS6的

修改yum配置文件,修改为7

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://repo.zabbix.com/zabbix/4.0/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
 
[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=http://repo.zabbix.com/zabbix/4.0/rhel/7/$basearch/debuginfo/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=1
 
[zabbix-deprecated]
name=Zabbix Official Repository deprecated - $basearch
baseurl=http://repo.zabbix.com/zabbix/4.0/rhel/7/$basearch/deprecated
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
 
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1

  

再次升级安装,成功。

yum upgrade  zabbix-sender-4.0.18 zabbix-agent-4.0.18 zabbix-proxy-mysql-4.0.18  zabbix-java-gateway-4.0.18

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Loaded plugins: fastestmirror
zabbix                                                                                                       | 2.9 kB  00:00:00    
zabbix-non-supported                                                                                         |  951 B  00:00:00    
zabbix/x86_64/primary_db                                                                                     | 148 kB  00:00:00    
zabbix-non-supported/x86_64/primary                                                                          | 1.6 kB  00:00:00    
Loading mirror speeds from cached hostfile
 * base: mirror-hk.koddos.net
 * epel: mirrors.aliyun.com
 * extras: mirror-hk.koddos.net
 * updates: mirror-hk.koddos.net
zabbix-non-supported                                                                                                            4/4
Package(s) zabbix-sender-4.0.18 available, but not installed.
Package(s) zabbix-java-gateway-4.0.18 available, but not installed.
Resolving Dependencies
--> Running transaction check
---> Package zabbix-agent.x86_64 0:3.0.3-1.el7 will be updated
---> Package zabbix-agent.x86_64 0:4.0.18-1.el7 will be an update
---> Package zabbix-proxy-mysql.x86_64 0:3.0.3-1.el7 will be updated
---> Package zabbix-proxy-mysql.x86_64 0:4.0.18-1.el7 will be an update
--> Processing Dependency: libevent-2.0.so.5()(64bit) for package: zabbix-proxy-mysql-4.0.18-1.el7.x86_64
--> Running transaction check
---> Package libevent.x86_64 0:2.0.21-4.el7 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
====================================================================================================================================
 Package                               Arch                      Version                            Repository                 Size
====================================================================================================================================
Updating:
 zabbix-agent                          x86_64                    4.0.18-1.el7                       zabbix                    419 k
 zabbix-proxy-mysql                    x86_64                    4.0.18-1.el7                       zabbix                    780 k
Installing for dependencies:
 libevent                              x86_64                    2.0.21-4.el7                       base                      214 k
 
Transaction Summary
====================================================================================================================================
Install             ( 1 Dependent package)
Upgrade  2 Packages
 
Total download size: 1.4 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/3): libevent-2.0.21-4.el7.x86_64.rpm                                                                      | 214 kB  00:00:00    
warning: /var/cache/yum/x86_64/7/zabbix/packages/zabbix-agent-4.0.18-1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY
Public key for zabbix-agent-4.0.18-1.el7.x86_64.rpm is not installed
(2/3): zabbix-agent-4.0.18-1.el7.x86_64.rpm                                                                  | 419 kB  00:00:01    
(3/3): zabbix-proxy-mysql-4.0.18-1.el7.x86_64.rpm                                                            | 780 kB  00:00:01    
------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                               777 kB/s | 1.4 MB  00:00:01    
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-4.0-2.el6.noarch (installed)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : libevent-2.0.21-4.el7.x86_64                                                                                     1/5
  Updating   : zabbix-proxy-mysql-4.0.18-1.el7.x86_64                                                                           2/5
warning: /etc/zabbix/zabbix_proxy.conf created as /etc/zabbix/zabbix_proxy.conf.rpmnew
  Updating   : zabbix-agent-4.0.18-1.el7.x86_64                                                                                 3/5
warning: /etc/zabbix/zabbix_agentd.conf created as /etc/zabbix/zabbix_agentd.conf.rpmnew
  Cleanup    : zabbix-proxy-mysql-3.0.3-1.el7.x86_64                                                                            4/5
  Cleanup    : zabbix-agent-3.0.3-1.el7.x86_64                                                                                  5/5
  Verifying  : libevent-2.0.21-4.el7.x86_64                                                                                     1/5
  Verifying  : zabbix-agent-4.0.18-1.el7.x86_64                                                                                 2/5
  Verifying  : zabbix-proxy-mysql-4.0.18-1.el7.x86_64                                                                           3/5
  Verifying  : zabbix-agent-3.0.3-1.el7.x86_64                                                                                  4/5
  Verifying  : zabbix-proxy-mysql-3.0.3-1.el7.x86_64                                                                            5/5
 
Dependency Installed:
  libevent.x86_64 0:2.0.21-4.el7                                                                                                   
 
Updated:
  zabbix-agent.x86_64 0:4.0.18-1.el7                            zabbix-proxy-mysql.x86_64 0:4.0.18-1.el7                          
 
Complete!

  

 

posted @   skyflask  阅读(990)  评论(0编辑  收藏  举报
编辑推荐:
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 上周热点回顾(3.3-3.9)
· AI 智能体引爆开源社区「GitHub 热点速览」
历史上的今天:
2018-04-15 CSS快速入门-实用技巧
2018-04-15 CSS快速入门-盒子模型
点击右上角即可分享
微信分享提示