---
name: "ocf_heartbeat_rabbitmq-server-ha"
section: "7"
platform: "linux"
package: "resource-agents"
version: "1:4.16.0-3+deb13u2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/ocf_heartbeat_rabbitmq-server-ha"
---

# ocf\_heartbeat\_rabbitmq-server-ha(7)

Resource agent for RabbitMQ HA cluster

## NAME

ocf\_heartbeat\_rabbitmq-server-ha - Resource agent for RabbitMQ HA cluster

## SYNOPSIS

**rabbitmq-server-ha** \[start \| stop \| status \| monitor \| promote \| demote \| meta-data \| validate-all\]

## DESCRIPTION

Resource agent for RabbitMQ promotes a node, then cluster nodes can join it

## SUPPORTED PARAMETERS

**binary**

RabbitMQ binary

(optional, string, default "/usr/sbin/rabbitmq-server")

**ctl**

rabbitctl binary

(optional, string, default "/usr/sbin/rabbitmqctl")

**pid\_file**

RabbitMQ PID file

(optional, string, default "/var/run/rabbitmq/pid")

**log\_dir**

RabbitMQ log directory

(optional, string, default "/var/log/rabbitmq")

**username**

RabbitMQ user name

(optional, string, default "rabbitmq")

**groupname**

RabbitMQ group name

(optional, string, default "rabbitmq")

**admin\_user**

RabbitMQ default admin user for API

(optional, string, default "guest")

**admin\_password**

RabbitMQ default admin user password for API

(optional, string, default "guest")

**definitions\_dump\_file**

RabbitMQ default definitions dump file

(optional, string, default "/etc/rabbitmq/definitions")

**command\_timeout**

Timeout command arguments for issued commands termination (value is auto evaluated)

(optional, string, no default)

**start\_time**

Timeout for start rabbitmq server

(optional, string, default "7")

**stop\_time**

Timeout for stopping rabbitmq server

(optional, string, default "7")

**debug**

The debug flag for agent (/usr/sbin/rabbitmq-server) instance. In the /tmp/ directory will be created rmq-\* files for log some operations and ENV values inside OCF-script.

(optional, boolean, default false)

**mnesia\_base**

Base directory for storing Mnesia files

(optional, boolean, default /var/lib/rabbitmq/mnesia)

**mnesia\_schema\_base**

Parent directory for Mnesia schema directory

(optional, string, default "/var/lib/rabbitmq")

**host\_ip**

/usr/sbin/rabbitmq-server should listen on this IP address

(optional, boolean, default 127.0.0.1)

**node\_port**

/usr/sbin/rabbitmq-server should listen on this port

(optional, boolean, default 5672)

**default\_vhost**

Default virtual host used for monitoring if a node is fully synchronized with the rest of the cluster. In normal operation, the resource agent will wait for queues from this virtual host on this node to be synchronized elsewhere before stopping RabbitMQ. This also means queues in other virtual hosts may not be fully synchronized on stop operations.

(optional, string, default "/")

**erlang\_cookie**

Erlang cookie for clustering. If specified, will be updated at the mnesia reset

(optional, boolean, default false)

**erlang\_cookie\_file**

Erlang cookie file path where the cookie will be put, if requested

(optional, boolean, default /var/lib/rabbitmq/.erlang.cookie)

**use\_fqdn**

Either to use FQDN or a shortname for the rabbitmq node

(optional, boolean, default false)

**fqdn\_prefix**

Optional FQDN prefix for RabbitMQ nodes in cluster. FQDN prefix can be specified to host multiple RabbitMQ instances on a node or in case of RabbitMQ running in dedicated network/interface.

(optional, string, no default)

**max\_rabbitmqctl\_timeouts**

If during monitor call rabbitmqctl times out, the timeout is ignored unless it is Nth timeout in a row. Here N is the value of the current parameter. If too many timeouts happen in a raw, the monitor call will return with error.

(optional, string, default "3")

**policy\_file**

A path to the shell script to setup RabbitMQ policies

(optional, string, default "/usr/local/sbin/set\_rabbitmq\_policy")

**rmq\_feature\_health\_check**

Since rabbit 3.6.4 list\_queues/list\_channels-based monitoring should be replaced with "node\_health\_check" command, as it creates no network load at all.

(optional, boolean, default true)

**rmq\_feature\_local\_list\_queues**

For rabbit version that implements --local flag for list\_queues, this can greatly reduce network overhead in cases when node is stopped/demoted.

(optional, boolean, default true)

**limit\_nofile**

Soft and hard limit for NOFILE

(optional, string, default "65535")

**avoid\_using\_iptables**

When set to true the iptables calls to block client access become noops. This is useful when we run inside containers.

(optional, boolean, default false)

**allowed\_cluster\_nodes**

When set to anything other than the empty string it must container the list of cluster node names, separated by spaces, where the rabbitmq resource is allowed to run. Tis is needed when rabbitmq is running on a subset of nodes part of a larger cluster. The default ("") is to assume that all nodes part of the cluster will run the rabbitmq resource.

(optional, string, no default)

## SUPPORTED ACTIONS

This resource agent supports the following actions (operations):

**start**

Starts the resource. Suggested minimum timeout: 20s.

**stop**

Stops the resource. Suggested minimum timeout: 20s.

**status**

Performs a status check. Suggested minimum timeout: 20s.

**monitor**

Performs a detailed status check. Suggested minimum timeout: 30s. Suggested interval: 5s.

**monitor (Promoted role)**

Performs a detailed status check. Suggested minimum timeout: 30s. Suggested interval: 3s.

**promote**

Promotes the resource to the Master role. Suggested minimum timeout: 30s.

**demote**

Demotes the resource to the Slave role. Suggested minimum timeout: 30s.

**notify**

Suggested minimum timeout: 20s.

**validate-all**

Performs a validation of the resource configuration. Suggested minimum timeout: 5s.

**meta-data**

Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5s.

## EXAMPLE CRM SHELL

The following is an example configuration for a rabbitmq-server-ha resource using the [**crm**(8)](/crm/8.md) shell:

```
primitive p_rabbitmq-server-ha ocf:heartbeat:rabbitmq-server-ha \
  op monitor depth="0" timeout="30s" interval="5s" \
  op monitor depth="0" timeout="30s" interval="3s" role="Promoted"
```

```
ms ms_rabbitmq-server-ha p_rabbitmq-server-ha \
  meta notify="true" interleave="true"
```

## EXAMPLE PCS

The following is an example configuration for a rabbitmq-server-ha resource using [**pcs**(8)](/pcs/8.md)

```
pcs resource create p_rabbitmq-server-ha ocf:heartbeat:rabbitmq-server-ha \
  op monitor OCF_CHECK_LEVEL="0" timeout="30s" interval="5s" \
  op monitor OCF_CHECK_LEVEL="0" timeout="30s" interval="3s" role="Promoted" promotable
```

## SEE ALSO

**http://clusterlabs.org/**

## AUTHOR

**ClusterLabs contributors (see the resource agent source for information about individual authors)**
