Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rabbitmq listens on all interfaces

It appears that my rabbitmq listens on all interfaces despite:

In /etc/rabbitmq/rabbitmq.config:

[{rabbit, [{tcp_listeners, [{"10.0.0.1", 5672}]}]},
  {rabbitmq_mochiweb, [{listeners, [{mgmt, [{ip, "10.0.0.1"},
                                            {port, 55672}]}]}]}].

In /etc/rabbitmq/rabbitmq-env.conf:

export RABBITMQ_NODENAME=rabbit
export RABBITMQ_NODE_IP_ADDRESS=10.0.0.1
export ERL_EPMD_ADDRESS=10.0.0.1

When i run netstat -uptan | grep beam i get:

tcp        0      0 10.0.0.1:5672           0.0.0.0:*               LISTEN      1378/beam
tcp        0      0 0.0.0.0:33551           0.0.0.0:*               LISTEN      1378/beam
tcp        0      0 127.0.0.1:38737         127.0.0.1:4369          ESTABLISHED 1378/beam

How do i make beam not listening on 0.0.0.0:33551 ?

like image 725
pablox Avatar asked Dec 01 '13 19:12

pablox


People also ask

What port does RabbitMQ listen on?

By default, RabbitMQ will listen on port 5672 on all available interfaces.

How do I run RabbitMQ on a different port?

C:\Users\Administrator\AppData\Roaming\RabbitMQ : This is the main directory where we going to change the config file. Edit the “rabbitmq. config” file, and find the “rabbitmq_management” subject and change the port number that you want to use.

Does RabbitMQ use UDP?

RabbitMQ "UDP Exchange" Plugin. Extends RabbitMQ Server with support for a new experimental exchange type, x-udp . Each created x-udp exchange listens on a specified UDP port for incoming messages, and relays them on to the queues bound to the exchange.


1 Answers

tcp 0 0 127.0.0.1:38737 127.0.0.1:4369 ESTABLISHED 1378/beam says that beam process enables Erlang distributed protocol and connected to epmd daemon on 127.0.0.1:4369. Also beam process waits for incoming connections on 0.0.0.0:33551. This interface secured with Erlang cookies and rabbitmqctl uses it to connect to RabbitMQ instance and manage it.

To make it able to accept connections only from localhost you can:

  • use -kernel inet_dist_use_interface '{127,0,0,1}' kernel configuration flag from shell or create my_rabbitmq.conf:

    [{kernel,[{inet_dist_use_interface,{127,0,0,1}}]}].

    and use RabbitMQ environment variable to include it: export RABBITMQ_CONFIG_FILE="/path/to/my_rabbitmq.conf" to use configuration file

  • put in your /etc/rabbitmq/rabbitmq.conf export ERL_EPMD_ADDRESS=127.0.0.1 Erlang environment variable

like image 128
sysoff Avatar answered Sep 28 '22 06:09

sysoff