zabbix 1.6.8 から 1.8.3にアップデートしたときに発生したエラーの回避方法

yum を使って、プログラム自体は、1.8.3に簡単にアップデートすることができた。その後のDB(MySQL)へのパッチでエラーが発生した。このエラーを回避する方法を探すのに、ちょっと手間取ったので書いておく。

発生したエラー

 [root@your-0bb7513658 mysql]# mysql -u root zabbix < /usr/share/doc/zabbix-server-1.8.3/db
 patches/1.8/mysql/patch.sql
 ERROR 1061 (42000) at line 1: Duplicate key name 'actions_1'

対応方法

先にIndexを削除する。MySQLでZabbixのデータベースに対して以下のコマンドを入力する。

 alter table dhosts drop index dhosts_1;
 alter table dservices drop index dservices_1;
 alter table httptest drop index httptest_2;
 alter table httptest drop index httptest_3;
 alter table history_log drop index history_log_2;
 alter table history_text drop index history_text_2;
 alter table actions drop index actions_1;
 alter table escalations drop index escalations_2;
 alter table graphs_items drop index graphs_items_1;
 alter table graphs_items drop index graphs_items_2;
 alter table services drop index services_1; 

参考:http://www.zabbix.com/documentation/1.8/manual/installation/upgrading

Index削除後に、もう一度、patch.sqlを当ててやれば、今度は成功する。このパッチは時間がかかるので要注意。

スポンサーリンク

シェアする

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

フォローする