Skip to content
This repository has been archived by the owner on Feb 15, 2018. It is now read-only.

General Settings

Alexey Lebedeff edited this page Dec 21, 2016 · 24 revisions

Configuration for the plugin can be set in two places: operating system environment variables or the rabbitmq.config file under the autocluster stanza.

Available Settings

The following settings are available for all service discovery backends:

Backend Type
Which type of service discovery backend to use. One of aws, consul, dns, or etcd.
Startup Delay
To prevent a race condition when creating a new cluster for the first time, the startup delay performs a random sleep that should cause nodes to start in a slightly random offset from each other. The setting lets you control the maximum value for the startup delay.
Failure Mode
What behavior to use when the node fails to cluster with an existing RabbitMQ cluster or during initialization of the autocluster plugin. The two valid options are ignore and stop.
Log Level
Prior to v0.6, log level can be set using RabbitMQ's log_levels configuration - as described at the end of this page. Starting with v0.6 you can set the log level via the environment variable AUTOCLUSTER_LOG_LEVEL or the autocluster_log_level setting of the autocluster application.
Longname (FQDN) Support
This is a RabbitMQ environment variable setting that is used by the autocluster plugin as well. When set to true this will cause RabbitMQ and the autocluster plugin to use fully qualified names to identify nodes. For more information about the RABBITMQ_USE_LONGNAME environment variable, see the RabbitMQ documentation.
Node Name
Like Longname Support, Node Name is a RabbitMQ setting that is used by the autocluster plugin as well. When set to true this will cause RabbitMQ and the autocluster plugin. The RABBITMQ_NODENAME environment variable explicitly sets the node name that is used to identify the node with RabbitMQ. The autocluster plugin will use this value when constructing the local part/name/prefix for all nodes in this cluster. For example, if RABBITMQ_NODENAME is set to bunny@rabbit1, bunny will be prefixed to all nodes discovered by the various backends. For more information about the RABBITMQ_NODENAME environment variable, see the RabbitMQ documentation.
Node Type
Define the type of node to join the cluster as. One of disc or ram. See the RabbitMQ Clustering Guide for more information.
Cluster Cleanup

Enables a periodic check that removes any nodes that are not alive in the cluster and no longer listed in the service discovery list. This is a destructive action that removes nodes from the cluster. Nodes that are flapping and removed will be re-added as if they were coming in new and their database, including any persisted messages will be gone. To use this feature, you must not only enable it with this flag, but also disable the "Cleanup Warn Only" flag. Added in v0.5

Note: This is an experimental feature and should be used with caution.

Cleanup Interval
If cluster cleanup is enabled, this is the interval that specifies how often to look for dead nodes to remove (in seconds). Added in v0.5
Cleanup Warn Only
If set, the plugin will only warn about nodes that it would cleanup and will not perform any destructive actions on the cluster. Added in v0.5

Settings Details

You are able to configure autocluster plugin via Environment Variables or in the rabbitmq.config file.

Note: RabbitMQ reads its own config file with environment variables - rabbitmq-env.conf, but you can't easily reuse it for autocluster configuration. If you absolutely want to do it, you should use export VAR_NAME=var_value instead of a plain assignment to VAR_NAME.

The following chart details each general setting, with the environment variable name, rabbitmq.config setting key and data type, and the default value if there is one.

Setting Environment Variable Setting Key Type Default
Backend Type AUTOCLUSTER_TYPE backend atom unconfigured
Startup Delay AUTOCLUSTER_DELAY startup_delay integer 5
Failure Mode AUTOCLUSTER_FAILURE autocluster_failure atom ignore
Log Level AUTOCLUSTER_LOG_LEVEL autocluster_log_level atom info
Longname RABBITMQ_USE_LONGNAME   bool false
Node Name RABBITMQ_NODENAME   string rabbit@$HOSTNAME
Node Type RABBITMQ_NODE_TYPE node_type atom disc
Cluster Cleanup AUTOCLUSTER_CLEANUP cluster_cleanup bool false
Cleanup Interval CLEANUP_INTERVAL cleanup_interval integer 60
Cleanup Warn Only CLEANUP_WARN_ONLY cleanup_warn_only bool true

Logging Configuration prior to v0.6

This is the only way to enable debug logging for the plugin for versions prior to v0.6. Since v0.6 it's no longer effective, you should use AUTOCLUSTER_LOG_LEVEL environment variable or autocluster_log_level setting.

autocluster will register itself as a configured logger with RabbitMQ if no log configuration for it exists. To configure logging for the plugin, you add it to the rabbit log_levels configuration like so:

[{rabbit, [
  {log_levels, [{autocluster, debug}, {connection, info}]}
]}].

Valid log levels are debug, info, warning, and error. For more information on configuring RabbitMQ logging, reference the log_levels key in the RabbitMQ documentation.

  • Home
  • Configuration
    • [General Settings](General Settings)
    • [AWS](AWS Configuration)
    • [Consul](Consul Configuration)
    • [DNS](DNS Configuration)
    • [etcd](etcd Configuration)
    • [k8s](k8s Configuration)
  • Development
  • Roadmap
Clone this wiki locally