有没有办法验证AMQP服务是否正常运行。安装在Linux上 - RHEL。
启动AMQP服务时,命令结果表明它已启动,但是当在连续步骤中启动通道时,它会显示错误“AMQ8494:AMQP命令不可用”,错误消息描述表示服务未运行。 (STEP6中的错误如下所述)。
显示通道状态命令也显示类似的错误(AMQ8494)。
第1步:设置主要实例(以root身份运行)
/opt/mqm/bin/setmqinst -i -p /opt/mqm
以MQM身份运行以进行跟踪 第2步:创建队列管理器
/opt/mqm/bin/crtmqm QMGR_CLAIM
STEP3: 更新命令级别
strmqm -e CMDLEVEL=801 QMGR_CLAIM
STEP4: 启动队列管理器
/opt/mqm//bin/strmqm QMGR_CLAIM
- 验证步骤:如何检查服务是否正在运行 dspmq (显示运行状态)
STEP5: 启动AMQP服务
echo "START SERVICE(SYSTEM.AMQP.SERVICE)" | runmqsc QMGR_CLAIM
- 验证步骤:如何检查服务是否正在运行 有没有办法验证这个实际启动的服务 service SYSTEM.AMQP.SERVICE status
O / P:
Starting MQSC for queue manager QMGR_CLAIM.
1 : START SERVICE(SYSTEM.AMQP.SERVICE)
AMQ8733: Request to start Service accepted.
One MQSC command read.
No commands have a syntax error.
All valid MQSC commands were processed.
第6步: 启动默认频道
echo "START CHANNEL (SYSTEM.DEF.AMQP)" | runmqsc QMGR_CLAIM
0 //,P:
Starting MQSC for queue manager QMGR_CLAIM.
1 : START CHANNEL (SYSTEM.DEF.AMQP)
AMQ8494: AMQP commands are not available.
One MQSC command read.
No commands have a syntax error.
One valid MQSC command could not be processed.
--Verification STEPS
Display default channel
echo "display CHANNEL(SYSTEM.DEF.AMQP) CHLTYPE(AMQP)" | runmqsc QMGR_CLAIM
O / P:
为队列管理器QMGR_CLAIM启动MQSC。
1 : display CHANNEL(SYSTEM.DEF.AMQP) CHLTYPE(AMQP)
AMQ8414: Display Channel details.
CHANNEL(SYSTEM.DEF.AMQP) CHLTYPE(AMQP)
ALTDATE(2015-11-12) ALTTIME(18.38.30)
CERTLABL( ) DESCR( )
AMQPKA(AUTO) LOCLADDR( )
MAXINST(999999999) MAXMSGL(4194304)
MCAUSER( ) PORT(5672)
SSLCAUTH(REQUIRED) SSLCIPH( )
SSLPEER( ) USECLTID(NO)
One MQSC command read.
No commands have a syntax error.
All valid MQSC commands were processed.
Display channel status
echo "dis chstatus(SYSTEM.DEF.AMQP) chltype(AMQP) all" | runmqsc QMGR_CLAIM
echo "display chstatus(*)" | runmqsc QMGR_CLAIM
O/P:
Starting MQSC for queue manager QMGR_CLAIM.
1 : display chstatus(*)
AMQ8420: Channel Status not found.
One MQSC command read.
No commands have a syntax error.
One valid MQSC command could not be processed.
STEP7: 更改默认频道,设置端口5672
echo "ALTER CHANNEL(SYSTEM.DEF.AMQP) CHLTYPE(AMQP) PORT(5672)" | runmqsc QMGR_CLAIM
STEP8 禁用用户授权频道
echo "ALTER QMGR CHLAUTH(DISABLED)" | runmqsc QMGR_CLAIM
STEP9 启动监听器
echo "start LISTENER(SYSTEM.DEFAULT.LISTENER.TCP)" | runmqsc QMGR_CLAIM
--Verification
echo "DISPLAY LSSTATUS(*) STATUS" | runmqsc QMGR_CLAIM
echo "display lsstatus(SYSTEM.DEFAULT.LISTENER.TCP)" | runmqsc QMGR_CLAIM
ps -ef | grep runmqlsr | grep 1414
答案 0 :(得分:1)
您可以使用runmqsc中的DISPLAY SVSTATUS命令检查AMQP服务的状态。您应该得到与此类似的输出:
DIS SVSTATUS(SYSTEM.AMQP.SERVICE)
3 : DIS SVSTATUS(SYSTEM.AMQP.SERVICE)
AMQ8632: Display service status details.
SERVICE(SYSTEM.AMQP.SERVICE) STATUS(RUNNING)
PID(19254) SERVTYPE(SERVER)
STARTDA(2015-11-11) STARTTI(16.04.51)
CONTROL(QMGR) STARTCMD(/opt/mqmAMQP//bin/amqp.sh)
STARTARG(start -m QM1 -d "/var/mqm/qmgrs/QM1//." -g "/var/mqm//.")
STOPCMD(/opt/mqmAMQP//bin/amqp.sh)
STOPARG(stop -m QM1 -d "/var/mqm/qmgrs/QM1//." -g "/var/mqm//.")
DESCR(Manages clients that use the AMQP protocol)
STDOUT(/var/mqm/qmgrs/QM1//amqp.stdout)
STDERR(/var/mqm/qmgrs/QM1//amqp.stderr)
您可以看到STATUS字段被标记为RUNNING - 因此服务已启动且运行正常且JVM进程ID为19254。