The article lists some useful commands for RabbitMQ adninistration.
RabbitMQ server status:
rabbitmqctl status
List of vhosts:
rabbitmqctl list_vhosts
Create vhost:
rabbitmqctl add_vhost <vhost_name>
Stop RabbitMQ application only (not both application and Erlang node):
rabbitmqctl stop_app
User management
Add user:
rabbitmqctl add_user <user> <password>
List users:
rabbitmqctl list_users
Change user`s password:
rabbitmqctl change_password <user> <new_password>
Permissions
Set permissions. Please note that granted permissions are values which map to configure, write, and read respectively. In the example below we allow the user to be able to execute a read command against any queue or
exchange, while restricting writes only to queues or exchanges whose names starts with checks-. Also, we want to prevent configure operations entirely.
rabbitmqctl set_permissions -p <vhost_name> -s all <user> "" "checks-.*" ".*"
List permissions per vhost:
rabbitmqctl list_permissions -p <vhost_name>
List permissions per user across all vhosts:
rabbitmqctl list_user_permissions <user_name>
Clear permissions:
rabbitmqctl clear_permissions -p <vhost_name> <user_name>
Server statistics
List queues:
rabbitmqctl list_queues
List queues with specific output fields:
rabbitmqctl list_queues name messages consumers memory
rabbitmqctl list_queues name durable auto_delete
List exchanges:
rabbitmqctl list_exchanges
rabbitmqctl list_exchanges name type durable auto_delete
List bindings:
rabbitmqctl list_bindings