5

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?

Abu Muhammad
  • 1,185
  • 5
  • 20
  • 29
  • 1
    This is permanent. Do you have problem after restart? – Gabriele Santomaggio Mar 24 '16 at 16:19
  • 1
    restating Gabriele: if this isn't permanent, you have problems with your system that need to be diagnosed. try looking at your rabbitmq logs to see if you're getting errors. also make sure the account running rabbitmq has all the permissions it need son the file system. – Derick Bailey Mar 24 '16 at 19:32
  • It is working now. I don't know why it was not working before. – Abu Muhammad Mar 25 '16 at 16:19

1 Answers1

1

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

Hieu Huynh
  • 1,005
  • 11
  • 18