无。公司就是用的IBM WebSphere MQ作为消息中间件,本文记载how install it.
1. 检查
通过rpm –qa检查是否已经安装 IBM MQ,若已安装,就不必再安装了(或用卸载rpm –e XXX重装):
rpm -qa | grep MQ
2. 准备如下安装包:
WS_MQ_LINUX_ON_X86_64_7.5.0.2_IMG.tar.gz
tar -zvxf WS_MQ_LINUX_ON_X86_64_7.5.0.2_IMG.tar.gz –C /odata/mqm/
说明:-C选项是将压缩包解压到指定目录,解压后文件夹目录如下:
其中:
XXX.rpm是具体的package。如MQSeriesRuntime是MQ运行环境、MQSeriesSDK是MQ软件开发包、MQSeriesServer是MQ服务端包。
mqlicense.sh是IBM MQ 许可授权证书脚本,要求你同意其认证许可。
运行刚才的mqlicense.sh脚本,输入“1”接受其认证。好奇的同学也可以输入3、4查看证书是什么。
IBM MQ服务端最主要的三个package是:
MQSeriesRuntime-7.5.0-2.x86_64.rpm
MQSeriesSDK-7.5.0-2.i386.rpm
MQSeriesServer-7.5.0-2.i386.rpm
如果你不想用rpm –ivh命令一个一个安装,可以偷懒用通配符安装全部package。由于我之前已经安装过,所以显示为already installed。
[root@t24app1sg mqm]<20181031 10:34:56># rpm -ivh ./*.rpm
Preparing... ################################# [100%]
package MQSeriesRuntime-7.5.0-2.x86_64 is already installed
package MQSeriesJRE-7.5.0-2.x86_64 is already installed
package MQSeriesJava-7.5.0-2.x86_64 is already installed
package MQSeriesFTBase-7.5.0-2.x86_64 is already installed
package MQSeriesServer-7.5.0-2.x86_64 is already installed
package MQSeriesFTAgent-7.5.0-2.x86_64 is already installed
package MQSeriesFTService-7.5.0-2.x86_64 is already installed
package MQSeriesAMS-7.5.0-2.x86_64 is already installed
package MQSeriesFTLogger-7.5.0-2.x86_64 is already installed
package MQSeriesXRService-7.5.0-2.x86_64 is already installed
package MQSeriesFTTools-7.5.0-2.x86_64 is already installed
package MQSeriesExplorer-7.5.0-2.x86_64 is already installed
package MQSeriesGSKit-7.5.0-2.x86_64 is already installed
package MQSeriesClient-7.5.0-2.x86_64 is already installed
package MQSeriesMan-7.5.0-2.x86_64 is already installed
package MQSeriesMsg_cs-7.5.0-2.x86_64 is already installed
package MQSeriesMsg_de-7.5.0-2.x86_64 is already installed
package MQSeriesMsg_es-7.5.0-2.x86_64 is already installed
package MQSeriesMsg_fr-7.5.0-2.x86_64 is already installed
package MQSeriesMsg_hu-7.5.0-2.x86_64 is already installed
package MQSeriesMsg_it-7.5.0-2.x86_64 is already installed
package MQSeriesMsg_ja-7.5.0-2.x86_64 is already installed
package MQSeriesMsg_ko-7.5.0-2.x86_64 is already installed
package MQSeriesMsg_pl-7.5.0-2.x86_64 is already installed
package MQSeriesMsg_pt-7.5.0-2.x86_64 is already installed
package MQSeriesMsg_ru-7.5.0-2.x86_64 is already installed
package MQSeriesMsg_Zh_CN-7.5.0-2.x86_64 is already installed
package MQSeriesMsg_Zh_TW-7.5.0-2.x86_64 is already installed
package MQSeriesSamples-7.5.0-2.x86_64 is already installed
package MQSeriesSDK-7.5.0-2.x86_64 is already installed
package MQSeriesXRClients-7.5.0-2.x86_64 is already installed
4. 安装后检查
安装完毕后,系统会自动为MQ新建一个用户(mqm),用于MQ的相关操作,且安装文件位于/opt/mqm。我们可以在mqm用户的profile文件.bash_profile中加入环境变量,以便mqm用找到相关的可执行程序:
su - mqm
vim .bash_profile
在.profile文件的最后增加一行
. /opt/mqm/bin/setmqenv -n Installation1
同时,安装完成后,系统可能会提示你运行su - mqm -c "/opt/mqm/bin/mqconfig"检查系统的相关配置,如下:
这项检查是为了充分发挥MQ的性能,忽略也行。如本文检查system V 信号量(Semaphore)配置不够,但依旧使用。
1. 切换到mqm用户下
su - mqm
2. 创建并运行QM,
[mqm@t24app1sg ~]<20181031 10:58:06>$ crtmqm QM_TEST
WebSphere MQ queue manager created.
Directory '/var/mqm/qmgrs/QM_TEST' created.
The queue manager is associated with installation 'Installation1'.
Creating or replacing default objects for queue manager 'QM_TEST'.
Default objects statistics : 74 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.
[mqm@t24app1sg ~]<20181031 10:58:22>$ strmqm QM_TEST
WebSphere MQ queue manager 'QM_TEST' starting.
The queue manager is associated with installation 'Installation1'.
5 log records accessed on queue manager 'QM_TEST' during the log replay phase.
Log replay for queue manager 'QM_TEST' complete.
Transaction manager state recovered for queue manager 'QM_TEST'.
WebSphere MQ queue manager 'QM_TEST' started using V7.5.0.2.
[mqm@t24app1sg ~]<20181031 10:58:48>$ dspmq
QMNAME(QM_ZAVIER1) STATUS(Ended normally)
QMNAME(QM_TEST) STATUS(Running)
[mqm@t24app1sg ~]<20181031 10:58:51>$
测试结果表明,安装没问题。至于后续各种配listener、qlocal、qremote、channel等等,需要根据具体的业务场景深入了解IBM MQ的用法。
谢谢