RabbitMq: Adding user permanently?

Viewed 2321

I use the following commands to add a user of RabbitMQ on CentOS 7

rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"

The problem is that this configuration is not permanent so I do the same thing everytime when I restart the server.

Is there any way to make it permanent?

Also, If I have a cluster of nodes do I have to add the same user on each one?

1 Answers

RabbitMQ user configurations are permanent.

Issue maybe comes from missing/wrong rabbitmq_mqtt configurations at rabbitmq.config file.

when you set up RabbitMQ by some provision tools (ansible, chef,...) some roles do not include the rabbitmq.config file (or blank file)

==> broken rabbitmq_mqtt and other configs, so that when you create users by rabbitmqctl, they're only on this working session. That's why they lost when restart rabbit service (new session).

Quick solution: cross-check with the original file from rabbit

See the original file at https://github.com/rabbitmq/rabbitmq-server/blob/master/docs/rabbitmq.config.example#L696-L761

Related