CentOS7で動いているZabbix3.0をZabbix4.0にアップグレードする

Posted by onodai.


Zabbix4.0がリリースされたのでやっていきましょう。
ダウンロードページ
Release Notes for Zabbix 4.0.0 What's new in Zabbix 4.0.0
基本的にはこのページの手順に沿って作業していく

  1. Zabbixの停止
    データベースに新たな値が書き込まれないようZabbix Serverを停止する
    systemctl stop zabbix-server

    Zabbix Proxyをアップグレードする場合、Zabbix Proxyも同様に停止する

    systemctl stop zabbix-proxy
  2. バックアップ用ディレクトリ作成
    mkdir /opt/zabbix-backup/
  3. データベースのバックアップ
    mysqldump -u {$USERNAME} -p -h {$HOSTNAME} {$DBNAME} > /opt/zabbix-backup/{$FILENAME}
  4. Zabbix関連ファイルのバックアップ
    設定ファイル
    cp /etc/zabbix/zabbix_server.conf /opt/zabbix-backup/
    cp /etc/httpd/conf.d/zabbix.conf  /opt/zabbix-backup/

    PHPファイルとバイナリ

    cp -R /usr/share/zabbix/ /opt/zabbix-backup/
    cp -R /usr/share/doc/zabbix-* /opt/zabbix-backup/
  5. リポジトリの更新
    rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
  6. Zabbixコンポーネントのアップグレード
    yum upgrade zabbix-server-mysql zabbix-web-mysql zabbix-agent

    Zabbix Proxyをアップグレードする場合

    yum upgrade zabbix-proxy-mysql
  7. Zabbixの起動
    systemctl start zabbix-server
    systemctl restart zabbix-agent
    systemctl start zabbix-proxy
  8. ログ確認
    起動時に以下のようなログが出力される
    18517:20181003:232320.733 Starting Zabbix Server. Zabbix 4.0.0 (revision 85308).
    18517:20181003:232320.735 ****** Enabled features ******
    18517:20181003:232320.735 SNMP monitoring:           YES
    18517:20181003:232320.735 IPMI monitoring:           YES
    18517:20181003:232320.735 Web monitoring:            YES
    18517:20181003:232320.735 VMware monitoring:         YES
    18517:20181003:232320.735 SMTP authentication:       YES
    18517:20181003:232320.735 Jabber notifications:      YES
    18517:20181003:232320.735 Ez Texting notifications:  YES
    18517:20181003:232320.735 ODBC:                      YES
    18517:20181003:232320.735 SSH2 support:              YES
    18517:20181003:232320.735 IPv6 support:              YES
    18517:20181003:232320.735 TLS support:               YES
    18517:20181003:232320.735 ******************************
    18517:20181003:232320.735 using configuration file: /etc/zabbix/zabbix_server.conf
    18517:20181003:232320.747 current database version (mandatory/optional): 03000000/03000000
    18517:20181003:232320.747 required mandatory version: 04000000
    18517:20181003:232320.747 starting automatic database upgrade
    18517:20181003:232320.764 completed 0% of database upgrade
    18517:20181003:232320.818 completed 1% of database upgrade
    18517:20181003:232320.905 completed 2% of database upgrade
    18517:20181003:232320.949 completed 3% of database upgrade
    18517:20181003:232320.968 completed 4% of database upgrade
    18517:20181003:232321.016 completed 5% of database upgrade
    18517:20181003:232321.026 Action "Report problems to Zabbix administrators" condition "Trigger value = PROBLEM" will be removed during database upgrade: this type of condition is not supported anymore
    18517:20181003:232321.027 completed 6% of database upgrade
    18517:20181003:232321.067 completed 7% of database upgrade
    18517:20181003:232321.099 completed 8% of database upgrade
    18517:20181003:232321.125 completed 9% of database upgrade
    (省略)
    18517:20181003:232324.685 completed 96% of database upgrade
    18517:20181003:232324.725 completed 97% of database upgrade
    18517:20181003:232324.734 completed 98% of database upgrade
    18517:20181003:232324.745 completed 99% of database upgrade
    18517:20181003:232324.787 completed 100% of database upgrade
    18517:20181003:232324.787 database upgrade fully completed
    18517:20181003:232324.872 starting event name update forced by database upgrade
    18517:20181003:232324.873 completed 1% of event name update
    18517:20181003:232324.873 completed 2% of event name update
    18517:20181003:232324.873 completed 3% of event name update
    18517:20181003:232324.873 completed 4% of event name update
    18517:20181003:232324.873 completed 5% of event name update
    18517:20181003:232324.873 completed 6% of event name update
    18517:20181003:232324.873 completed 7% of event name update
    (省略)
    18517:20181003:232324.882 completed 94% of event name update
    18517:20181003:232324.882 completed 95% of event name update
    18517:20181003:232324.882 completed 96% of event name update
    18517:20181003:232324.882 completed 97% of event name update
    18517:20181003:232324.882 completed 98% of event name update
    18517:20181003:232324.882 completed 99% of event name update
    18517:20181003:232324.882 completed 100% of event name update
    18517:20181003:232324.989 event name update completed
comments powered by Disqus