2

I have rabbitmq docker container, running on different machine. What I want to do is execute rabbitmqctl command using shell script from another machine. I am newbie to rabbitmq, need guidance of experts

I have used rabbitmqadmin with the option of -H to connect to remote server. I am able to connect and perform rabbitmqadmin commands. But there is no option for rabbitmqctl to connect to a remote server.

$ rabbitmqadmin -H 127.2.2.1 -u abc -p abc list vhosts

$ rabbitmqctl add_vhost xyz

I want to execute command rabbitmqctl on remote machine. rabbitmqadmin does work.

How can I make rabbitmqctl work in the same way. Please guide.

Sachin Bankar
  • 372
  • 6
  • 13

1 Answers1

3

rabbitmqadmin uses the HTTP API, so it is enough to reach the http endpoint.

rabbitmqctl uses the erlang distribution, and in order to work it needs the same .erlang.cookie installed on the remote machine.

you can use -n paramenter in this way:

rabbitmqctl -n rabbit@remotemachine 

Check the documentation for more details

DimiDak
  • 4,820
  • 2
  • 26
  • 32
Gabriele Santomaggio
  • 21,656
  • 4
  • 52
  • 52