自宅のdebianをbuster(10.x)からbullseye(11.x)にアップグレードした。
その際のメモ。
zabbix関連の対応が中心。
システム再起動をかけておく。
カーネル自作の頃はここで結構トラブル起きていたが、今回は何も無し。
ログ周り諸々チェックして特に問題なさそう。
Rubyのバージョンが2.7に上がったのでgemでサービス運用に必要なライブラリを入れ直しておく。
twitterとhttpclientの2つ。
#gem install twitter httpclient
パッケージで入れてるサービスのPHPやPerlライブラリはdebianのパッケージに任せてて、
Rubyのライブラリは未だにgem管理というのはなんだかへんてこな感じがする……
が、自作サービスなのでAPTで依存性判断させるのめんどくさいし、
bundler管理するまでもないし今のところこの手順忘れなければいいかな。
# apt-get update
すると、
無視:3 http://security.debian.org stable/updates InRelease
エラー:4 http://security.debian.org stable/updates Release
404 Not Found [IP: 151.101.230.132 80]
E: リポジトリ http://security.debian.org stable/updates Release には Release ファイルがありません。
N: このようなリポジトリから更新を安全に行うことができないので、デフォルトでは更新が無効になっています。
N: リポジトリの作成とユーザ設定の詳細は、apt-secure(8) man ページを参照してください。
と出る。
security.debian.orgのパスが変わったっぽいので対応しておく。
これはupgradeと無関係に直しておくべきもの。
# diff sources.list.20220512 sources.list
14,15c14,15
< deb http://security.debian.org/ stable/updates main contrib non-free
< deb-src http://security.debian.org/ stable/updates main contrib non-free
---
> deb http://security.debian.org/ stable-security/updates main contrib non-free
> deb-src http://security.debian.org/ stable-security/updates main contrib non-free
公式だとstable-securityじゃなくbuster-securityを推奨しているようだが、横着したいのでstable-securityで。
apt-get updateしてエラーの解消を確認。
[参考]
security.debian.org 'does not have a Release file' on with Debian Docker images - Server Fault
毎度zabbix関係に手間がかかる感じ。
色々でていたのでこの際まとめてきれいにする。
zabbixにアクセスすると下記表示。
The Zabbix database version does not match current requirements. Your database version: 4030046. Required version: 5000000. Please contact your system administrator.
/var/log/zabbix-server/zabbix_server.log
上では、起動時の
starting automatic database upgrade
の途中(93%くらい)で、
17096:20220513:102638.403 completed 92% of database upgrade
17096:20220513:102638.548 completed 93% of database upgrade
17096:20220513:102638.762 [Z3005] query failed: [1118] 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. You have to change some columns to TEXT or BLOBs
[alter table `hosts` add `discover` integer default '0' not null]
17096:20220513:102638.763 database upgrade failed
17207:20220513:102809.948 Starting Zabbix Server. Zabbix 5.0.8 (revision d3c78f993a).
とでてくる。
列が追加できないらしい。
mysql上でzabbix DBにつないでhostsテーブルのフォーマットを変えていく。
MariaDB [zabbix]> alter table hosts row_format=dynamic;
media_typeテーブルも同様。直す。
16412:20220513:101210.637 [Z3005] query failed: [1118] 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. You have to change some columns to TEXT or BLOBs
[alter table `media_type` add `event_menu_name` varchar(255) default '' not null]
MariaDB [zabbix]> alter table media_type row_format=dynamic;
zabbixを再起動すると、database upgradeは成功してzabbixの画面は開くようになった。
なお、
innodb_strict_mode = 0
で対応する説があるが、これはNG(データロスするか、実際にデータいじってるときにエラーが出るか)の認識。
[参考]
CentOS7で動いているZabbix4.0をZabbix5.0にアップグレードしてついでにNginxで動かす - 気まぐれ
まだ、/var/log/zabbix-server/zabbix_server.logにここらへんの警告が出るので消していく。
17207:20220513:102810.696 Zabbix supports only "utf8_bin" collation. Database "zabbix" has default collation "utf8_general_ci"
17207:20220513:102810.723 character set name or collation name that is not supported by Zabbix found in 421 column(s) of database "zabbix"
17207:20220513:102810.723 only character set "utf8" and collation "utf8_bin" should be used in database
17207:20220513:102810.759 database is not upgraded to use double precision values
各tableのcollate直す。
正式手順は、
2 Repairing Zabbix database character set and collation
のようだけど、面倒であれば下記流しても良さそうだった。
MariaDB [zabbix]> ALTER TABLE acknowledges CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE actions CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE alerts CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE application_discovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE application_prototype CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE application_template CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE applications CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE auditlog CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE auditlog_details CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE autoreg_host CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE conditions CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE config CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE config_autoreg_tls CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE corr_condition CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE corr_condition_group CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE corr_condition_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE corr_condition_tagpair CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE corr_condition_tagvalue CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE corr_operation CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE correlation CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE dashboard CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE dashboard_user CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE dashboard_usrgrp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE dbversion CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE dchecks CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE dhosts CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE drules CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE dservices CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE escalations CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE event_recovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE event_suppress CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE event_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE events CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE expressions CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE functions CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE globalmacro CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE globalvars CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE graph_discovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE graph_theme CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE graphs CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE graphs_items CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE group_discovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE group_prototype CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE history CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE history_log CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE history_str CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE history_text CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE history_uint CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE host_discovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE host_inventory CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE host_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE hostmacro CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE hosts CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE hosts_groups CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE hosts_templates CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE housekeeper CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE hstgrp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE httpstep CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE httpstep_field CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE httpstepitem CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE httptest CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE httptest_field CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE httptestitem CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE icon_map CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE icon_mapping CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE ids CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE images CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE interface CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE interface_discovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE interface_snmp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE item_application_prototype CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE item_condition CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE item_discovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE item_preproc CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE item_rtdata CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE items CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE items_applications CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE lld_macro_path CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE lld_override CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE lld_override_condition CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE lld_override_opdiscover CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE lld_override_operation CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE lld_override_ophistory CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE lld_override_opinventory CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE lld_override_opperiod CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE lld_override_opseverity CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE lld_override_opstatus CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE lld_override_optag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE lld_override_optemplate CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE lld_override_optrends CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE maintenance_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE maintenances CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE maintenances_groups CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE maintenances_hosts CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE maintenances_windows CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE mappings CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE media CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE media_type CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE media_type_message CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE media_type_param CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE module CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE opcommand CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE opcommand_grp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE opcommand_hst CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE opconditions CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE operations CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE opgroup CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE opinventory CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE opmessage CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE opmessage_grp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE opmessage_usr CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE optemplate CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE problem CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE problem_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE profiles CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE proxy_autoreg_host CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE proxy_dhistory CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE proxy_history CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE regexps CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE rights CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE screen_user CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE screen_usrgrp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE screens CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE screens_items CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE scripts CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE service_alarms CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE services CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE services_links CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE services_times CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE sessions CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE slides CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE slideshow_user CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE slideshow_usrgrp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE slideshows CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE sysmap_element_trigger CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE sysmap_element_url CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE sysmap_shape CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE sysmap_url CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE sysmap_user CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE sysmap_usrgrp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE sysmaps CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE sysmaps_elements CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE sysmaps_link_triggers CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE sysmaps_links CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE tag_filter CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE task CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE task_acknowledge CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE task_check_now CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE task_close_problem CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE task_data CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE task_remote_command CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE task_remote_command_result CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE task_result CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE timeperiods CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE trends CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE trends_uint CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE trigger_depends CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE trigger_discovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE trigger_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE triggers CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE users CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE users_groups CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE usrgrp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE valuemaps CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE widget CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [zabbix]> ALTER TABLE widget_field CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
DBのdefault collate直す。
MariaDB [(none)]> ALTER DATABASE zabbix DEFAULT COLLATE utf8_bin;
倍精度周りのdefault値直す。
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;
SQLはここに掲載されている。
https://git.zabbix.com/projects/ZBX/repos/zabbix/raw/database/mysql/double.sql
大体↓に書いてある! ありがたい。
[参考]
Zabbix5.0にアップデートした後にでるトラブルの対処法
zabbixの画面に下記4つ警告が出ているので直す。
PHPの"post_max_size"オプション 8M PHPのpostサイズの最小値は16Mです("post_max_size"設定オプション)。
PHPの"max_execution_time"オプション 30 PHPスクリプトの実行時間の最小値は300です ("max_execution_time"設定オプション)。
PHPの"max_input_time"オプション 60 PHPスクリプトの入力パース時間の最小値は300です("max_input_time"設定オプション)。
PHPの"date.timezone"オプション 不明 PHPのタイムゾーンが設定されていません ("date.timezone"設定パラメータ)。
/etc/apache2/sites-enabled/zabbix.conf
の、
<Directory "/usr/share/zabbix">
内に下記追記。
# diff zabbix.conf.20220513 zabbix.conf
11a12,15
> php_value post_max_size 16M
> php_value max_execution_time 300
> php_value max_input_time 300
> php_value date.timezone Asia/Tokyo
とりあえずこれできれいになった。
アップグレード終わり!