RabbitMQ 接受连接但在接受任何输入之前关闭它们 [英] RabbitMQ accepting connections but closing them before accepting any input

查看:57
本文介绍了RabbitMQ 接受连接但在接受任何输入之前关闭它们的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我刚刚安装了最新版本的 rabbitmq,我一直在努力让它工作.服务器正在运行,我已重新启动它一次,以确保这是一个一致的问题.

So I just installed the latest version of rabbitmq and I've been trying to get it to work. The server is running and I've restarted it once just to be sure it's a consistent problem.

如果我telnet localhost 5672,我得到

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.

如您所见,连接已被接受,但 rabbitmq 不接受任何输入.连接立即关闭.日志中没有显示更多信息.

As you can see, the connection is accepted but rabbitmq does not accept any input. The connection is closed immediately. No further information shows up in logs.

rabbitmqctl 工作没有任何问题.

这是在适用于 Linux/Ubuntu 的 Windows 子系统上运行的.对于本地开发环境,我没有任何其他选择,因为我在一台锁定得很紧的工作计算机上.

This is running on Windows Subsystem for Linux / Ubuntu. I don't have any other options for a local dev environment because I'm on a work computer which is locked down pretty tightly.

推荐答案

我遇到了同样的问题,在 Windows 和 rabbitmq 3.7.8 上使用 Ubuntu(16.04) 作为子系统.我注意到在运行 sudo rabbitmqctl status 时,监听器显示如下:

I ran into the same issue, using Ubuntu(16.04) as a subsystem on Windows and rabbitmq 3.7.8. I noticed that when running sudo rabbitmqctl status the listeners showed the following:

{listeners,[{clustering,25672,"::"},{amqp,5672,"::"}]}

我通过创建 rabbitmq 配置文件并指定本地主机和端口 5762 来解决此问题

I fixed this issue by creating a rabbitmq config file and specifying the localhost and port 5762

这是我一步一步做的.

  1. 使用 sudo &&vim,我创建了一个rabbitmq.conf"文件,位于/etc/rabbitmq/

  1. Using sudo && vim, I created a 'rabbitmq.conf' file, located in /etc/rabbitmq/

sudo vim /etc/rabbimq/rabbitmq.conf

  • 我指定了默认的本地主机(127.0.0.1)和端口(5672)rabbitmq.conf文件中的tcp监听器

  • I specified the localhost(127.0.0.1) and port(5672) for the default tcp listener in the rabbitmq.conf file

    listeners.tcp.default = 127.0.0.1:5672
    

  • 重启rabbitmq

  • Restart rabbitmq

    sudo service rabbitmq-server stop

    然后

    sudo service rabbitmq-server start

    检查 sudo rabbitmqctl status 并查看侦听器,您应该会看到带有 localhost ip sepcified 的新 tcp 侦听器

    Check sudo rabbitmqctl status and look at the listeners, you should see your new tcp listener with the localhost ip sepcified

    {listeners,[{clustering,25672,"::"},{amqp,5672,"127.0.0.1"}]}

    {listeners,[{clustering,25672,"::"},{amqp,5672,"127.0.0.1"}]}

    这是来自 rabbitmq 的 配置文档 可能会有所帮助阐明其中一些步骤.

    Here is the config docs from rabbitmq that may help clarify some of these steps.

    这篇关于RabbitMQ 接受连接但在接受任何输入之前关闭它们的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