Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

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

like image 389
Nick Boudreau Avatar asked Sep 25 '22 15:09

Nick Boudreau


People also ask

How do I install Rabbitmqadmin?

rabbitmqadmin can be downloaded from any RabbitMQ node that has the management plugin enabled. Navigate to http://{hostname}:15672/cli/rabbitmqadmin to download it. The tool requires a supported version of Python to be installed.

How do I connect to my RabbitMQ remote server?

Create new RabbitMQ user and set permissions To create a new RabbitMQ user to access the RabbitMQ server remotely: Open a browser and navigate to http://localhost:15672/. The RabbitMQ Management login screen displays. Log into RabbitMQ using guest as both the username and password.

How do I check my RabbitMQ connection?

Here are the recommended steps: Make sure the node is running using rabbitmq-diagnostics status. Verify config file is correctly placed and has correct syntax/structure. Inspect listeners using rabbitmq-diagnostics listeners or the listeners section in rabbitmq-diagnostics status.


2 Answers

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.

like image 173
alex Avatar answered Sep 28 '22 04:09

alex


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

like image 40
Chris Avatar answered Sep 28 '22 05:09

Chris