将外部 IP 地址绑定到 Rabbit MQ 服务器 [英] Binding external IP address to Rabbit MQ server

查看:40
本文介绍了将外部 IP 地址绑定到 Rabbit MQ 服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有盒子 A,它上面有一个在 Rabbit MQ 服务器上侦听的消费者

I have box A and it has a consumer on it that listens on a Rabbit MQ server

我有框 B,它将向侦听器发布消息

I have box B that will publish a message to the listener

所以只要所有这些都在框 A 上,我启动 Rabbit MQ 服务器 w/默认它就可以正常工作.

So as long as all of this in on box A and I start Rabbit MQ server w/ defaults it works fine.

端口 5672 上的默认值为 host=127.0.0.1,但是当我从框 B telnet box.a.ip.addy 5672 我得到:

The defaults are host=127.0.0.1 on port 5672, but when I telnet box.a.ip.addy 5672 from box B I get:

Trying  box.a.ip.addy...
telnet: connect to address  box.a.ip.addy: No route to host
telnet: Unable to connect to remote host: No route to host

22 端口上的 telnet 很好,我可以从 Box B SSH 到 Box A

telnet on port 22 is fine, I can ssh into Box A from Box B

所以我假设我需要更改 RabbitMQ 服务器使用的 ip我发现了这个:http://www.rabbitmq.com/configure.html 现在我在将文档定位,名称为 rabbitmq.config,其中包含:

So I assume I need to change the ip that the RabbitMQ server uses I found this: http://www.rabbitmq.com/configure.html and I now have a config file in the location the documentation said to use, with the name rabbitmq.config and it contains:

[
    {rabbit, [{tcp_listeners, {"box.a.ip.addy", 5672}}]}
].

所以我停止了服务器,并再次启动了 RabbitMQ 服务器.它失败了.以下是错误日志中的错误.这有点过头了.(事实上​​大部分是)

So I stopped the server, and started RabbitMQ server again. It failed. Here are the errors from the error logs. It's a little over my head. (in fact most of this is)

=ERROR REPORT==== 23-Aug-2011::14:49:36 ===
FAILED
Reason: {{case_clause,{{"box.a.ip.addy",5672}}},
         [{rabbit_networking,'-boot_tcp/0-lc$^0/1-0-',1},
          {rabbit_networking,boot_tcp,0},
          {rabbit_networking,boot,0},
          {rabbit,'-run_boot_step/1-lc$^1/1-1-',1},
          {rabbit,run_boot_step,1},
          {rabbit,'-start/2-lc$^0/1-0-',1},
          {rabbit,start,2},
          {application_master,start_it_old,4}]}

=INFO REPORT==== 23-Aug-2011::14:49:37 ===
    application: rabbit
    exited: {bad_return,{{rabbit,start,[normal,[]]},
                         {'EXIT',{rabbit,failure_during_boot}}}}
    type: permanent

以下是启动日志中的更多内容:

and here is some more from the start up log:

Erlang has closed
Error: {node_start_failed,normal}
^M
Crash dump was written to: erl_crash.dump^M
Kernel pid terminated (application_controller) ({application_start_failure,rabbit,{bad_return,{{rabbit,start,[normal,[]]},{'EXIT',{rabbit,failure_during_boot}}}}})^M

请帮忙

推荐答案

你尝试添加了吗?

RABBITMQ_NODE_IP_ADDRESS=box.a.ip.addy

RABBITMQ_NODE_IP_ADDRESS=box.a.ip.addy

到/etc/rabbitmq/rabbitmq.conf 文件?

to the /etc/rabbitmq/rabbitmq.conf file?

http://www.rabbitmq.com/configure.html#customise-general-unix-environment

此外,根据本文档,它声明默认绑定到所有接口.也许您的系统中已经设置了配置设置或环境变量,以将服务器限制在本地主机上,覆盖您所做的任何其他事情.

Also per this documentation it states that the default is to bind to all interfaces. Perhaps there is a configuration setting or environment variable already set in your system to restrict the server to localhost overriding anything else you do.

更新: 再次阅读后,我意识到 telnet 应该返回拒绝连接"而不是没有到主机的路由".我还会检查您是否遇到与防火墙相关的问题.

UPDATE: After reading again I realize that the telnet should have returned "Connection Refused" not "No route to host." I would also check to see if you are having a firewall related issue.

这篇关于将外部 IP 地址绑定到 Rabbit MQ 服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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