先日、Zabbix Appliance 3.0.16を3.2.11へアップグレードを実施しました。
同様に3.2.11から3.4.14へアップグレード後に3.4.14から4.0.0へのアップグレード作業です。
- Zabbixサービスの停止
- /etc/apt/sources.listの編集
- apt update
- apt upgrade
- Zabbixサービスの起動
1 2 |
$ sudo service zabbix-server stop $ sudo service zabbix-agent stop |
1 2 3 4 5 6 7 8 |
#deb http://repo.zabbix.com/zabbix/3.0/ubuntu xenial main #deb-src http://repo.zabbix.com/zabbix/3.0/ubuntu xenial main #deb http://repo.zabbix.com/zabbix/3.2/ubuntu xenial main #deb-src http://repo.zabbix.com/zabbix/3.2/ubuntu xenial main #deb http://repo.zabbix.com/zabbix/3.4/ubuntu xenial main #deb-src http://repo.zabbix.com/zabbix/3.4/ubuntu xenial main deb http://repo.zabbix.com/zabbix/4.0/ubuntu xenial main deb-src http://repo.zabbix.com/zabbix/4.0/ubuntu xenial main |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$ sudo apt update Get:1 http://repo.zabbix.com/zabbix/4.0/ubuntu xenial InRelease [7096 B] Get:2 http://repo.zabbix.com/zabbix/4.0/ubuntu xenial/main Sources [1186 B] Get:3 http://repo.zabbix.com/zabbix/4.0/ubuntu xenial/main amd64 Packages [2678 B] Get:4 http://repo.zabbix.com/zabbix/4.0/ubuntu xenial/main i386 Packages [2682 B] Get:5 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB] Hit:6 http://us.archive.ubuntu.com/ubuntu xenial InRelease Get:7 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB] Get:8 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB] Fetched 336 kB in 1s (181 kB/s) Reading package lists... Done Building dependency tree Reading state information... Done 6 packages can be upgraded. Run 'apt list --upgradable' to see them. |
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
$ sudo apt upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages were automatically installed and are no longer required: linux-headers-4.4.0-127 linux-headers-4.4.0-127-generic linux-headers-4.4.0-128 linux-headers-4.4.0-128-generic linux-headers-4.4.0-130 linux-headers-4.4.0-130-generic linux-headers-4.4.0-131 linux-headers-4.4.0-131-generic linux-headers-4.4.0-133 linux-headers-4.4.0-133-generic linux-headers-4.4.0-134 linux-headers-4.4.0-134-generic linux-image-4.4.0-127-generic linux-image-4.4.0-128-generic linux-image-4.4.0-130-generic linux-image-4.4.0-131-generic linux-image-4.4.0-133-generic linux-image-4.4.0-134-generic linux-image-extra-4.4.0-127-generic linux-image-extra-4.4.0-128-generic linux-image-extra-4.4.0-130-generic linux-image-extra-4.4.0-131-generic linux-image-extra-4.4.0-133-generic linux-image-extra-4.4.0-134-generic Use 'sudo apt autoremove' to remove them. The following NEW packages will be installed: default-jre-headless openjdk-8-jre-headless The following packages will be upgraded: zabbix-agent zabbix-frontend-php zabbix-get zabbix-java-gateway zabbix-sender zabbix-server-mysql 6 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 31.9 MB of archives. After this operation, 101 MB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 openjdk-8-jre-headless amd64 8u181-b13-0ubuntu0.16.04.1 [27.0 MB] Get:2 http://repo.zabbix.com/zabbix/4.0/ubuntu xenial/main amd64 zabbix-server-mysql amd64 1:4.0.0-2+xenial [1896 kB] Get:3 http://repo.zabbix.com/zabbix/4.0/ubuntu xenial/main amd64 zabbix-agent amd64 1:4.0.0-2+xenial [169 kB] Get:4 http://repo.zabbix.com/zabbix/4.0/ubuntu xenial/main amd64 zabbix-frontend-php all 1:4.0.0-2+xenial [2155 kB] Get:5 http://repo.zabbix.com/zabbix/4.0/ubuntu xenial/main amd64 zabbix-get amd64 1:4.0.0-2+xenial [65.5 kB] Get:6 http://repo.zabbix.com/zabbix/4.0/ubuntu xenial/main amd64 zabbix-java-gateway all 1:4.0.0-2+xenial [561 kB] Get:7 http://repo.zabbix.com/zabbix/4.0/ubuntu xenial/main amd64 zabbix-sender amd64 1:4.0.0-2+xenial [76.5 kB] Get:8 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 default-jre-headless amd64 2:1.8-56ubuntu2 [4380 B] Fetched 31.9 MB in 3s (8038 kB/s) Reading changelogs... Done (Reading database ... 285329 files and directories currently installed.) Preparing to unpack .../zabbix-server-mysql_1%3a4.0.0-2+xenial_amd64.deb ... Unpacking zabbix-server-mysql (1:4.0.0-2+xenial) over (1:3.4.14-1+xenial) ... Selecting previously unselected package openjdk-8-jre-headless:amd64. Preparing to unpack .../openjdk-8-jre-headless_8u181-b13-0ubuntu0.16.04.1_amd64.deb ... Unpacking openjdk-8-jre-headless:amd64 (8u181-b13-0ubuntu0.16.04.1) ... Selecting previously unselected package default-jre-headless. Preparing to unpack .../default-jre-headless_2%3a1.8-56ubuntu2_amd64.deb ... Unpacking default-jre-headless (2:1.8-56ubuntu2) ... Preparing to unpack .../zabbix-agent_1%3a4.0.0-2+xenial_amd64.deb ... Unpacking zabbix-agent (1:4.0.0-2+xenial) over (1:3.4.14-1+xenial) ... Preparing to unpack .../zabbix-frontend-php_1%3a4.0.0-2+xenial_all.deb ... Unpacking zabbix-frontend-php (1:4.0.0-2+xenial) over (1:3.4.14-1+xenial) ... Preparing to unpack .../zabbix-get_1%3a4.0.0-2+xenial_amd64.deb ... Unpacking zabbix-get (1:4.0.0-2+xenial) over (1:3.4.14-1+xenial) ... Preparing to unpack .../zabbix-java-gateway_1%3a4.0.0-2+xenial_all.deb ... Unpacking zabbix-java-gateway (1:4.0.0-2+xenial) over (1:3.4.14-1+xenial) ... Preparing to unpack .../zabbix-sender_1%3a4.0.0-2+xenial_amd64.deb ... Unpacking zabbix-sender (1:4.0.0-2+xenial) over (1:3.4.14-1+xenial) ... Processing triggers for systemd (229-4ubuntu21.4) ... Processing triggers for ureadahead (0.100.0-19) ... Setting up zabbix-server-mysql (1:4.0.0-2+xenial) ... Configuration file '/etc/zabbix/zabbix_server.conf' ==> Modified (by you or by a script) since installation. ==> Package distributor has shipped an updated version. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation The default action is to keep your current version. *** zabbix_server.conf (Y/I/N/O/D/Z) [default=N] ? N Setting up openjdk-8-jre-headless:amd64 (8u181-b13-0ubuntu0.16.04.1) ... Setting up default-jre-headless (2:1.8-56ubuntu2) ... Setting up zabbix-agent (1:4.0.0-2+xenial) ... Installing new version of config file /etc/zabbix/zabbix_agentd.conf ... Setting up zabbix-frontend-php (1:4.0.0-2+xenial) ... Setting up zabbix-get (1:4.0.0-2+xenial) ... Setting up zabbix-java-gateway (1:4.0.0-2+xenial) ... Installing new version of config file /etc/zabbix/zabbix_java_gateway.conf ... Setting up zabbix-sender (1:4.0.0-2+xenial) ... |
1 2 |
$ sudo service zabbix-server start $ sudo service zabbix-agent start |
Zabbix WebUIにアクセスするとデータベースエラーが発生しました。
Database error
The frontend does not match Zabbix database. Current database version (mandatory/optional): 3050057/3050057. Required mandatory version: 4000000. Contact your system administrator.
Zabbix Serverのログを確認するとエラーが発生していました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
30286:20181012:034824.225 Starting Zabbix Server. Zabbix 4.0.0 (revision 85308). 30286:20181012:034824.225 ****** Enabled features ****** 30286:20181012:034824.225 SNMP monitoring: YES 30286:20181012:034824.225 IPMI monitoring: YES 30286:20181012:034824.225 Web monitoring: YES 30286:20181012:034824.225 VMware monitoring: YES 30286:20181012:034824.225 SMTP authentication: YES 30286:20181012:034824.225 Jabber notifications: YES 30286:20181012:034824.225 Ez Texting notifications: YES 30286:20181012:034824.225 ODBC: YES 30286:20181012:034824.225 SSH2 support: YES 30286:20181012:034824.225 IPv6 support: YES 30286:20181012:034824.225 TLS support: YES 30286:20181012:034824.225 ****************************** 30286:20181012:034824.225 using configuration file: /etc/zabbix/zabbix_server.conf 30286:20181012:034824.227 current database version (mandatory/optional): 03050057/03050057 30286:20181012:034824.227 required mandatory version: 04000000 30286:20181012:034824.227 starting automatic database upgrade 30286:20181012:034824.228 [Z3005] query failed: [1060] Duplicate column name 'ssl_cert_file' [alter table `items` add `ssl_cert_file` varchar(255) default '' not null] 30286:20181012:034824.228 database upgrade failed |
[Z3005] query failed: [1060] Duplicate column name ‘ssl_cert_file’ [alter tableitems
addssl_cert_file
varchar(255) default ” not null]
アップグレード後にzabbix serverを起動すると自動的にデータベースのコンバートが開始されるのですが、それが失敗しています。
しかし’ssl_cert_file’が重複しているって….どうすればいいの?
似たようなエラーが見つかりました。
[ZBX-14520] dsatabase upgrade failed – ZABBIX SUPPORT
https://support.zabbix.com/browse/ZBX-14520
重複しているカラムを削除すればコンバートできたようなので試してみます。
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 28 29 30 31 32 33 34 |
$ mysql -u zabbix -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 125 Server version: 5.7.23-0ubuntu0.16.04.1 (Ubuntu) Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | zabbix | +--------------------+ 2 rows in set (0.00 sec) mysql> use zabbix; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> alter table items drop ssl_cert_file; Query OK, 0 rows affected (0.25 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> quit Bye |
再度Zabbix Serverを起動してログを確認するとデータベースコンバートが正常終了していました。
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 28 29 30 31 32 33 34 35 |
30295:20181012:034834.470 Starting Zabbix Server. Zabbix 4.0.0 (revision 85308). 30295:20181012:034834.470 ****** Enabled features ****** 30295:20181012:034834.470 SNMP monitoring: YES 30295:20181012:034834.470 IPMI monitoring: YES 30295:20181012:034834.470 Web monitoring: YES 30295:20181012:034834.470 VMware monitoring: YES 30295:20181012:034834.470 SMTP authentication: YES 30295:20181012:034834.470 Jabber notifications: YES 30295:20181012:034834.470 Ez Texting notifications: YES 30295:20181012:034834.470 ODBC: YES 30295:20181012:034834.470 SSH2 support: YES 30295:20181012:034834.470 IPv6 support: YES 30295:20181012:034834.470 TLS support: YES 30295:20181012:034834.470 ****************************** 30295:20181012:034834.470 using configuration file: /etc/zabbix/zabbix_server.conf 30295:20181012:034834.473 current database version (mandatory/optional): 03050057/03050057 30295:20181012:034834.473 required mandatory version: 04000000 30295:20181012:034834.473 starting automatic database upgrade 30295:20181012:034834.675 completed 0% of database upgrade 30295:20181012:034834.911 completed 1% of database upgrade 30295:20181012:034835.067 completed 2% of database upgrade 30295:20181012:034835.323 completed 3% of database upgrade (snip) 30295:20181012:034837.070 completed 99% of database upgrade 30295:20181012:034837.070 completed 100% of database upgrade 30295:20181012:034837.070 database upgrade fully completed 30295:20181012:034837.093 starting event name update forced by database upgrade 30295:20181012:034837.093 completed 1% of event name update 30295:20181012:034837.093 completed 2% of event name update (snip) 30295:20181012:034837.098 completed 99% of event name update 30295:20181012:034837.098 completed 100% of event name update 30295:20181012:034837.187 event name update completed 30295:20181012:034837.252 server #0 started [main process] 30296:20181012:034837.253 server #1 started [configuration syncer #1] |
Zabbix WebUIにアクセスすると無事にログインできてモニタリングもできているようでした。
これで暫く様子をみます。