1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

IBM MQをインストールしてみた

Last updated at Posted at 2025-10-17

1. はじめに

本記事はIBM MQをインストールする流れを記載しました。
IBM MQはシステム間でメッセージを送受信するためのミドルウェアです。

2. 事前準備

導入する環境と、MQのインストール・イメージを準備します。

環境

用意する環境は、Microsoct Azureで作成した仮想マシンとします。OSイメージは、RedHat (v9.6)です。

インストール・イメージ

今回導入するMQのバージョンは v9.4.3 としています。

本記事では IBM Partner Plus の Software Access Catalog よりインストール・イメージを取得しています。
※公式の試用版でも問題ありません。

3. インストール

3.1. ユーザー・グループ作成

mqmユーザ・グループが存在しない場合は、製品のインストール時に自動で作成されますが、今回は手動で作成しておきます。

// 作成
# groupadd mqm
# useradd -m -g mqm mqm

// 確認
# cat /etc/group
・・・中略・・・
mqm:x:1003:

# cat /etc/passwd
・・・中略・・・
mqm:x:1003:1003::/home/mqm:/bin/bash

mqmコマンドを使用できるようにパスを通しておきます。
(mqmユーザの~/.bash_profileに以下の情報を追記する。)

export PATH=$PATH:/opt/mqm/bin

3.2. インストール・イメージの解凍

ダウンロードしたインストール・イメージ(9.4.3.0-IBM-MQ-LinuxX64_.tar.gz)をサーバーに転送してtar解凍します。
今回は/workに配置、解凍しました。

tar -xvzf 9.4.3.0-IBM-MQ-LinuxX64_.tar.gz

エラーがなく解凍が完了し、MQServerというディレクトリが存在していることを確認します。
ディレクトリの中身は以下のようになっています。

# ls -l MQServer
合計 512504
drwxrwxr-x. 3 bin bin        18  5月 27 21:16 Advanced
-rw-rw-r--. 1 bin bin      1012  5月 27 21:27 IBM-MQ.repo
-r--r--r--. 1 bin bin   2636599  5月 27 21:02 MQSeriesAMQP-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin     50794  5月 27 21:02 MQSeriesAMS-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin   6038249  5月 27 21:00 MQSeriesClient-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin   3091363  5月 27 21:02 MQSeriesFTAgent-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin  27696100  5月 27 21:02 MQSeriesFTBase-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin   3746228  5月 27 21:02 MQSeriesFTLogger-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin     57897  5月 27 21:02 MQSeriesFTService-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin     58248  5月 27 21:02 MQSeriesFTTools-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin  25756212  5月 27 21:00 MQSeriesGSKit-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin 134556724  5月 27 21:01 MQSeriesJRE-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin 146019213  5月 27 21:05 MQSeriesJava-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin    305842  5月 27 21:00 MQSeriesMan-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin    227759  5月 27 21:01 MQSeriesMsg_Zh_CN-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin    228916  5月 27 21:01 MQSeriesMsg_Zh_TW-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin    255613  5月 27 21:01 MQSeriesMsg_cs-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin    268047  5月 27 21:00 MQSeriesMsg_de-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin    249384  5月 27 21:00 MQSeriesMsg_es-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin    253084  5月 27 21:00 MQSeriesMsg_fr-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin    259881  5月 27 21:01 MQSeriesMsg_hu-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin    251341  5月 27 21:00 MQSeriesMsg_it-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin    244052  5月 27 21:01 MQSeriesMsg_ja-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin    231107  5月 27 21:01 MQSeriesMsg_ko-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin    258311  5月 27 21:01 MQSeriesMsg_pl-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin    251106  5月 27 21:01 MQSeriesMsg_pt-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin    252392  5月 27 21:01 MQSeriesMsg_ru-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin  20388047  5月 27 21:06 MQSeriesRuntime-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin    341564  5月 27 21:00 MQSeriesSDK-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin   2367792  5月 27 21:00 MQSeriesSamples-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin  12135895  5月 27 21:02 MQSeriesServer-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin 133887148  5月 27 21:03 MQSeriesWeb-9.4.3-0.x86_64.rpm
-r--r--r--. 1 bin bin   2326429  5月 27 21:02 MQSeriesXRService-9.4.3-0.x86_64.rpm
drwxrwxr-x. 2 bin bin      4096  5月 27 21:27 READMES
-rw-rw-r--. 1 bin bin       223  5月 27 21:27 copyright
-rwxrwxr-x. 1 bin bin      8168  5月 27 21:27 crtmqpkg
drwxrwxr-x. 4 bin bin        51  5月 27 21:27 lap
drwxrwxr-x. 2 bin bin      4096  5月 27 21:27 licenses
-rwxr-xr-x. 1 bin bin     13825  5月 27 21:27 mqlicense.sh
drwxrwxr-x. 2 bin bin      4096  5月 27 21:27 repackage
drwxrwxr-x. 2 bin bin      4096  5月 27 21:27 repodata

