rabbitmqadmin socket.error:[errno 104]连接由peer重置

时间:2015-01-09 13:09:36

标签: linux command-line rabbitmq amqp rabbitmqadmin

我在Linux机器上安装了Rabbitmq 3.4,它在5672端口上运行。 当我尝试申报交换时,它会提示我错误。

 ./rabbitmqadmin declare exchange --vhost=localhost name=SAMPLE_EXCHANGE type=direct

使用兔子qqadmin的python脚本,它位于/usr/local/bin/

错误 -

Traceback (most recent call last):
  File "/usr/local/bin/rabbitmqadmin", line 953, in <module>
    main()
  File "/usr/local/bin/rabbitmqadmin", line 389, in main
    method()
  File "/usr/local/bin/rabbitmqadmin", line 569, in invoke_declare
    self.put(uri, json.dumps(upload))
  File "/usr/local/bin/rabbitmqadmin", line 415, in put
    return self.http("PUT", "/api%s" % path, body)
  File "/usr/local/bin/rabbitmqadmin", line 441, in http
    resp = conn.getresponse()
  File "/usr/lib64/python2.6/httplib.py", line 990, in getresponse
    response.begin()
  File "/usr/lib64/python2.6/httplib.py", line 391, in begin
    version, status, reason = self._read_status()
  File "/usr/lib64/python2.6/httplib.py", line 349, in _read_status
    line = self.fp.readline()
  File "/usr/lib64/python2.6/socket.py", line 433, in readline
    data = recv(1)
socket.error: [Errno 104] Connection reset by peer

帮助我解决此错误,如果需要,将提供更多信息。

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,但是对我来说,下一步是:

运行带有端口列表的Rabbit

docker run -d --name rabbitmq -p 4369:4369 -p 5671:5671 -p 5672:5672 -p 15672:15672 rabbitmq:3.8.1

并启用rabbitmq_management

docker exec rabbitmq rabbitmq-plugins enable rabbitmq_management

15672:HTTP API客户端,管理UI和Rabbitmqadmin(仅在启用了管理插件的情况下)来源:https://www.rabbitmq.com/networking.html#ports

我也使用此命令来声明交换

rabbitmqadmin -V vhost_name -u rabbit_user -p rabbit_password declare exchange name=test_name type=direct