排除 AMQP 错误 (websphere mq)
Troubleshooring AMQP Errors (websphere mq)
有没有办法验证 AMQP 服务 运行 是否正确。安装在 Linux - RHEL 上。
AMQP Service启动时,命令结果提示启动,但是后续步骤启动channel时,报错"AMQ8494: AMQP commands are not available",报错信息描述说service is not 运行宁。 (下面描述的 STEP6 中的错误)。
显示通道状态命令也显示类似的错误 (AMQ8494)。
当前的配置步骤和遵循的验证步骤
第 1 步:设置主实例(运行 为 root)
/opt/mqm/bin/setmqinst -i -p /opt/mqm
运行 作为以下 MQM
第 2 步:创建队列管理器
/opt/mqm/bin/crtmqm QMGR_CLAIM
第三步:
更新命令级别
strmqm -e CMDLEVEL=801 QMGR_CLAIM
第四步:
启动队列管理器
/opt/mqm//bin/strmqm QMGR_CLAIM
--验证步骤:如何检查服务是否运行ning
dspmq
(显示状态 运行ning)
第 5 步:
启动 AMQP 服务
echo "START SERVICE(SYSTEM.AMQP.SERVICE)" | runmqsc QMGR_CLAIM
--验证步骤:如何检查服务是否运行ning
有没有办法验证这个实际启动的服务
服务 SYSTEM.AMQP.SERVICE 状态
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
O//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:
为队列管理器启动 MQSC QMGR_CLAIM.
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.
第 7 步:
更改默认通道,设置端口 5672
echo "ALTER CHANNEL(SYSTEM.DEF.AMQP) CHLTYPE(AMQP) PORT(5672)" | runmqsc QMGR_CLAIM
第 8 步
禁用用户授权 Channel
echo "ALTER QMGR CHLAUTH(DISABLED)" | runmqsc QMGR_CLAIM
第 9 步
启动监听器
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
您可以在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 字段被标记为 运行 - 因此服务已启动并且 运行 正确且 JVM 进程 ID 为 19254。
有没有办法验证 AMQP 服务 运行 是否正确。安装在 Linux - RHEL 上。
AMQP Service启动时,命令结果提示启动,但是后续步骤启动channel时,报错"AMQ8494: AMQP commands are not available",报错信息描述说service is not 运行宁。 (下面描述的 STEP6 中的错误)。
显示通道状态命令也显示类似的错误 (AMQ8494)。
当前的配置步骤和遵循的验证步骤
第 1 步:设置主实例(运行 为 root)
/opt/mqm/bin/setmqinst -i -p /opt/mqm
运行 作为以下 MQM 第 2 步:创建队列管理器
/opt/mqm/bin/crtmqm QMGR_CLAIM
第三步: 更新命令级别
strmqm -e CMDLEVEL=801 QMGR_CLAIM
第四步: 启动队列管理器
/opt/mqm//bin/strmqm QMGR_CLAIM
--验证步骤:如何检查服务是否运行ning dspmq (显示状态 运行ning)
第 5 步: 启动 AMQP 服务
echo "START SERVICE(SYSTEM.AMQP.SERVICE)" | runmqsc QMGR_CLAIM
--验证步骤:如何检查服务是否运行ning 有没有办法验证这个实际启动的服务 服务 SYSTEM.AMQP.SERVICE 状态
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
O//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:
为队列管理器启动 MQSC QMGR_CLAIM.
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.
第 7 步: 更改默认通道,设置端口 5672
echo "ALTER CHANNEL(SYSTEM.DEF.AMQP) CHLTYPE(AMQP) PORT(5672)" | runmqsc QMGR_CLAIM
第 8 步 禁用用户授权 Channel
echo "ALTER QMGR CHLAUTH(DISABLED)" | runmqsc QMGR_CLAIM
第 9 步 启动监听器
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
您可以在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 字段被标记为 运行 - 因此服务已启动并且 运行 正确且 JVM 进程 ID 为 19254。