简介
本文档介绍如何清除高级消息队列协议(AMQP)心跳队列的故障排除过程
供稿:Aswathi Surendran、Gustavo Bell Cisco TAC工程师。
先决条件
要求
Cisco 建议您了解以下主题:
使用的组件
本文档中的信息基于以下软件版本:
- CloudCenter版本4.3.x到4.6.x
- CloudCenter消息总线(RabbitMQ_Server)
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您使用的是真实网络,请确保您已经了解所有命令的潜在影响。
背景信息
池的活动线程大小为64,其中与作业对应的已提交线程大于3000,该线程将被拒绝,因为代码一次处理的线程数不能超过64个,因此它将等待前一任务完成并执行另一任务。
如果任何任务大于线程池可以使用的任务,则会被拒绝。
问题
filecliqr-connection.log在/usr/local/tomcatgua/logs/ report错误中定位:
Caused by: org.springframework.core.task.TaskRejectedException: Executor [java.util.concurrent.ThreadPoolExecutor@6737f4fb[Running, pool size = 64, active threads = 64, queued tasks = 3000, completed tasks = 413]] did not accept task: org.springframework.aop.interceptor.AsyncExecutionInterceptor$1@6b0517b3
at org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor.submit(ThreadPoolTaskExecutor.java:284)
at org.springframework.aop.interceptor.AsyncExecutionAspectSupport.doSubmit(AsyncExecutionAspectSupport.java:186)
at org.springframework.aop.interceptor.AsyncExecutionInterceptor.invoke(AsyncExecutionInterceptor.java:123)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
at com.sun.proxy.$Proxy84.processMessage(Unknown Source)
at com.osmosix.commons.messaging.listeners.impl.DefaultNodeMessageListener.handleMessage(DefaultNodeMessageListener.java:35)
at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:269)
at org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter.invokeListenerMethod(MessageListenerAdapter.java:383)
... 12 more
Caused by: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@3911a213 rejected from java.util.concurrent.ThreadPoolExecutor@6737f4fb[Running, pool size = 64, active threads = 64, queued tasks = 3000, completed tasks = 413]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2047)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1369)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor.submit(ThreadPoolTaskExecutor.java:281)
... 23 more
2016-10-19 02:32:32,205 INFO annotation.RequestMappingHandlerMapping [localhost-startStop-1] - Mapped "{[/image/service/dltargetlocal],methods=[POST]}" onto public java.util.Map<java.lang.String, ?> com.osmosix.gateway.image.transform.ImageTransformController.downloadToTargetLocal(com.osmosix.commons.image.transform.DownloadImageFileRequest)
2016-10-19 02:32:32,206 WARN listener.ConditionalRejectingErrorHandler [SimpleAsyncTaskExecutor-1] - Execution of Rabbit message listener failed.
org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener method 'handleMessage' threw exception
at org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter.invokeListenerMethod(MessageListenerAdapter.java:391)
at org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter.onMessage(MessageListenerAdapter.java:294)
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:757)
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:680)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$001(SimpleMessageListenerContainer.java:93)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$1.invokeListener(SimpleMessageListenerContainer.java:183)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.invokeListener(SimpleMessageListenerContainer.java:1352)
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:661)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doReceiveAndExecute(SimpleMessageListenerContainer.java:1096)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.receiveAndExecute(SimpleMessageListenerContainer.java:1080)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$800(SimpleMessageListenerContainer.java:93)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1197)
at java.lang.Thread.run(Thread.java:745)
分辨率
步骤1: 通过SSH登录RabbitMQ服务器。
步骤2.切换到根用户。
# sudo -i
步骤3.启用管理插件。
# rabbitmq-plugins enable rabbitmq_management
步骤4.启用对rabbitmqadmin命令的访问。
# chmod +x `find /var/lib/rabbitmq/ -name "rabbitmqadmin"`
# ln -s `find /var/lib/rabbitmq/ -name "rabbitmqadmin"` /usr/sbin
步骤5. RabbitMQ可通过GUI访问。
http://
:15672 (username=cliqr password=cliqr)
注意:将配置中的RabbitMQ_Server_IP替换为RabbitMQ服务器地址
导航队列选项卡,查看详细信息
或
CLI:
# rabbitmqadmin -V /cliqr -u cliqr -p cliqr list queues
# rabbitmqadmin -V /cliqr -u cliqr -p cliqr list exchanges
# rabbitmqadmin -V /cliqr -u cliqr -p cliqr list channels
步骤6.删除网关心跳队列。
#rabbitmqadmin -V /cliqr delete queue name=cliqr.gateway.heartbeat.queue --username=cliqr --password=cliqr
步骤 7. 在RabbitServer中重新启动tomcat服务。
#/etc/init.d/tomcatgua stop
#/etc/init.d/tomcatgua start
注意:如果cliqr.gateway.heartbeat.queue缺失,请按照以下步骤重新启动CCO tomcat服务:
步骤 8 通过SSH登录CCO服务器。
步骤9.切换到根用户。
# sudo -i
步骤10.重新启动Tomcat服务器。
#/etc/init.d/tomcat stop
#/etc/init.d/tomcat start