Ссылки:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
https://bestmonitoringtools.com/upgrade-zabbix-to-the-latest-version/ https://serveradmin.ru/obnovlenie-zabbix-4-4-do-5-0/ https://serveradmin.ru/ustanovka-i-nastrojka-zabbix-5-0/ http://alexvaleev.ru/mysql-row-size-too-large/ https://www.zabbix.com/documentation/5.0/manual/installation/upgrade_notes_500 https://www.zabbix.com/documentation/2.0/ru/manual/installation/upgrade https://www.tyler-wright.com/zabbix34to40-error-events-table/ https://mariadb.com/kb/en/troubleshooting-row-size-too-large-errors-with-innodb/ http://mithrandir.ru/professional/databases/mysql-row-size-too-large.html https://www.google.com/ "The Zabbix database version does not match current requirements. Your database version: 4030046. Required version: 5000000. Please contact your system administrator." "zabbix 5 как обновить базу вручную" "Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual." The maximum row size for the used table type, not counting BLOBs, is 8126. "Row size too large?" |
Backup zabbix
1 2 3 4 5 6 7 8 9 10 11 12 |
0. выключаем zabbix-server systemctl stop zabbix-server 1. создаем папки для бэкапа mkdir -p /opt/zabbix_backup/bin_files /opt/zabbix_backup/conf_files /opt/zabbix_backup/doc_files mkdir -p /opt/zabbix_backup/web_files /opt/zabbix_backup/db_files 2. Бэкпим web файлы cp -rp /usr/share/zabbix/ /opt/zabbix_backup/web_files 3. Бэкапим databases mysql mysqldump -h localhost -u'root' -p'rootDBpass' --single-transaction 'zabbix' | gzip > /opt/zabbix_backup/db_files/zabbix_backup.sql.gz |
Update zabbix debian stage 1
1 2 3 4 5 6 7 8 9 10 11 |
0. сносим zabbix-release dpkg --purge zabbix-release 1. update sudo wget https://repo.zabbix.com/zabbix/5.0/debian/pool/main/z/zabbix-release/zabbix-release_5.0-1+$(lsb_release -sc)_all.deb sudo dpkg -i zabbix-release_5.0-1+$(lsb_release -sc)_all.deb apt update apt install -y --only-upgrade zabbix-server-mysql zabbix-frontend-php 2.ставим zabbix-apache-conf apt-get install -y zabbix-apache-conf |
Update zabbix ubuntu stage 1
1 2 3 4 5 6 7 8 9 10 11 |
0. сносим zabbix-release dpkg --purge zabbix-release 1. update wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+$(lsb_release -sc)_all.deb dpkg -i zabbix-release_5.0-1+$(lsb_release -sc)_all.deb apt update apt install -y --only-upgrade zabbix-server-mysql zabbix-frontend-php 2. ставим zabbix-apache-conf apt-get install -y zabbix-apache-conf |
Update zabbix Centos stage 1
1 2 3 4 |
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/$(rpm -E %{rhel})/x86_64/zabbix-release-5.0-1.el$(rpm -E %{rhel}).noarch.rpm dnf clean all dnf upgrade -y zabbix-server-mysql zabbix-web-mysql dnf install -y zabbix-apache-conf |
Zabbix update stage 2
1 2 3 4 5 6 7 8 9 10 11 |
!!! При запуске zabbix начнется процесс обновления базы данных 0. Запускаем zabbix-server systemctl start zabbix-server 1. Наблюдаем за логами zabbix cat /var/log/zabbix/zabbix_server.log | grep database 2. Очищаем кеш браузера и подключаемся к zabbix 3. Проверяем версию zabbix zabbix_server -V |
Проверка databases mysql
1 2 3 4 5 6 7 8 9 |
mysql -u'zabbix' -p'zabbixDBpass' zabbix -e "show create table history;" | history | CREATE TABLE history ( itemid bigint(20) unsigned NOT NULL, clock int(11) NOT NULL DEFAULT '0', value double(16,4) NOT NULL DEFAULT '0.0000', ns int(11) NOT NULL DEFAULT '0', KEY history_1 (itemid,clock) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin | |
apply it PostGreSql users need to change “mysql” with “postgresql” in the URL path:
1 2 3 |
!!! Применяется после обновления с postgres на mysql wget https://git.zabbix.com/projects/ZBX/repos/zabbix/raw/database/mysql/double.sql mysql -u'zabbix' -p'zabbixDBpass' zabbix < double.sql |
Проверка базы данных zabbix mysql
1 2 3 4 5 6 7 8 |
mysql -u'zabbix' -p'zabbixDBpass' zabbix -e "show create table history;" history | CREATE TABLE history ( itemid bigint(20) unsigned NOT NULL, clock int(11) NOT NULL DEFAULT '0', value double NOT NULL DEFAULT '0', ns int(11) NOT NULL DEFAULT '0', KEY history_1 (itemid,clock) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin | |
Убрать предупреждения базы данных
1 2 3 4 5 6 |
Now we need to add the line bellow to “zabbix.conf.php” with the text editor to remove warning message from the frontend. nano /etc/zabbix/web/zabbix.conf.php ------------------------------------ $DB['DOUBLE_IEEE754'] = 'true'; ------------------------------------ |
Не запускается zabbix-server №1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
!!! в логах ошибки 0. проверяем cat /var/log/zabbix/zabbix_server.log | grep database ------------------------------------------------------ 1331:20200727:174531.353 current database version (mandatory/optional): 05000000/05000001 1331:20200727:174531.389 database is not upgraded to use double precision values Duplicate column name 'name' [alter table `events` add `name` varchar(2048) default '' not null] ------------------------------------------------------ 1. Как вариант можно удалить дублирующую строку mysql -u zabbix-user -p USE zabbix-db-name; ALTER TABLE events DROP COLUMN name; exit 2. Пытаемся запустить zabbix и проверяем логи systemctl start zabbix-server cat /var/log/zabbix/zabbix_server.log | grep database |
Не запускается zabbix-server №2
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 |
0. проверяем логи cat /var/log/zabbix/zabbix_server.log | grep database ---------------------------------------- ERROR 1118 (42000): Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. ---------------------------------------- [Warning] InnoDB: Cannot add field col in table db1.tab because after adding it, the row size is 8478 which is greater than maximum allowed size (8126) for a record on index leaf page. ---------------------------------------- 1. Можно изменить формат таблицы mysql -u zabbix-user -p USE zabbix-db-name; ALTER TABLE ИМЯ_Таблицы ROW_FORMAT=DYNAMIC; exit 2. Пытаемся запустить zabbix и проверяем логи systemctl start zabbix-server cat /var/log/zabbix/zabbix_server.log | grep database Пример: mysql -u zabbix-user -p USE zabbix-db-name; ALTER TABLE tableName ENGINE = InnoDB ROW_FORMAT = Dynamic; exit |