rabbitmqadmin [Errno 111] Connection refused

Nick Boudreau picture Nick Boudreau · Jan 20, 2016 · Viewed 8k times · Source

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.

Answer

alex picture alex · Jun 6, 2021

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.