I am trying to set up a rabbitmq cluster on with aws container service. I need the /var/lib/rabbitmq/.erlang.cookie
to be the same on all nodes. So for all my rabbitmq containers when they are run I pass in a RABBITMQ_ERLANG_COOKIE
environment variable which according to documentation here https://hub.docker.com/_/rabbitmq/ should be written into /var/lib/rabbitmq/.erlang.cookie
.
When I inspect my running container I can see that environment variable RABBITMQ_ERLANG_COOKIE=QOKWQHQKXXTBIEAOPWKE
is present but when i cat /var/lib/rabbitmq/.erlang.cookie
I get a different value AYMNAPKRPCPJVPFYAJZX
.
As a result all rabbitmq containers have different .erlang.cookie
and cannot form a cluster.
Why isn't the cookie from environment variable set? What could I be missing here?
I am using rabbitmq:3.6.9-alpine image.