zabbix_upgrade/upgrade_5.4.x_to_6.0.x.md

148 lines
2.0 KiB
Markdown
Raw Normal View History

2022-03-15 13:22:59 +01:00
# Zabbix Upgrade v5.4.x to v6.0.x (Debian 10, PostgreSQL, TimescaleDB)
2022-03-15 13:34:13 +01:00
Make sure to make a backup of the server(s) before you proceed.
2022-03-15 13:22:59 +01:00
## Upgrade TimescaleDB
### Install new timescaledb version
```
apt install timescaledb-2-2.6.0-postgresql-12
```
### Connect to Postgresql
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
sudo -u postgres psql -X
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
### Switch to database zabbix
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
\c zabbix
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
### Update the postgresql extension
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
ALTER EXTENSION timescaledb UPDATE;
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
### Verify that the new timescaledb version is used
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
\dx timescaledb
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
## Upgrade PostgreSQL to 14
### Install Postgresql 14
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
apt install postgresql-14
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
### Install Timescaledb
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
apt install timescaledb-2-2.6.0-postgresql-14
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
### Stop all postgresql clusters
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
service postgresql@12-main stop
2022-03-15 13:34:13 +01:00
```
```
2022-03-15 13:22:59 +01:00
service postgresql@14-main stop
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
### Drop the new postgresql cluster
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
pg_dropcluster 14 main
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
### Run pg_upgradecluster to upgrade the cluster to v14
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
pg_upgradecluster -v 14 --method=upgrade --link 12 main
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
### Make sure the new cluster ist listening on port 5432
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
netstat -tapen | grep LISTEN
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
### Drop the old postgresql cluster
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
pg_dropcluster 12 main
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
### Verify they timescaledb version on the zabbix db
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
sudo -u postgres psql
2022-03-15 13:34:13 +01:00
```
```
2022-03-15 13:22:59 +01:00
\c zabbix
2022-03-15 13:34:13 +01:00
```
```
2022-03-15 13:22:59 +01:00
\dx
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
## Upgrade Zabbix from 5.4.x to 6.0 (Steps for Debian 10)
### Remove the old repository list
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
rm -Rf /etc/apt/sources.list.d/zabbix.list
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
### Install the new repository list
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
wget https://repo.zabbix.com/zabbix/6.0/debian/pool/main/z/zabbix-release/zabbix-release_6.0-1+debian10_all.deb
2022-03-15 13:34:13 +01:00
```
```
2022-03-15 13:22:59 +01:00
dpkg -i zabbix-release_6.0-1+debian10_all.deb
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
2022-03-15 13:38:44 +01:00
### Update the repository cache
2022-03-15 13:22:59 +01:00
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
apt clean
2022-03-15 13:34:13 +01:00
```
```
2022-03-15 13:22:59 +01:00
apt update
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
### Verify that zabbix will be upgraded to v6
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
apt list --upgradeable
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
### Install all upgrades
2022-03-15 13:34:13 +01:00
```
2022-03-15 17:09:35 +01:00
apt upgrade
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
### Start zabbix Server
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
service zabbix-server start
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
### Check the log file for errors
2022-03-15 13:34:13 +01:00
```
2022-03-15 13:22:59 +01:00
vim /var/log/zabbix/zabbix_server.log
2022-03-15 13:34:13 +01:00
```
### Verify the web interface is up and running
2022-03-15 13:22:59 +01:00
2022-03-15 13:34:13 +01:00
## Enjoy using Zabbix :-)