123
分类: LINUX
2019-07-03 08:46:58
问题描述: 点击流程调用无反应,rabbitmq日志/var/log/rabbitmq/rabbit\@localhost.log存在大量如下报错:
=ERROR REPORT==== 2-Jul-2019::12:13:24 ===
closing AMQP connection <0.1077.0> (127.0.0.1:37722 -> 127.0.0.1:5672):
{handshake_timeout,frame_header}
解决方法:
(1)使用rabbitmqctl list_connections命令查看连接情况,发现只有一条starting的记录,正常情况应该都是running。
(2)rabbitmqctl list_queues检查队列信息:
[root@zdhzx ~]# rabbitmqctl list_queues
Listing queues ...
awx_private_queue 0
callback_tasks 0
tower_broadcast_all_zdhzx 0
zdhzx 0
...done.
[root@zdhzx ~]#
(3)ping主机名zdhzx,不通。
(4)将zdhzx加到/etc/hosts第一行之后:
[root@zdhzx ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 zdhzx
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@zdhzx ~]#
(5)再次检查连接情况
[root@zdhzx ~]# rabbitmqctl list_connections
Listing connections ...
guest 127.0.0.1 37553 running
guest 127.0.0.1 37728 running
guest 127.0.0.1 37729 running
guest 127.0.0.1 37730 running
guest 127.0.0.1 37751 running
guest 127.0.0.1 37752 running
guest 127.0.0.1 37759 running
guest 127.0.0.1 37762 running
guest 127.0.0.1 37763 running
guest 127.0.0.1 37795 running
guest 127.0.0.1 37802 running
guest 127.0.0.1 37818 running
guest 127.0.0.1 37819 running
guest 127.0.0.1 37828 running
guest 127.0.0.1 37829 running
guest 127.0.0.1 37834 running
guest 127.0.0.1 37835 running
guest 127.0.0.1 37851 running
guest 127.0.0.1 37856 running
guest 127.0.0.1 37857 running
guest 127.0.0.1 37858 running
guest 127.0.0.1 37859 running
guest 127.0.0.1 37895 running
guest 127.0.0.1 37896 running
guest 127.0.0.1 38011 closed
...done.
[root@zdhzx ~]#
(6)检查日志,不再出现handshake_timeout报错。
(7)前台调用流程,可正常调用。
原因总结:主机名未加成/etc/hosts中,无法解析。