[rabbitmq-discuss] is it possible to have broker listen on multiple ports

Matthew Sackman matthew at lshift.net
Fri Nov 20 12:53:09 GMT 2009


Hi Mark,

Staggeringly, this doesn't seem to be on our website, and the FAQ entry
is wrong. You want to alter the tcp_listeners argument to Rabbit.
Unfortunately, the ways of doing this are all pretty grim and I've
raised a bug internally for us to look at this and sort things out.
Ideally, you should be able to make an entry in
/etc/rabbitmq/rabbitmq.config so that the file looks a bit like:

[{rabbit, [{tcp_listeners, [{'10.224.189.156', 3333},
                            {'10.224.189.156', 3334}
                           ]
           }
          ]
 }
].

That will tell Rabbit to listen on ports 3333 and 3334 on the indicated
IP. You can use '0.0.0.0' to indicate all network interfaces. Don't
forget the quotes around the IP addresses, otherwise Rabbit will fail to
parse the configuration file.

However, sadly, Rabbit's start-up scripts override the configuration for
tcp_listeners. Thus, edit /usr/lib/rabbitmq/bin/rabbitmq-server. Towards
the bottom, you'll find a line:

    -rabbit tcp_listeners '[{"'${RABBITMQ_NODE_IP_ADDRESS}'", '${RABBITMQ_NODE_PORT}'}]' \

Just remove that line completely, and save the file. Then, when starting
rabbit, you should find entries in the logs indicating it has correctly
started listening on all the interfaces specified.

This will definitely work on 1.7. On 1.6, the configuration file didn't
exist, and whilst there are ways around, they're even more hairy, so I
would encourage you to stick with 1.7!

Matthew




More information about the rabbitmq-discuss mailing list