I am running a RabbitMQ Management console on a machine where port above 10000 range are blocked using firewall. Can I change the port so that I can use any one of 9000 range ports ?
Please help!
By default, RabbitMQ will listen on port 5672 on all available interfaces. It is possible to limit client connections to a subset of the interfaces or even just one, for example, IPv6-only interfaces.
Last updated: 2019-09-03. The RabbitMQ Management is a user-friendly interface that let you monitor and handle your RabbitMQ server from a web browser. Among other things queues, connections, channels, exchanges, users and user permissions can be handled - created, deleted and listed in the browser.
RabbitMQ has a config file rabbitmq.config.example
or just rabbitmq.config
under /etc/rabbitmq
directory on linux servers.
Locate the rabbitmq_management
tuple and change the port value (default is 12345
, change it to whatever you want).
Be sure to uncomment or add the following content into /etc/rabbitmq/rabbitmq.config
file as shown below.
{rabbitmq_management,[{listener, [{port, 12345}]}]}
Then restart the RabbitMQ server instance once
$ sudo /etc/init.d/rabbitmq-server restart
The documentation explains it well: https://www.rabbitmq.com/management.html What makes me respond here is all above responses although correct, they use the legacy "syntax", the new and recommended way of configuring RabbitMQ moves away from the Erlang legacy style, story short:
management.tcp.port = 15672
Normally, RabbitMQ doesn't comes with config file, so you need to create it:
sudo nano /etc/rabbitmq/rabbitmq.config
And you can add this content
%% -*- mode: erlang -*-
%% ----------------------------------------------------------------------------
%% RabbitMQ Sample Configuration File.
%%
%% Related doc guide: http://www.rabbitmq.com/configure.html. See
%% http://rabbitmq.com/documentation.html for documentation ToC.
%% ----------------------------------------------------------------------------
[
{rabbit,
[
]},
{kernel,
[
]},
{rabbitmq_management,
[
{listener, [{port, 3009}
]}
]},
{rabbitmq_shovel,
[{shovels,
[
]}
]},
{rabbitmq_stomp,
[
]},
{rabbitmq_mqtt,
[
]},
{rabbitmq_amqp1_0,
[
]},
{rabbitmq_auth_backend_ldap,
[
]},
{lager, [
]}
].
As you can see, I changed my rabbitmq_management port to 3009 according to the firewall of my server.
After that, you need to modify the /etc/rabbitmq/rabbitmq-env.conf by adding this line:
export RABBITMQ_CONFIG_FILE="/etc/rabbitmq/rabbitmq"
The .config will be automatically added.
By the end, just restart the service:
sudo /etc/init.d/rabbitmq-server restart
#rpm -qa | grep rabbit
rabbitmq-server-3.6.10-1.el7.noarch
#rpm -ql rabbitmq-server-3.6.10-1.el7.noarch
search file like /usr/sbin/rabbitmq-server
cat /usr/sbin/rabbitmq-server | grep RABBITMQ_ENV
RABBITMQ_ENV=/usr/lib/rabbitmq/bin/rabbitmq-env
open file # vi /usr/lib/rabbitmq/bin/rabbitmq-env
*change according to you port
#DEFAULT_NODE_PORT=5672
DEFAULT_NODE_PORT=2055
After change first kill rabbitmq process and then restart.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With