Environment variables - Zerpet/docker-rabbitmq-cluster GitHub Wiki

This section contains the environment variables that can be used to customize the deployment. The important or non-standard variables are explained in more detail. If a variable is not covered in detail, it probably is self explanatory and/or inherited from the official RabbitMQ docker image.

  • NODENAME: String ( default: rabbit )
  • ENABLE_RAM -> Boolean ( default: false )
  • CLUSTER_WITH -> String ( empty/no default )
  • RABBITMQ_ERLANG_COOKIE -> String ( random generated )
  • RABBITMQ_DEFAULT_USER -> String ( default: guest )
  • RABBITMQ_DEFAULT_PASS -> String ( default: guest )
  • RABBITMQ_DEFAULT_VHOST -> String ( default: "/" )
  • RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS -> String ( empty/no default )

The variable RABBITMQ_ERLANG_COOKIE is very important because RabbitMQ uses this information to communicate betweek the brokers; it is also used by command line tools (e.g. rabbitmqctl). If the Erlang cookie is different between two nodes, the broker will refuse to join the cluster.

NODENAME

This variable sets the name of the RabbitMQ node. The long name of a node in RabbitMQ is @ by default. The node name is rabbit by default. The node name should be unique per erlang-node-and-machine combination. Unless you are planning to extend this image to run multiple RabbitMQ nodes inside the same container, this is purely cosmetic.

ENABLE_RAM

This variable sets if a node should be started as a RAM node. This is false by default. RAM nodes do not have any persistence and all information will be lost upon restart. RabbitMQ documentation has more details on the node types.

Setting this variable to 'true' will join the node as a RAM node during the startup.

CLUSTER_WITH

This variable sets the node to join to form a cluster. Usually this will be the name of the first service in the Compose file. For example, a Compose file with nodes server-1 and server-2 will set this variable to server-1. This variable has to be set only on the "slave" nodes.

RABBITMQ_ERLANG_COOKIE

This variable sets the value for the Erlang cookie. This variable must be set to the same value in all the services, otherwise the nodes will fail to join the cluster. The value of this variable is encoded; the encoded value is printed in RabbitMQ log during startup.

⚠️ **GitHub.com Fallback** ⚠️