-
Notifications
You must be signed in to change notification settings - Fork 120
General Settings
Configuration for the plugin can be set in two places: operating system environment variables
or the rabbitmq.config
file under the autocluster
stanza.
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
, oretcd
. - 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
andstop
. - 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 variableAUTOCLUSTER_LOG_LEVEL
or theautocluster_log_level
setting of theautocluster
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 theRABBITMQ_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. TheRABBITMQ_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, ifRABBITMQ_NODENAME
is set tobunny@rabbit1
,bunny
will be prefixed to all nodes discovered by the various backends. For more information about theRABBITMQ_NODENAME
environment variable, see the RabbitMQ documentation. - Node Type
- Define the type of node to join the cluster as. One of
disc
orram
. 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
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 forautocluster
configuration. If you absolutely want to do it, you should useexport VAR_NAME=var_value
instead of a plain assignment toVAR_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 |
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