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

查看:1349
本文介绍了将外部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和I上的所有内容都启动Rabbit MQ服务器w / defaults就可以正常工作。

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,但是当我从 telnet box.a.ip.addy 5672 中获取
时,从BI框获取:

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

这里还有一些从一开始up log:

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

此外,根据此文档,它声明默认绑定到所有接口。也许您的系统中已经设置了一个配置设置或环境变量,以将服务器限制为localhost,从而覆盖您执行的任何操作。

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应该已经返回Connection Refused而不是No route to host。我还会检查您是否遇到与防火墙相关的问题。

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天全站免登陆