centos7.5zabbix4.0升级到zabbix5.0
centos7.5zabbix4.0升级到zabbix5.0
1 更新yum源 # yum erase zabbix-release-4.0-1.el7.noarch # rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm # sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo 2 开启前端服务 # vim /etc/yum.repos.d/zabbix.repo [zabbix-frontend] name=Zabbix Official Repository frontend - $basearch baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/$basearch/frontend enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591 3 停止zabbix服务 # yum clean all # yum list | grep zabbix # systemctl stop httpd # systemctl stop zabbix-server.service # systemctl stop zabbix-agent.service 4 升级zabbix服务 # yum upgrade zabbix-server-mysql zabbix-web-mysql zabbix-agent 5 升级zabbix前端 # yum remove zabbix-web # yum install centos-release-scl -y # yum install zabbix-web-mysql-scl zabbix-apache-conf-scl -y 6 修改php时区 # vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf php_value[date.timezone] = Asia/shanghai 7 启动zabbix并设置开机自启动 # systemctl start zabbix-server zabbix-agent httpd rh-php72-php-fpm # systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm 8 为mysql打补丁(因为Zabbix的历史数据和趋势数据的数值(浮点型)数据类型支持的精度更高) # wget https://git.zabbix.com/projects/ZBX/repos/zabbix/raw/database/mysql/double.sql # cat double.sql ALTER TABLE trends MODIFY value_min DOUBLE PRECISION DEFAULT '0.0000' NOT NULL, MODIFY value_avg DOUBLE PRECISION DEFAULT '0.0000' NOT NULL, MODIFY value_max DOUBLE PRECISION DEFAULT '0.0000' NOT NULL; ALTER TABLE history MODIFY value DOUBLE PRECISION DEFAULT '0.0000' NOT NULL; # mysql -uroot -p MariaDB [(none)]> use zabbix; MariaDB [zabbix]> ALTER TABLE trends MODIFY value_min DOUBLE PRECISION DEFAULT '0.0000' NOT NULL, MODIFY value_avg DOUBLE PRECISION DEFAULT '0.0000' NOT NULL, MODIFY value_max DOUBLE PRECISION DEFAULT '0.0000' NOT NULL; MariaDB [zabbix]> ALTER TABLE history MODIFY value DOUBLE PRECISION DEFAULT '0.0000' NOT NULL; MariaDB [zabbix]> exit; 更新配置文件,添加如下内容 # vim /etc/zabbix/web/zabbix.conf.php $DB['DOUBLE_IEEE754'] = true; 9 重启zabbix-server # systemctl restart zabbix-server
10 升级后注意个组件版本
[root@localhost ~]# rpm -qa|grep zabbix
zabbix-release-5.0-1.el7.noarch
zabbix-web-5.0.21-1.el7.noarch
zabbix-web-deps-scl-5.0.21-1.el7.noarch
zabbix-server-mysql-5.0.21-1.el7.x86_64
zabbix-web-mysql-scl-5.0.21-1.el7.noarch
zabbix-apache-conf-scl-5.0.21-1.el7.noarch
zabbix-java-gateway-4.0.3-1.el7.x86_64 ----------需要更新
zabbix-get-4.0.8-1.el7.x86_64 ----------需要更新
zabbix-agent-5.0.21-1.el7.x86_64
分别安装更新以下组件
yum install -y zabbix-java-gateway*
yum install -y zabbix-get-*
确保已经启动systemctl status zabbix-java-gateway