So, in the tips and tricks that are out there, you will find suggestions on how to set up an MQ queue manager as a systemd service. Here is a quick refinement for a slightly more robust version and the inclusion of an IIB (or ACE) integration node.
The following shows the necessary settings and commands (and tests the service). This works with integration nodes that are associated with queue mangers of the same name. (A practice I have personally adopted for a good few years - for numerous good reasons, including the fact that is simple to remember.)
These are scant notes, but you should be able to 'read between the lines'. Enjoy!
crtmqm -ld /var/mqm/log -md /var/mqm/qmgrs -lf 16384 -lc -lp 5 -ls 5 -u SYSTEM.DEAD.LETTER.QUEUE TEST
strmqm TEST
mqsicreatebroker TEST -q TEST -w /var/mqsi -o advanced -s inactive
endmqm TEST
Switch to root:
su -
intadm belongs to mqm (primary group) and mqbrkrs
vi /etc/systemd/system/mq@.service
[Unit]
Description=IBM MQ queue manager %I
After=network.target
[Service]
ExecStart=/opt/mqm/bin/strmqm %I
ExecStop=/opt/mqm/bin/endmqm -w %I
Type=forking
User=mqm
Group=mqm
KillMode=mixed
LimitNOFILE=10240
LimitNPROC=4096
TimeoutStopSec=90s
[Install]
WantedBy=multi-user.target
vi /etc/systemd/system/iib@.service
[Unit]
Description=IIB integration node %I
Requires=mq@.service
After=mq@.service
#StartLimitIntervalSec=10s - these two are default
#StartLimitBurst=5
[Service]
ExecStart=/bin/bash -c 'source /opt/mqsi/iib-10.0.0.21/server/bin/mqsiprofile && /opt/mqsi/iib-10.0.0.21/server/bin/mqsistart %I'
ExecStop=/bin/bash -c 'source /opt/mqsi/iib-10.0.0.21/server/bin/mqsiprofile && /opt/mqsi/iib-10.0.0.21/server/bin/mqsistop %I'
Type=forking
User=intadm
Group=mqm
KillMode=mixed
LimitNOFILE=10240
LimitNPROC=4096
Restart=on-abnormal
RestartSec=5s
RestartPreventExitStatus=SIGKILL
TimeoutStopSec=90s
[Install]
WantedBy=multi-user.target
systemctl enable iib@TEST
systemctl start iib@TEST
To manually stop, each associated service is independent:
systemctl stop iib@TEST
systemctl stop mq@TEST
So, the following will only restart the node, right?
systemctl restart iib@TEST
Some commands to check the status or for any errors:
systemctl status iib@TEST
journalctl -u iib@NODE01
systemctl --type=service --state=running
To check particular settings, for example:
systemctl show -p RestartSec iib@NODE01
After making any adjustments:
systemctl daemon-reload
systemctl disable iib@TEST
su - intadm
mqsideletebroker TEST
dltmqm TEST
Comments
Post a Comment