rabbitmqadmin [Errno 111] Connection refused
Asked Answered
S

3

8

So I keep getting "connection refused" from rabbitmqadmin. I'm running debian 7 on a vm as root user. I installed rabbitmq-server with apt-get, started it up and did the following:

rabbitmqctl add_user test 1234
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
rabbitmq-plugins enable rabbitmq_management

cd /usr/local/bin/
wget https://raw.githubusercontent.com/rabbitmq/rabbitmq-management/rabbitmq_v3_5_6/bin/rabbitmqadmin
chmod +x rabbitmqadmin

rabbitmqadmin -H 127.0.0.1 -u test -p 1234 list vhosts

But the call to rabbitmqadmin always results in Could not connect: [Errno 111] Connection refused

I have tried the following:

  • restarting the service (/etc/init.d/rabbitmq-server restart/stop/start)
  • verified that rabbitmq-management is enabled via rabbitmq-plugins list and checking /etc/rabbitmq/enabled_plugins
  • verified that rabbitmq-management actually started by checking rabbitmqctl status and the rabbitmq logs
  • removing/reinstalling rabbitmq-server
  • removing/reinstalling rabbitmqadmin
  • i checked that 127.0.0.1 was in fact listed in /etc/hosts

I tried rabbitmqadmin list users and I get the same problem. I'm pretty stumped, any ideas?

note: i'm not sure if it's relevant, but i had some trouble getting rabbitmq-server installed, i kept getting "unmet dependencies" issues and running apt-get -f install would remove some other packages that i needed. i think the problem actually came from installing erlang, and eventually got it working by going through the tree of unmet dependencies and installing each of them one at a time until erlang and rabbitmq-server were both installed.

ALSO i added "deb http://http.debian.net/debian wheezy-backports main" to /etc/apt/sources.list so i also tried removing rabbitmq-server, removing the repo, apt-get update and reinstalling rabbitmq-server, still nothing.

Serranid answered 20/1, 2016 at 22:56 Comment(2)
did you tried to access using the browser ? http://localhost:15672/Youthen
So I eventually gave up and managed to get it running by using CentOS and the "barebones" version of erlang that rabbitmq provides on their website.Serranid
D
11

on debian 10, rabbitmq-server installed a lot of plugins, but enabled none by default.

you may list them as root with:

rabbitmq-plugins list

then you may:

rabbitmq-plugins enable rabbitmq_management

now you may run, as non-root user:

rabbitmqadmin list queues

and even

rabbitmqadmin delete queue name=rpc_queue

i did no special configuration.

Deodar answered 6/6, 2021 at 13:57 Comment(1)
This worked for me on Windows as well. It also enabled the admin management via browser at localhost:15672/Truffle
S
2

I found this solution:

rabbitmqadmin needs to talk to the management-website of the server. The same which you use as an admin. The default seems to be TCP port 15672, but the config that I am using (also Debian, but 9) is port 8080.

I found which port the management-interface runs on by looking into /etc/rabbitmq/rabbitmq.config where I found this:

       {rabbitmq_management, [{listener, [{port, 8080},

You could probably also try to check which open ports belong to the rabbitmq-server and try them all.

Finally, to use this information, I have created a config-file for rabbitmqadmin under ~/.rabbitmqadmin.conf and filled it with the info found in the output of rabbitmqadmin help config. (It might be important to remove leading spaces.)

Stanwin answered 24/4, 2019 at 11:34 Comment(0)
G
0

just remove: /etc/rabbitmq/rabbitmq.conf and restart the service

Glad answered 3/2, 2020 at 7:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.