---
name: "ocf_heartbeat_mysql-proxy"
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_mysql-proxy"
---

# ocf\_heartbeat\_mysql-proxy(7)

Manages a MySQL Proxy instance

## NAME

ocf\_heartbeat\_mysql-proxy - Manages a MySQL Proxy instance

## SYNOPSIS

**mysql-proxy** \[start \| stop \| monitor \| meta-data \| validate-all\]

## DESCRIPTION

This script manages MySQL Proxy as an OCF resource in a high-availability setup.

The default monitor operation will verify that mysql-proxy is running.

The level 10 monitor operation is left out intentionally for possible future enhancements in conjunction with the admin plugin.

The level 20 monitor operation will perform a SELECT on a given table to verify that the connection to a back-end server is actually working.

Tested with MySQL Proxy 0.8.1 and 0.8.3 on Debian 6.0.

## SUPPORTED PARAMETERS

**binary**

Full path to the MySQL Proxy binary. For example, "/usr/sbin/mysql-proxy".

(optional, string, default "/usr/sbin/mysql-proxy")

**client\_binary**

Location of the MySQL client binary.

(optional, string, default "mysql")

**defaults\_file**

Full path to a MySQL Proxy configuration file. For example, "/etc/mysql-proxy.conf".

(optional, string, no default)

**proxy\_backend\_addresses**

Address:port of the remote back-end servers (default: 127.0.0.1:3306).

(optional, string, default "127.0.0.1:3306")

**proxy\_read\_only\_backend\_addresses**

Address:port of the remote (read only) unpromoted-server (default: ).

(optional, string, no default)

**proxy\_address**

Listening address:port of the proxy server (default: :4040). You can also specify a socket like "/var/run/mysql-proxy.sock".

(optional, string, default ":4040")

**log\_level**

Log all messages of level (error\|warning\|info\|message\|debug\|) or higher. An empty value disables logging.

(optional, string, no default)

**keepalive**

Try to restart the proxy if it crashed (default: ). Valid values: true or false. An empty value equals "false".

(optional, string, no default)

**plugins**

Whitespace separated list of plugins to load (default: ). Note: The admin plugin will be auto-loaded in case you specify an admin\_\* parameter.

(optional, string, no default)

**admin\_address**

Listening address:port of the admin plugin (default: 127.0.0.1:4041). Note: The admin plugin will be auto-loaded in case you specify an admin\_\* parameter.

(optional, string, default "127.0.0.1:4041")

**admin\_username**

Username for the admin plugin (default: ). Required since MySQL Proxy 0.8.1, if the admin plugin is loaded. Note: The admin plugin will be auto-loaded in case you specify an admin\_\* parameter.

(optional, string, no default)

**admin\_password**

Password for the admin plugin (default: ). Required since MySQL Proxy 0.8.1, if the admin plugin is loaded. Note: The admin plugin will be auto-loaded in case you specify an admin\_\* parameter.

(optional, string, no default)

**admin\_lua\_script**

Script to execute by the admin plugin. Required since MySQL Proxy 0.8.1, if the admin plugin is loaded. Note: The admin plugin will be auto-loaded in case you specify an admin\_\* parameter.

(optional, string, no default)

**test\_table**

Table to be tested in monitor statement (in database.table notation)

(optional, string, default "mysql.user")

**test\_user**

MySQL test user

(optional, string, no default)

**test\_passwd**

MySQL test user password

(optional, string, no default)

**parameters**

The MySQL Proxy daemon may be called with additional parameters. Specify any of them here.

(optional, string, no default)

**pidfile**

PID file

(unique, optional, string, default "/run/resource-agents/mysql-proxy-RESOURCE\_ID.pid")

## SUPPORTED ACTIONS

This resource agent supports the following actions (operations):

**start**

Starts the resource. Suggested minimum timeout: 30s.

**stop**

Stops the resource. Suggested minimum timeout: 30s.

**reload**

Suggested minimum timeout: 30s.

**monitor**

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

**validate-all**

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

**meta-data**

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

## EXAMPLE CRM SHELL

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

```
primitive p_mysql-proxy ocf:heartbeat:mysql-proxy \
  op monitor depth="0" timeout="20s" interval="60s"
```

## EXAMPLE PCS

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

```
pcs resource create p_mysql-proxy ocf:heartbeat:mysql-proxy \
  op monitor OCF_CHECK_LEVEL="0" timeout="20s" interval="60s"
```

## SEE ALSO

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

## AUTHOR

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