What ports does RabbitMQ use?

bluemalkin picture bluemalkin · Oct 9, 2012 · Viewed 140.6k times · Source

What ports does RabbitMQ Server use or need to have open on the firewall for a cluster of nodes?

My /usr/lib/rabbitmq/bin/rabbitmq-env is set below which I'm assuming are needed (35197).

SERVER_ERL_ARGS="+K true +A30 +P 1048576 \   
-kernel inet_default_connect_options [{nodelay,true}] \  
-kernel inet_dist_listen_min 35197 \   
-kernel inet_dist_listen_max 35197"

I haven't touched the rabbitmq.config to set a custom tcp_listener so it should be listening on the default 5672.

Here are the relevant netstat lines:

tcp        0      0 0.0.0.0:4369           0.0.0.0:*           LISTEN      728/epmd 
tcp        0      0 0.0.0.0:35197          0.0.0.0:*           LISTEN      5126/beam
tcp6       0      0 :::5672                :::*                LISTEN      5126/beam

My questions are:

  1. for other nodes to be able to connect to the cluster, do all 3 ports 4369, 5672 and 35197 need to be open?

  2. Why isn't 5672 running on tcp and not just tcp6?

Answer

bluemalkin picture bluemalkin · Oct 10, 2012

PORT 4369: Erlang makes use of a Port Mapper Daemon (epmd) for resolution of node names in a cluster. Nodes must be able to reach each other and the port mapper daemon for clustering to work.

PORT 35197 set by inet_dist_listen_min/max Firewalls must permit traffic in this range to pass between clustered nodes

RabbitMQ Management console:

  • PORT 15672 for RabbitMQ version 3.x
  • PORT 55672 for RabbitMQ pre 3.x

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.