6
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[CentOS7] Zabbix 3.0 LTS → 4.0 LTSへのアップデート

Last updated at Posted at 2018-11-26

##▽ はじめに
2018/10/29についにZabbixの4.0LTS版のリリースが発表されたので、今使っている3.0LTS版からのアップデートが問題なく可能か検証してみる。

全体の流れとしてはおおまかに下記3ステップ。
〇アップデート前作業
 サービス停止
 設定ファイルのバックアップ
〇アップデート作業
 Zabbixリポジトリアップデート
 Zabbixソフトウェア群アップデート
〇アップデート後作業
 設定ファイルの修正
 サービス起動
##▽ 参考サイト
〇アップグレード手順(公式)
https://www.zabbix.com/documentation/current/manual/installation/upgrade/packages/rhel_centos
(Upgrade procedure)1 Red Hat Enterprise Linux/CentOS
〇アップグレードに際しての注意事項
https://www.zabbix.com/documentation/current/manual/installation/upgrade_notes_400
(4. Installation)9 Upgrade notes for 4.0.0
https://www.zabbix.com/documentation/current/manual/appendix/protocols/header_datalen
(Appendixes:4 Protocols)4 Header and data length
https://www.zabbix.com/documentation/current/manual/appendix/config/zabbix_proxy
(Appendixes:3 Daemon configuration)2 Zabbix proxy
##▽ 環境情報
サーバ:Oracle VM VirtualBox 仮想マシン
OS:CentOS 7.5(64bit)
既存Zabbixバージョン:3.0 LTS版

# rpm -qa|grep zabbix
zabbix-web-japanese-3.0.20-1.el7.noarch
zabbix-release-3.0-1.el7.noarch
zabbix-web-3.0.20-1.el7.noarch
zabbix-server-mysql-3.0.20-1.el7.noarch
zabbix-agent-3.0.20-1.el7.noarch
zabbix-web-mysql-3.0.20-1.el7.noarch

既存Zabbix用Database(Zabbix専用):MariaDB 5.5

# rpm -qa|grep mariadb
mariadb-5.5.56-2.el7.x86_64
mariadb-server-5.5.56-2.el7.x86_64
mariadb-libs-5.5.56-2.el7.x86_64

##▽ アップデート前作業
####1.バージョン確認

# zabbix_server -V
zabbix_server (Zabbix) 3.0.20
Revision 83228 30 July 2018, compilation time: Jul 30 2018 11:09:48

Copyright (C) 2018 Zabbix SIA
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it according to
the license. There is NO WARRANTY, to the extent permitted by law.

####2.設定ファイルのzabbix用データベースへの接続パスワードの確認(アップデート作業の中で初期化してしまう為)

# grep DBPassword /etc/zabbix/zabbix_server.conf
DBPassword=xxxxxxxxx(この値を覚えておく)

####3.Zabbix Server/Agentサービス停止

# systemctl stop zabbix-server
# systemctl stop zabbix-agent

####4.設定ファイルバックアップ

# mkdir /opt/zabbix-backup/
# cp -p /etc/zabbix/zabbix_server.conf /opt/zabbix-backup/
# cp -p /etc/httpd/conf.d/zabbix.conf  /opt/zabbix-backup/

# cp -pR /usr/share/zabbix/ /opt/zabbix-backup/
# cp -pR /usr/share/doc/zabbix-* /opt/zabbix-backup/

# ll /opt/zabbix-backup/
合計 24
drwxr-xr-x 13 root root  4096 10月 15 14:43 zabbix
drwxr-xr-x  2 root root   114 10月 15 14:43 zabbix-agent-3.0.20
drwxr-xr-x  2 root root    17 10月 15 14:43 zabbix-release-3.0
drwxr-xr-x  2 root root   100 10月 15 14:43 zabbix-server-mysql-3.0.20
drwxr-xr-x  2 root root    79 10月 15 14:43 zabbix-web-3.0.20
-rw-r--r--  1 root root   913 10月 15 14:43 zabbix.conf
-rw-r-----  1 root root 14897 10月 15 14:43 zabbix_server.conf

##▽ Zabbixリポジトリ アップデート
####1.Zabbix4.0LTS版リポジトリrpmダウンロード

