5

On RabbitMQ 3.5.7 Ubuntu 16.04.

I want to implement RabbitMq Management plugin only on localhost, the idea is to use a tunnel to reach the RabbitMq Management Web GUI from the computer I use to connect to my server using SSH.

I found this thread that seems to document everything to do.

Here is what I have done: I edited /etc/rabbitmq/rabbitmq-env.conf, it looks like that:

export RABBITMQ_CONFIG_FILE="/etc/rabbitmq/rabbitmq.config"
# Defaults to rabbit. This can be useful if you want to run more than one node
# per machine - RABBITMQ_NODENAME should be unique per erlang-node-and-machine
# combination. See the clustering on a single machine guide for details:
# http://www.rabbitmq.com/clustering.html#single-machine
#NODENAME=rabbit

# By default RabbitMQ will bind to all interfaces, on IPv4 and IPv6 if
# available. Set this if you only want to bind to one network interface or#
# address family.
#NODE_IP_ADDRESS=127.0.0.1

# Defaults to 5672.
#NODE_PORT=5672

export RABBITMQ_NODENAME=rabbit@localhost
export RABBITMQ_NODE_IP_ADDRESS=127.0.0.1
export ERL_EPMD_ADDRESS=127.0.0.1

Then I've created and edited "/etc/rabbitmq/rabbitmq.config":

[
        {rabbitmq_management, [
                {listener,[{port, 15672},{ip, "127.0.0.1"}]}
        ]},
        {kernel, [
                {inet_dist_use_interface,{127.0.0.1}}
        ]}
].

I've launched some service rabbitmq-server reload, service rabbitmq-server stop, service rabbitmq-server start.

It did not work.

I rebooted the machine it is still not working.

When I do a sudo lsof -i-n -P I see that:

beam 1199 rabbitmq 8u IPv4 13374 0t0 TCP *:25672 (LISTEN)

beam 1199 rabbitmq 9u IPv4 13376 0t0 TCP 127.0.0.1:60223-127.0.0.1:4369 (ESTABLISHED)

beam 1199 rabbitmq 18u IPv4 14714 0t0 TCP 127.0.0.1:5672 (LISTEN)

beam 1199 rabbitmq 19u IPv4 14716 0t0 TCP *:15672 (LISTEN)

In "/var/log/rabbitmq/rabbit@localhost.log", I can see:

"config file(s) : /etc/rabbitmq/rabbitmq.config (not found)"

nyluje
  • 181
  • 1
  • 7
  • Which version of rabbitmq? Any info in the logs? – Martin Schröder Apr 07 '17 at 10:44
  • @MartinSchröder The RabbitMQ version is 3.5.7. What kind of log should I look for there? At first, it was giving me trouble to restart the service, because `export RABBITMQ_CONFIG_FILE="/etc/rabbitmq/rabbit.config"` was not located at the top of the config file and it was telling me to look for logs in `journalctl -xe`, but once I moved that line at the top of `/etc/rabbitmq/rabbitmq-env.conf` the service could reload and restart throwing no issue of any kind. – nyluje Apr 07 '17 at 23:27
  • 3.5.7 is quite old, the latest is 3.6.9. Please try this. RabbitMQ has it's own log files, see the documentation. – Martin Schröder Apr 07 '17 at 23:52

1 Answers1

3

I solved it, my mistake was:

export RABBITMQ_CONFIG_FILE="/etc/rabbitmq/rabbitmq.config" instead of export RABBITMQ_CONFIG_FILE="/etc/rabbitmq/rabbitmq" in "/etc/rabbitmq/rabbitmq-env.conf"

It is not necessary to specify the extention ".config" of the file.

And in "/etc/rabbitmq/rabbitmq.config", I just kept:

[
        {rabbitmq_management, [
                {listener,[{port, 15672},{ip, "127.0.0.1"}]}
        ]},
]

The node: {kernel, [{inet_dist_use_interface,{127.0.0.1}}]} was creating some conflict, I took it away with no further investigation.

nyluje
  • 181
  • 1
  • 7
  • 1
    I would just like to chime in that the last comma (line 4) in your example above kept my server from starting. – tedeh Sep 19 '17 at 11:31