3.3. ライセンス認証

インストール前にmqlicense コマンドを使用してライセンス認証をします。

# cd MQServer

# ./mqlicense.sh -accept

3.4. インストール

実際にインストール作業に入ります。
インストールはrpmコマンドを使用して実施します。
参考:rpm コマンドを使用した Linux への最初の IBM MQ インストールのインストール

rpm -ivh \
> MQSeriesServer-9.4.3-0.x86_64.rpm \
> MQSeriesGSKit-9.4.3-0.x86_64.rpm \
> MQSeriesRuntime-9.4.3-0.x86_64.rpm \
> MQSeriesSamples-9.4.3-0.x86_64.rpm \
> MQSeriesMan-9.4.3-0.x86_64.rpm \
> MQSeriesMsg_ja-9.4.3-0.x86_64.rpm
実行結果
rpm -ivh \
> MQSeriesServer-9.4.3-0.x86_64.rpm \
> MQSeriesGSKit-9.4.3-0.x86_64.rpm \
> MQSeriesRuntime-9.4.3-0.x86_64.rpm \
> MQSeriesSamples-9.4.3-0.x86_64.rpm \
> MQSeriesMan-9.4.3-0.x86_64.rpm \
> MQSeriesMsg_ja-9.4.3-0.x86_64.rpm
警告: MQSeriesServer-9.4.3-0.x86_64.rpm: ヘッダー V4 RSA/SHA256 Signature、鍵 ID 5c7908f6: NOKEY
Verifying...                          ################################# [100%]
準備しています...              ################################# [100%]
更新中 / インストール中...
   1:MQSeriesRuntime-9.4.3-0          ################################# [ 17%]
Warning : package "MQSeriesRuntime" is signed but key is not installed on this system.
          rpm verify shows "Header V4 RSA/SHA256 Signature, key ID 5c7908f6: NOKEY"
          rpm warning message may have been issued at install time.
          See topic "IBM MQ code signatures" in the IBM MQ documentation for more information.
   2:MQSeriesGSKit-9.4.3-0            ################################# [ 33%]
   3:MQSeriesServer-9.4.3-0           ################################# [ 50%]
Updated PAM configuration in /etc/pam.d/ibmmq

WARNING: System settings for this system do not meet recommendations for this product
         See the log file at "/tmp/mqconfig.156246.log" for more information

   4:MQSeriesSamples-9.4.3-0          ################################# [ 67%]
   5:MQSeriesMan-9.4.3-0              ################################# [ 83%]
   6:MQSeriesMsg_ja-9.4.3-0           ################################# [100%]

警告が2つほど出ましたので確認します。

エラー①:署名の検証失敗
Warning : package "MQSeriesRuntime" is signed but key is not installed on this system.
          rpm verify shows "Header V4 RSA/SHA256 Signature, key ID 5c7908f6: NOKEY"
          rpm warning message may have been issued at install time.
          See topic "IBM MQ code signatures" in the IBM MQ documentation for more information.

~ 原因 ~
IBM MQのRPMパッケージは署名されており、インストール時にその署名を検証しようとしたが、署名に使われた公開鍵(ID: 5c7908f6)がシステムにインストールされていないため、検証できなかったという警告のようでした。

~ 対応 ~
IBMの公開鍵をインポートします。
IBM MQ公開証明書、チェックサム、 pgpキー、および.sigファイルは、 こちらにあるためダウンロードします。
image.png

ダウンロードしたファイル(9.4.3.0-IBM-MQ-Sigs-Certs.tar.gz)を解凍します。

# tar -xvzf 9.4.3.0-IBM-MQ-Sigs-Certs.tar.gz
・・・中略・・・
ibm_mq_public.pem
ibm_mq_public.pgp

rpmにインポートします。
参考:IBM MQ コード署名

rpm --import ibm_mq_public.pgp

