Skip to content

Instantly share code, notes, and snippets.

@glavk
Last active February 2, 2022 09:25
Show Gist options
  • Save glavk/0ff6b96918f8ad40ec8a0b7b45b20ee4 to your computer and use it in GitHub Desktop.
Save glavk/0ff6b96918f8ad40ec8a0b7b45b20ee4 to your computer and use it in GitHub Desktop.
RabbitMQ staff

Users

Add new user user with password password and set all permissions with admin access for management plugin:

rabbitmqctl add_user user password
rabbitmqctl set_permissions user ".*" ".*" ".*"
rabbitmqctl set_user_tags user administrator

Backup / restore

First, backup and restore definitions:

curl -u user:password -X GET http://server_src:15672/api/definitions > def.json
rabbitmqctl import_definitions def.json

Then copy messages from source to target server into message directory. Needs to copy dirs msg_store_persistent/, msg_store_transient, queues and recovery.dets file.

Data direcory (base) on Ubuntu: /var/lib/rabbitmq/mnesia/rabbit@cluster_name/

For RabbitMQ 3.6 messages stores at base dir.

For RabbitMQ 3.9 messages stores at base dir into msg_stores/vhosts/HASH/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment