Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Binding external IP address to Rabbit MQ server

Tags:

rabbitmq

ip

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

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

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

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

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

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}}]}
].

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

Please help

like image 655
KacieHouser Avatar asked Aug 23 '11 21:08

KacieHouser


People also ask

How do I connect to RabbitMQ server remotely?

Create new RabbitMQ user and set permissions To create a new RabbitMQ user to access the RabbitMQ server remotely: Open a browser and navigate to http://localhost:15672/. The RabbitMQ Management login screen displays. Log into RabbitMQ using guest as both the username and password.

Does RabbitMQ use TCP or UDP?

Clients communicate with RabbitMQ over the network. All protocols supported by the broker are TCP-based. Both RabbitMQ and the operating system provide a number of knobs that can be tweaked. Some of them are directly related to TCP and IP operations, others have to do with application-level protocols such as TLS.

How do I connect to RabbitMQ Vhost?

View vhosts by entering the admin tab and select the Virtual Hosts. Select the Add New Virtual Host options to create a new vhost. The permissions within the vhost and the users assigned to it depend on your system requirements, and it's up to you to assign users to the vhost.

What ports need to be open for RabbitMQ?

PORT 5672 RabbitMQ main port. For a cluster of nodes, they must be open to each other on 35197 , 4369 and 5672 . For any servers that want to use the message queue, only 5672 is required.


1 Answers

did you try adding?

RABBITMQ_NODE_IP_ADDRESS=box.a.ip.addy

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

Per 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.

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.

like image 129
Harmon Wood Avatar answered Oct 05 '22 06:10

Harmon Wood