Install rabbitmqadmin on linux
Asked Answered
C

5

25

I'm trying to install and be able to run rabbitmqadmin on a linux machine. Following the instructions described here do not help.

After downloading the file linked, it prompts to copy the file (which looks like a python script) into /usr/local/bin.

Trying to run it by simply invoking rabbitmqadmin results in rabbitmqadmin: command not found. There seems to be no information anywhere about how to get this to work and assumes that all the steps listed on the site should work for all. It seems odd that simply copying a python script to the bin folder should allow it to become a recognised command without having to invoke the python interpreter every time.

Any help is appreciated.

Charentemaritime answered 31/3, 2016 at 14:19 Comment(3)
That should work fine unless, for some strange reason, /usr/local/bin is not specified on your $PATH.Pinwheel
"without having to invoke the python interpreter" — see en.wikipedia.org/wiki/Shebang_(Unix)Pinwheel
/usr/local/bin is indeed specified on my $PATH.Charentemaritime
C
16

RabbitMQ decided to omit one vital piece of information.

Make the script executable with chmod +x otherwise it will fail to work.

Charentemaritime answered 31/3, 2016 at 14:41 Comment(0)
D
23

I spent several hours to figure out this, use rabbitmqadmin on linux environment, Finally below steps solve my issue.

On my ubuntu server, python3 was installed, I checked it using below command,

python3 -V

Step 1: download the python script to your linux server

wget https://raw.githubusercontent.com/rabbitmq/rabbitmq-management/v3.7.8/bin/rabbitmqadmin

Step2: change the permission

chmod 777 rabbitmqadmin

Step3: change the header of the script as below(first line)

#!/usr/bin/env python3

Thant's all, Now you can run below commands,

To list down queues,

./rabbitmqadmin -f tsv -q list queues

To Delete ques,

./rabbitmqadmin delete queue name=name_of_queue

To add binding between exchange and queue

./rabbitmqadmin declare binding source="exchangename" destination_type="queue" destination="queuename" routing_key="routingkey"
Deepfreeze answered 19/11, 2018 at 16:34 Comment(1)
This helped, however I disagree with the chmod 777 and agree with @Charentemaritime in regard to the only adding of the execute permissions. I would further that to only the user/group of that will be running the commands as well.Miscegenation
C
16

RabbitMQ decided to omit one vital piece of information.

Make the script executable with chmod +x otherwise it will fail to work.

Charentemaritime answered 31/3, 2016 at 14:41 Comment(0)
E
9

I want to post my commands for installing rabbitmqadmin, it is combination of other answers, but with a little improvements for using best practice:

sudo rabbitmq-plugins enable rabbitmq_management
wget 'https://raw.githubusercontent.com/rabbitmq/rabbitmq-management/v3.7.15/bin/rabbitmqadmin'
chmod +x rabbitmqadmin
sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python3|' rabbitmqadmin
mv rabbitmqadmin .local/bin/
rabbitmqadmin -q list queues

I suppose that you already create .local/bin/ dir and add it to PATH (on Ubuntu bash add this dir to PATH if it exists).

Erna answered 24/5, 2019 at 13:42 Comment(0)
A
4

After install Rabbbitmq on Ubuntu/Debian, you can activate the Rabbitmq Admin Portal using the next command:

rabbitmq-plugins enable rabbitmq_management

Then you can access to the portal from http://localhost:15672. Use the user/password "guest".

Atronna answered 11/12, 2016 at 0:0 Comment(0)
H
4

Below the steps to install rabbimqadmin:

cd /usr/local/bin/
wget http://127.0.0.1:15672/cli/rabbitmqadmin
chmod 777 rabbitmqadmin

For more details check the official documentation Obtaining rabbitmqadmin

Haehaecceity answered 25/3, 2022 at 14:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.