将外部IP地址绑定到Rabbit MQ服务器

Kac*_*ser 8 ip rabbitmq

我有一个方框A,它上面有一个用户监听Rabbit MQ服务器

我有一个盒子B,它会向收听者发布一条消息

因此,只要在方框A和我的所有这一切启动Rabbit MQ服务器w /默认值它就可以正常工作.

端口5672上的默认值为host = 127.0.0.1,但是当我telnet box.a.ip.addy 5672从Box BI获取时:

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
Run Code Online (Sandbox Code Playgroud)

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

所以我假设我需要更改RabbitMQ服务器使用的ip我发现这个:http://www.rabbitmq.com/configure.html我现在在文档说要使用的位置有一个配置文件,名称rabbitmq.config,它包含:

[
    {rabbit, [{tcp_listeners, {"box.a.ip.addy", 5672}}]}
].
Run Code Online (Sandbox Code Playgroud)

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

=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
Run Code Online (Sandbox Code Playgroud)

这里还有一些来自启动日志:

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
Run Code Online (Sandbox Code Playgroud)

请帮忙

Har*_*ood 9

你尝试过添加吗?

RABBITMQ_NODE_IP_ADDRESS = box.a.ip.addy

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

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

此外,根据此文档,它指出默认绑定到所有接口.可能在您的系统中已经设置了配置设置或环境变量,以将服务器限制为localhost,从而覆盖您执行的任何其他操作.

更新:再次阅读后,我意识到telnet应该返回"Connection Refused"而不是"No route to host".我还会检查您是否遇到与防火墙相关的问题.