Quick upgrade of ZABBIX version 5.0

Keywords: Linux Zabbix PHP Nginx MySQL

Zabbix 5.0 has added many new functions, such as vertical menu, hidden menu, test items in user interface, limit agent check, find and replace preprocessing step ES7 support, etc.. Let's deploy and experience Zabbix 5.0
 
 

Upgrade Notice

 
 
Upgrade requirements
PHP version
PHP version has been upgraded from minimum 5.4.0 to 7.2.0
Database version
  • MySQL 5.5.62
  • MariaDB 10.0.37
  • PostgreSQL 9.2.24
  • Oracle 11.2
ZABBIX 5.0.0 beta 1 official upgrade requirements document
https://www.zabbix.com/documentation/5.0/manual/installation/upgrade/packages/rhel_centos

  

 <script src="https://cdn.bootcss.com/clipboard.js/2.0.4/clipboard.min.js"></script>
 <script src="https://blog-static.cnblogs.com/files/wuliytTaotao/cp.js"></script>

 

Pay attention to upgrade
You must be very careful when upgrading from a previous version to Zabbix 5.0.
Packages in Red Hat Software Collections are designed to avoid file conflicts with files in the primary repository.
Each package is installed in a separate environment dedicated to its group.
 

System environment

cat  /etc/redhat-release 
CentOS Linux release 7.6.1810 (Core)
nginx   -vnginx 
version: nginx/1.16.1
[root@shvm01 ~]# rpm -qa |grep zabbix
zabbix-release-4.4-1.el7.noarch
zabbix-web-4.4.7-1.el7.noarch
zabbix-server-mysql-4.4.7-1.el7.x86_64
zabbix-web-mysql-4.4.7-1.el7.noarch
zabbix-agent-4.4.7-1.el7.x86_64
[root@shvm01 ~]# mysql -V
mysql  Ver 14.14 Distrib 5.7.29, for Linux (x86_64) using  EditLine wrapper

  

Preparation before upgrading

Official upgrade document

https://www.zabbix.com/documentation/5.0/manual/installation/install_from_packages/frontend_on_rhel7

  

At the beginning of Zabbix 5.0.0beta1, PHP version 7.2 and above is required for the front-end. Currently, Centos 7 only provides PHP 5.4. ZABBIX officially recommends using PHP and Nginx in Red Hat Software Collections to upgrade Zabbix 5.0.0beta1. If you upgrade with repo.zabbix.com package, you will find that the front-end package is missing from yum search.
 

Zabbix backup operation

Backup ZB profile
mkdir  -p /home/backup/zabbix-backup
cp /etc/zabbix/zabbix_server.conf     /home/backup/zabbix-backup
cp /etc/zabbix/zabbix_agentd.conf    /home/backup/zabbix-backup
cp /etc/zabbix/web/zabbix.conf.php  /home/backup/zabbix-backup
cp -R /usr/share/zabbix/    /home/backup/zabbix-backup
cp –R /usr/share/doc/zabbix-*  /home/backup/zabbix-backup

  

Database backup
mysql root@localhost:(none)> select count(8) tables,table_schema from information_schema.tables where table_schema = 'zabbix';
+--------+--------------+
| tables | table_schema |
+--------+--------------+
| 149    | zabbix       |
+--------+--------------+
1 row in set
Time: 0.014s
mysqldump -uzabbix -pzabbix --opt --skip-lock-tables  zabbix | gzip > /home/backup/zabbix_$(date +%Y%m%d_%H%M%S).sql.gz
[root@shvm01 doc]# ll /home/backup/
Total dosage 5120
-rw-r--r-- 1 root root      20 4month  23 10:48 zabbix_20200423_104832.sql.gz
-rw-r--r-- 1 root root 5233446 4month  23 10:48 zabbix_20200423_104849.sql.gz
drwxr-xr-x 3 root root    4096 4month  23 10:45 zabbix-backup

  

 

Stop old version service

Stop ZABBIX server ZABBIX agent nginx PHP FPM service
systemctl stop zabbix-server zabbix-agent nginx php-fpm
systemctl disable nginx php-fpm

  

Uninstall old version services

yum remove zabbix-web-*  nginx* php-fpm* -y

  

Zabbix upgrade operation

Upgrade new services

#Install the SCL repository
yum install centos-release-scl -y
#Update repository package
rpm -Uvh https://repo.zabbix.com/zabbix/4.5/rhel/7/x86_64/zabbix-release-4.5-2.el7.noarch.rpm
yum clean all
//Upgrade Zabbix package
yum upgrade zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get -y
#Easy to install PHP dependency from red hat software collection ZABBIX web package
yum install  https://repo.zabbix.com/zabbix/4.5/rhel/7/x86_64/deprecated/zabbix-web-deps-scl-5.0.0-0.5beta1.el7.noarch.rpm -y
yum install https://repo.zabbix.com/zabbix/4.5/rhel/7/x86_64/deprecated/zabbix-web-5.0.0-0.5beta1.el7.noarch.rpm -y 
#Zabbix Web front end of MySQL (scl version)
yum install https://repo.zabbix.com/zabbix/4.5/rhel/7/x86_64/deprecated/zabbix-web-mysql-scl-5.0.0-0.5beta1.el7.noarch.rpm -y
#When installing the zabbix front-end configuration of Nginx (scl version), sometimes you may encounter network problems and perform the installation several times
yum install https://repo.zabbix.com/zabbix/4.5/rhel/7/x86_64/deprecated/zabbix-nginx-conf-scl-5.0.0-0.5beta1.el7.noarch.rpm -y

  

Modify Nginx and PHP configuration files

Modifying the time zone in a PHP file
vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
....
listen.acl_users = apache,nginx
listen.allowed_clients = 127.0.0.1,10.0.0.6
...

  

Modify nginx configuration
 vim /etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf
 ...
server {
        listen          80;
        server_name     10.0.0.6;
        root    /usr/share/zabbix;
  ...

  

Validate database

mysql root@localhost:(none)> select count(8) tables,table_schema from information_schema.tables where table_schema = 'zabbix';
+--------+--------------+
| tables | table_schema |
+--------+--------------+
| 154    | zabbix       |
+--------+--------------+
1 row in set
Time: 0.026s
mysql root@localhost:(none)>

  

Start service

systemctl restart rh-nginx116-nginx rh-php72-php-fpm
systemctl enable rh-nginx116-nginx rh-php72-php-fpm zabbix-server zabbix-agent
systemctl start zabbix-server  

  

Verify view

[root@shvm01 root]#  zabbix_server -V
zabbix_server (Zabbix) 5.0.0beta1
Revision d3cf98e98b 14 April 2020, compilation time: Apr 14 2020 10:17:42
 
Copyright (C) 2020 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.
 
This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.openssl.org/).
 
Compiled with OpenSSL 1.0.1e-fips 11 Feb 2013
Running with OpenSSL 1.0.1e-fips 11 Feb 2013

  

Upgrade successful

Visit zabbix web

http://server_ip
 

New features

Vertical menu
The modern vertical menu in the sidebar replaces the horizontal menu in the new version.
Menus can be collapsed or completely hidden
Collapsible menu with icons only.
Hide the menu.

Test items in user interface

 
Extended range of numeric (floating point) values
Numeric (floating-point) data types now support about 15 bit precision, ranging from about - 1.79E + 308 to 1.79E + 308 (except PostgreSQL 11 and earlier). For new installations, this is the default. For an upgraded installation, a manual patch must be applied.
 
There are more functions not listed one by one
 
Reference article: Operation and maintenance development story

Posted by dmcentire on Thu, 07 May 2020 23:02:03 -0700