# wget https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm

####2.Zabbixリポジトリアップデート

# rpm -Uvh zabbix-release-4.0-1.el7.noarch.rpm 
警告: zabbix-release-4.0-1.el7.noarch.rpm: ヘッダー V4 RSA/SHA512 Signature、鍵 ID xxxxxxx: NOKEY
準備しています...              ################################# [100%]
更新中 / インストール中...
   1:zabbix-release-4.0-1.el7         ################################# [ 50%]
整理中 / 削除中...
   2:zabbix-release-3.0-1.el7         ################################# [100%]

##▽ Zabbixアップデート
yumで一旦ローカルにダウンロードしてからrpmコマンドでインストールするのは私の趣味です...
####1.yumのキャッシュ削除

# yum clean all
読み込んだプラグイン:fastestmirror
リポジトリーを清掃しています: base extras updates zabbix zabbix-non-supported
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors

####2.Zabbix4.0LTS版rpmパッケージダウンロード

# yum update --downloadonly --downloaddir=. 'zabbix*' 

####3.Zabbixアップデート

# rpm -Uvh zabbix-*
警告: zabbix-agent-4.0.0-2.el7.x86_64.rpm: ヘッダー V4 RSA/SHA512 Signature、鍵 ID xxxxxxx: NOKEY
準備しています...              ################################# [100%]
更新中 / インストール中...
   1:zabbix-web-mysql-4.0.0-2.el7     ################################# [ 10%]
   2:zabbix-web-4.0.0-2.el7           ################################# [ 20%]
   3:zabbix-web-japanese-4.0.0-2.el7  ################################# [ 30%]
   4:zabbix-server-mysql-4.0.0-2.el7  警告: /etc/zabbix/zabbix_server.conf は /etc/zabbix/zabbix_server.conf.rpmnew として作成されました。################################# [ 40%]
   5:zabbix-agent-4.0.0-2.el7         ################################# [ 50%]
整理中 / 削除中...
   6:zabbix-web-japanese-3.0.20-1.el7 ################################# [ 60%]
   7:zabbix-web-mysql-3.0.20-1.el7    ################################# [ 70%]
   8:zabbix-web-3.0.20-1.el7          ################################# [ 80%]
   9:zabbix-server-mysql-3.0.20-1.el7 ################################# [ 90%]
  10:zabbix-agent-3.0.20-1.el7        ################################# [100%]

##▽ アップデート後設定
####1.Zabbix4.0版フォーマットの設定ファイル反映

# cat /etc/zabbix/zabbix_server.conf.rpmnew > /etc/zabbix/zabbix_server.conf
# diff /etc/zabbix/zabbix_server.conf.rpmnew /etc/zabbix/zabbix_server.conf

####2.設定ファイル修正
アップデート前作業の2もしくは4でバックアップした設定ファイルの内容を参考にしながら設定ファイルを変更する。(当環境ではserver.confのDBパスワード項目のみだった)

# vi /etc/zabbix/zabbix_server.conf
	### Option: DBPassword
	#       Database password. Ignored for SQLite.
	#       Comment this line if no password is used.
	#
	# Mandatory: no
	# Default:
	# DBPassword=
	DBPassword=xxxxxxxxx(ここを修正する)

##▽ Zabbix Server/Agentサービス起動

# systemctl start zabbix-server
# systemctl start zabbix-agent

##▽ バージョン確認

# zabbix_server -V
zabbix_server (Zabbix) 4.0.1
Revision 86073 29 October 2018, compilation time: Oct 29 2018 17:40:56

Copyright (C) 2018 Zabbix SIA
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it according to
the license. There is NO WARRANTY, to the extent permitted by law.

##▽ さいごに
特に何の問題も起きずスルっとアップデートできた。
3.0版の期間に取得した監視情報も4.0版にアップデートした後、特に何か特別な設定変更や操作も必要なく今まで通り閲覧できたしスムーズ過ぎて怖い。。。
アップデート後の4.0版Zabbixの使用感については、当環境での使い方の範囲では3.0版と違いはほとんど感じない。
WEB管理画面のテーマがちょっと増えてたりするな。

6
17
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?