Nick Boudreau
Nick Boudreau

Reputation: 133

rabbitmqadmin [Errno 111] Connection refused

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:

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.

Upvotes: 8

Views: 13315

Answers (3)

alex
alex

Reputation: 955

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.

Upvotes: 11

Anton Borisovich
Anton Borisovich

Reputation: 9

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

Upvotes: 0

Chris
Chris

Reputation: 6193

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.)

Upvotes: 2

Related Questions