zabbix2.4 update/database upgrade failedにハマる・・・

Zabbix2.4の新機能であるscreenのLLD対応が使いたくて使いたくて、2.4.0-1へアップしてみました。大量に自動で生成されるグラフを都度拾って行くのは厳しいので、こういう機能を待ってました。

あとはScreen表示の際にY軸の縮尺をワンクリックで統一できる機能があれば・・・。

http://www.zabbix.com/jp/rn2.4.0.php

:: Screen-related improvements
In screens, URL now is a dynamic screen element.
Also implemented new screen element types - "Graph prototype" and "Simple graph prototype".

今回、updateはrpmパッケージを使って行いました。マニュアルからの抜粋ですが流れは以下の通りです。

  1. Stop Zabbix server

  2. Back up the existing Zabbix database

  3. Back up configuration files, PHP files and Zabbix binaries

  4. Install new server binaries

  5. Review server configuration parameters

  6. Start new Zabbix binaries

https://www.zabbix.com/documentation/2.4/manual/installation/upgrade

6の新しいバージョンのzabbixを立ち上げた際に、データベース側も2.4対応のアップデートが走ります。なのでservice zabbix-server restartを打って大人しく待っていれば良いということです。マニュアルにも以下記載があります。

Zabbix server will automatically upgrade the database.

updateは今回が初めてではないのですが、なぜかこの時にmysqlを再起動してしまいまして・・・。当然、GUIでアクセスするとdatabaseエラーが。

ログを見ると以下のような状況でした。

  • databaseのupgradeが7%で止まっている

  • mysqlのバージョンは古いままで認識

  • 再度databaseのupgradeは使用としている

あと、Table 'item_condition' already existsというエラーも出てました。中身を見ると空のテーブルのようです。これを消してみたらどうかというアドバイスをもらい実施してみたところ、こちらの環境では問題が解消しました。

以下、ログ抜粋です。

 18846:using configuration file: /etc/zabbix/zabbix_server.conf
 18846:current database version (mandatory/optional): 02030020/02030020
 18846:required mandatory version: 02040000
 18846:starting automatic database upgrade
 18846:[Z3005] query failed: [1050] Table 'item_condition' already exists [create table item_condition (
item_conditionid bigint unsigned not null,
itemid bigint unsigned not null,
operator integer default '8' not null,
macro varchar(64) default '' not null,
value varchar(255) default '' not null,
primary key (item_conditionid)
) engine=innodb]
 18846:database upgrade failed

無事2.4にupdateできました。

当初、目的としていたScreenのLLD対応も以下の通りプルダウンメニューが追加されていました。 待ちに待った機能、便利です。

f:id:komeiy:20141014201050j:plain


シェアして頂けると嬉しいです。
参考になったという方がいれば是非お願いしますm(_ _ )m
モチベーション維持の観点で非常に励みになります。

このエントリーをはてなブックマークに追加