エラーが出ないことを確認します。

エラー②:システム設定値
WARNING: System settings for this system do not meet recommendations for this product
         See the log file at "/tmp/mqconfig.156246.log" for more information

~ 原因 ~
システム設定が推奨値を満たしていないという警告のようです。
メッセージに出ているログファイルを見て具体的にどの設定が不足しているかを確認します。

# cat /tmp/mqconfig.156246.log
mqconfig: Analyzing Red Hat Enterprise Linux 9.6 (Plow) settings for IBM
          MQ V9.4

System V Semaphores
  semmsl     (sem:1)  32000 semaphores                   IBM>=32           PASS
  semmns     (sem:2)  3 of 1024000000 semaphores (0%)    IBM>=4096         PASS
  semopm     (sem:3)  500 operations                     IBM>=32           PASS
  semmni     (sem:4)  2 of 32000 sets            (0%)    IBM>=128          PASS

System V Shared Memory
  shmmax              18446744073692774399 bytes         IBM>=268435456    PASS
  shmmni              0 of 4096 sets             (0%)    IBM>=4096         PASS
  shmall              18446744073692774399 pages         IBM>=2097152      PASS

System Settings
  file-max            1312 of 9223372036854775807 files (0%)    IBM>=524288       PASS
  pid_max             206 of 4194304 processids  (0%)    IBM>=32768        PASS
  threads-max         206 of 28225 threads       (0%)    IBM>=32768        WARN

Current User Limits (root)
  nofile       (-Hn)  524288 files                       IBM>=10240        PASS
  nofile       (-Sn)  1024 files                         IBM>=10240        FAIL
  nproc        (-Hu)  0 of 14112 processes       (0%)    IBM>=4096         PASS
  nproc        (-Su)  0 of 14112 processes       (0%)    IBM>=4096         PASS

WARNとFAILが確認できます。
① WARNの部分

  threads-max         206 of 28225 threads       (0%)    IBM>=32768        WARN

これは、カーネルパラメータkernel.threads-maxの値が、IBM MQ推奨値の32768に達していないという意味。

② FAILの部分

  nofile       (-Sn)  1024 files                         IBM>=10240        FAIL

これは、リソース制限の設定であるnofile (-Sn)が1024であり、IBM MQ推奨値の10240に達していないという意味。

~ 対応 ~

① /etc/sysctl.confに以下を追記します。

kernel.threads-max = 32768

以下コマンドで反映・確認します。

# sysctl -p

# cat /proc/sys/kernel/threads-max
32768

② /etc/security/limits.conf に以下を追加する。

* soft nofile 10240

ログインしなおして、設定値が変更されていることを確認します。

# ulimit -n
10240

再度インストール実施

rpm -ivh \
> MQSeriesServer-9.4.3-0.x86_64.rpm \
> MQSeriesGSKit-9.4.3-0.x86_64.rpm \
> MQSeriesRuntime-9.4.3-0.x86_64.rpm \
> MQSeriesSamples-9.4.3-0.x86_64.rpm \
> MQSeriesMan-9.4.3-0.x86_64.rpm \
> MQSeriesMsg_ja-9.4.3-0.x86_64.rpm
実行結果
# rpm -ivh \
MQSeriesServer-9.4.3-0.x86_64.rpm \
MQSeriesGSKit-9.4.3-0.x86_64.rpm \
MQSeriesRuntime-9.4.3-0.x86_64.rpm \
MQSeriesSamples-9.4.3-0.x86_64.rpm \
MQSeriesMan-9.4.3-0.x86_64.rpm \
MQSeriesMsg_ja-9.4.3-0.x86_64.rpm
Verifying...                          ################################# [100%]
準備しています...              ################################# [100%]
更新中 / インストール中...
   1:MQSeriesRuntime-9.4.3-0          ################################# [ 17%]
   2:MQSeriesGSKit-9.4.3-0            ################################# [ 33%]
   3:MQSeriesServer-9.4.3-0           ################################# [ 50%]
   4:MQSeriesSamples-9.4.3-0          ################################# [ 67%]
   5:MQSeriesMan-9.4.3-0              ################################# [ 83%]
   6:MQSeriesMsg_ja-9.4.3-0           ################################# [100%]

警告なく完了しました。

4. さいごに

今回はMQをインストールするところまでといたします。
この記事ではMQの操作やオブジェクト作成まではしません。

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?