---
name: "ocf_heartbeat_galera"
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_galera"
---

# ocf\_heartbeat\_galera(7)

Manages a galera instance

## NAME

ocf\_heartbeat\_galera - Manages a galera instance

## SYNOPSIS

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

## DESCRIPTION

Resource script for managing galera database.

## SUPPORTED PARAMETERS

**binary**

Location of the MySQL server binary

(optional, string, no default)

**client\_binary**

Location of the MySQL client binary

(optional, string, no default)

**config**

Configuration file

(optional, string, no default)

**datadir**

Directory containing databases

(optional, string, no default)

**user**

User running MySQL daemon

(optional, string, no default)

**group**

Group running MySQL daemon (for logfile and directory permissions)

(optional, string, no default)

**log**

The logfile to be used for mysqld.

(optional, string, no default)

**pid**

The pidfile to be used for mysqld.

(optional, string, no default)

**socket**

The socket to be used for mysqld.

(optional, string, no default)

**enable\_creation**

If the MySQL database does not exist, it will be created

(optional, boolean, default false)

**additional\_parameters**

Additional parameters which are passed to the mysqld on startup. (e.g. --skip-external-locking or --skip-grant-tables)

(optional, string, no default)

**wsrep\_cluster\_address**

The galera cluster address. This takes the form of: gcomm://node,node,node

Only nodes present in this node list will be allowed to start a galera instance. The galera node names listed in this address are expected to match valid pacemaker node names. If both names need to differ, you must provide a mapping in option cluster\_host\_map.

(required, string, no default)

**cluster\_host\_map**

A mapping of pacemaker node names to galera node names.

To be used when both pacemaker and galera names need to differ, (e.g. when galera names map to IP from a specific network interface) This takes the form of: pcmk1:node.1.galera;pcmk2:node.2.galera;pcmk3:node.3.galera

where the galera resource started on node pcmk1 would be named node.1.galera in the wsrep\_cluster\_address

(optional, string, no default)

**check\_user**

Cluster check user.

(optional, string, no default)

**check\_passwd**

Cluster check user password. Empty passwords are ignored unless the parameter "check\_passwd\_use\_empty" is set to 1.

(optional, string, no default)

**check\_passwd\_use\_empty**

Use an empty "check\_passwd" password. If this parameter is set to 1, "check\_passwd" will be ignored and an empty password is used when calling the "mysql" client binary.

(optional, boolean, default 0)

**two\_node\_mode**

If running in a 2-node pacemaker cluster, rely on pacemaker quorum to allow automatic recovery even when the other node is unreachable. Use it with caution! (and fencing)

(optional, boolean, default false)

## SUPPORTED ACTIONS

This resource agent supports the following actions (operations):

**start**

Starts the resource. Suggested minimum timeout: 120s.

**stop**

Stops the resource. Suggested minimum timeout: 120s.

**status**

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

**monitor**

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

**monitor (Promoted role)**

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

**promote**

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

**demote**

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

**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 galera resource using the [**crm**(8)](/crm/8.md) shell:

```
primitive p_galera ocf:heartbeat:galera \
  params \
    wsrep_cluster_address=string \
  op monitor depth="0" timeout="30s" interval="20s" \
  op monitor role="Promoted" depth="0" timeout="30s" interval="10s"
```

```
ms ms_galera p_galera \
  meta notify="true" interleave="true"
```

## EXAMPLE PCS

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

```
pcs resource create p_galera ocf:heartbeat:galera \
  wsrep_cluster_address=string \
  op monitor OCF_CHECK_LEVEL="0" timeout="30s" interval="20s" \
  op monitor role="Promoted" OCF_CHECK_LEVEL="0" timeout="30s" interval="10s" promotable
```

## SEE ALSO

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

## AUTHOR

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