Pages

IBM MQ 9.2.1 Installation & Configuration Guide on Linux

This document provides a comprehensive technical guide for installing, configuring, and verifying IBM MQ Developer Edition 9.2.1 on Linux systems. It covers all steps required to prepare the OS, install MQ binaries, create queue managers, configure channels and listeners, secure access, perform message testing, troubleshoot issues, and cleanly uninstall MQ if needed.

It is intended for system administrators, middleware engineers, and developers who require a precise, command-driven reference for deploying IBM MQ in a development or test environment. By following this guide, you will have a fully functional queue manager (QMLAB1) ready for application connectivity and testing.

1. System Prerequisites & Validation
1.1 OS & Hardware Requirements
RequirementRecommended
OS          RHEL / CentOS 7 or 8 (64-bit)
Kernel          3.10+
RAM          8 GB minimum
Disk          5 GB free (more for logs)
Filesystem          XFS / EXT4
Time Sync          chronyd / ntpd

Verify OS and kernel:
# cat /etc/redhat-release
uname -r
1.2 System Update
# yum update -y
# reboot
Reboot ensures kernel libraries are aligned before MQ installation.

1.3 Check for Existing MQ Installations
# rpm -qa | grep MQSeries
If any MQ packages exist, remove them first to avoid conflicts.

1.4 Disable SELinux
In production, use proper SELinux policies instead of disabling.
setenforce 0
# vi /etc/selinux/config
SELINUX=permissive
Verify:
getenforce

2. MQ User, Groups & System Limits
2.1 Create MQ User
# groupadd mqm
# useradd -g mqm -m -s /bin/bash mqm
# passwd mqm
Confirm:
# id mqm

2.2 Configure File Descriptor Limits
IBM MQ opens many files and sockets under load.
# vi /etc/security/limits.d/30-ibmmq.conf
Add:
mqm     -   nofile  65536
root    -   nofile  65536
Apply immediately:
# ulimit -n 65536
Verify:
# ulimit -n

2.3 Create MQ Data Directories
# mkdir -p /ibmmq/{logs,data}
# chown -R mqm:mqm /ibmmq
# chmod -R 775 /ibmmq

3. Dependency Installation & MQ Download
3.1 Install Required Packages
# yum -y install \
bash bc ca-certificates file findutils gawk \
glibc-common grep passwd procps-ng sed \
shadow-utils tar util-linux which wget

3.2 Download IBM MQ Developer Edition
# wget -T5 -q -O mqadv_dev921_linux_x86-64.tar.gz \
https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqadv/mqadv_dev921_linux_x86-64.tar.gz
Verify download:
# ls -lh mqadv_dev921_linux_x86-64.tar.gz
Verify checksum if IBM provides SHA values.

3.3 Extract & Accept License
# tar -zxvf mqadv_dev921_linux_x86-64.tar.gz
cd MQServer
# ./mqlicense.sh -text_only -accept

4. Install IBM MQ RPMs
Install all MQ components:
# rpm -Uvh MQSeries*.rpm
Verify:
# rpm -qa | grep MQSeries
Source MQ environment:
# . /opt/mqm/bin/setmqenv -s
Verify binaries:
# dspmqver

5. Queue Manager Creation
5.1 Create a Test Queue Manager
# crtmqm -ld /ibmmq/logs -md /ibmmq/data qm1
# strmqm qm1
# endmqm -i qm1

5.2 Create Production-Style Queue Manager (QMLAB1)
# crtmqm \
-lc \
-lf 65535 \
-lp 3 \
-ls 2 \
-u SYSTEM.DEAD.LETTER.QUEUE \
QMLAB1
Explanation:
-lc → Circular logging
-lf 65535 → Large log files (better throughput)
-lp/-ls → Balanced log allocation
DLQ defined for message recovery
Start QM:
# strmqm QMLAB1
Verify:
# dspmq

6. Configure MQ Objects
6.1 MQSC Configuration
# . /opt/mqm/bin/setmqenv -n Installation1
runmqsc QMLAB1 << EOF
ALTER QMGR MAXMSGL(4194304)
ALTER QL(SYSTEM.CLUSTER.TRANSMIT.QUEUE) MAXMSGL(4194304)
DEFINE LISTENER(QMLAB1.LISTENER) TRPTYPE(TCP) PORT(1414) CONTROL(QMGR)
START LISTENER(QMLAB1.LISTENER)
DEFINE CHANNEL(QMLAB1.SVRCONN) CHLTYPE(SVRCONN) \
MCAUSER('mqm') MAXMSGL(4194304) \
DESCR('Application SVRCONN')
DEFINE QL(ORDER.INPUT) DEFPSIST(YES)
END
EOF
Verify:
# runmqsc QMLAB1
DISPLAY LS(QMLAB1.LISTENER)
DISPLAY CHANNEL(QMLAB1.SVRCONN)
6.2 Firewall Configuration
# firewall-cmd --add-port=1414/tcp --permanent
# firewall-cmd --reload
Confirm:
# firewall-cmd --list-ports

7. Message Testing
7.1 Put a Message
# printf "%s\n\n" TestMessage1 | \
/opt/mqm/samp/bin/amqsput ORDER.INPUT QMLAB1

7.2 Get the Message
# /opt/mqm/samp/bin/amqsget ORDER.INPUT QMLAB1
Message should display successfully.

8. Security Configuration
8.1 Application User Setup
# groupadd mqgroup
# useradd -m -g mqm -G mqgroup -s /bin/bash mqadm
Grant MQ permissions:
# setmqaut -m QMLAB1 -t qmgr -g mqgroup +connect +inq +dsp
# setmqaut -m QMLAB1 -n ORDER.** -t queue -g mqgroup +allmqi +dsp
Verify:
# dspmqaut -m QMLAB1 -g mqgroup

8.2 Channel Authentication
# runmqsc QMLAB1 << EOF
SET CHLAUTH(QMLAB1.SVRCONN) TYPE(ADDRESSMAP) ADDRESS('*') USERSRC(NOACCESS)
SET CHLAUTH(QMLAB1.SVRCONN) TYPE(USERMAP) CLNTUSER('order') \
USERSRC(MAP) MCAUSER('order') ADDRESS('*')
EOF
Validate rule matching:
DISPLAY CHLAUTH(QMLAB1.SVRCONN) MATCH(RUNCHECK) \
CLNTUSER('order') ADDRESS('1.2.3.4')

9. Optional Admin User Setup
# useradd mqadmin
# usermod -aG mqm mqadmin
Grant full MQ access:
# setmqaut -m QMLAB1 -t qmgr -g mqadmin +all
REFRESH SECURITY

10. Uninstallation & Cleanup
endmqm -c QMLAB1
dltmqm QMLAB1
yum -y erase MQSeries*
rm -rf /opt/mqm /var/mqm /ibmmq MQServer mqadv_dev921_linux_x86-64.tar.gz
rpm -qa | grep MQSeries

11. Final Notes
  • Developer Edition is not licensed for production
  • Always enable CHLAUTH and AUTHREC
  • Monitor /var/mqm/errors
  • Consider multi-instance QM for HA in real environments

No comments:

Post a Comment