Linux Programmer | RHCE | RHCSA

Search This Blog

Upgrade zabbix 6.0.x to 6.2.x


Note: 

zabbix 6.2 is not working in ubuntu 18.04, required atleast ubuntu 20.04 version.
 
 


Installation steps:

1. Create new server with ubuntu 22.04/20.4 server OS
 
 
2. Packages installation

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt install apache2 php php-mysql php-mysqlnd php-ldap php-bcmath php-mbstring php-gd php-pdo php-xml libapache2-mod-php

 
3. php configurations,

Open nano /etc/php/8.1/apache2/php.ini file and make below changes,
 

post_max_size = 16M
upload_max_filesize = 2M
max_execution_time 300
max_input_time = 300
memory_limit 128M
session.auto_start = 0
mbstring.func_overload = 0
date.timezone = Asia/Kolkata
 

Change timezone:

dpkg-reconfigure tzdata 

Restart apache service.

sudo systemctl restart apache2.service

4. Install  mariadb database.

sudo apt-get install mariadb-server mariadb-client libmysqld-dev
sudo systemctl start mariadb

 
Setup database passwords.

sudo mysql_secure_installation

Login,

mysql -uroot -p<root- user – password >


Create user:

MariaDB [(none)]> create database zabbixdb character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all privileges on zabbixdb.* to 'zabbixuser'@'localhost' identified by 'password1';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit

 
5. Download and Install zabbix 6.2

wget https://repo.zabbix.com/zabbix/6.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.2-4%2Bubuntu22.04_all.deb
 
dpkg -i zabbix-release_6.2-4+ubuntu22.04_all.deb
 
apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent
systemctl start zabbix-server
systemctl status zabbix-server

 
6. Start Zabbix in browser:


http://zabbix-ip/zabbix
Perform all the steps which needs to configure zabbix.
 

7. Database Migration,

Take databackup from old server:

mysqldump -h localhost -u'root' -p'password' --single-transaction 'zabbixdb' | gzip > zabbix_backup.sql.gz

 
Run below query before starting database upgradation process, 

 mysql> SET GLOBAL log_bin_trust_function_creators = 1;

Restore on new server:

zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbixuser -p zabbixdb 

Once it is restored then, start the zabbix-server. 

systemctl start zabbix-server

 
If server not started then check logs into , /var/log/zabbix/zabbix_server.log Solution: 

Remove tables which are showing error in it. 


For e.g.

drop table userdirectory;
drop table host_rtdata;
drop table changelog; 

Change url in users table, 

This URL parameter will redirect after login with the user. So this is must.

select * from users;
 
update users set url="http://new-zabbix-url/zabbix/zabbix.php?action=dashboard.view&dashboardid=90" where url="http://old-zabbix-url/zabbix/zabbix.php?action=dashboard.view&dashboardid=90";

 
Once the upgrade has been successfully completed, log_bin_trust_function_creators can be disabled:

mysql> SET GLOBAL log_bin_trust_function_creators = 0;



No comments:

Post a Comment

Gitlab_CICD_Sample Deployment

Gitlab CICD Stages: build - Create build of project. - If it is docker project which contains dockerfile then, create docker image - push in...