Name

ocf:mysql — Manages a MySQL database instance

Synopsis

[OCF_RESKEY_binary=string] [OCF_RESKEY_client_binary=string] [OCF_RESKEY_config=string] [OCF_RESKEY_datadir=string] [OCF_RESKEY_user=string] [OCF_RESKEY_group=string] [OCF_RESKEY_log=string] [OCF_RESKEY_pid=string] [OCF_RESKEY_socket=string] [OCF_RESKEY_test_table=string] [OCF_RESKEY_test_user=string] [OCF_RESKEY_test_passwd=string] [OCF_RESKEY_enable_creation=integer] [OCF_RESKEY_additional_parameters=string] [OCF_RESKEY_replication_user=string] [OCF_RESKEY_replication_passwd=string] [OCF_RESKEY_replication_port=string] [OCF_RESKEY_max_slave_lag=integer] [OCF_RESKEY_evict_outdated_slaves=boolean] mysql [start | stop | status | monitor | monitor | monitor | promote | demote | notify | validate-all | meta-data]

Description

Resource script for MySQL. May manage a standalone MySQL database, a clone set with externally managed replication, or a complete master/slave replication setup.

Supported Parameters

OCF_RESKEY_binary=MySQL server binary

Location of the MySQL server binary

OCF_RESKEY_client_binary=MySQL client binary

Location of the MySQL client binary

OCF_RESKEY_config=MySQL config

Configuration file

OCF_RESKEY_datadir=MySQL datadir

Directory containing databases

OCF_RESKEY_user=MySQL user

User running MySQL daemon

OCF_RESKEY_group=MySQL group

Group running MySQL daemon (for logfile and directory permissions)

OCF_RESKEY_log=MySQL log file

The logfile to be used for mysqld.

OCF_RESKEY_pid=MySQL pid file

The pidfile to be used for mysqld.

OCF_RESKEY_socket=MySQL socket

The socket to be used for mysqld.

OCF_RESKEY_test_table=MySQL test table

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

OCF_RESKEY_test_user=MySQL test user

MySQL test user

OCF_RESKEY_test_passwd=MySQL test user password

MySQL test user password

OCF_RESKEY_enable_creation=Create the database if it does not exist

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

OCF_RESKEY_additional_parameters=Additional parameters to pass to mysqld

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

OCF_RESKEY_replication_user=MySQL replication user

MySQL replication user. This user is used for starting and stopping MySQL replication, for setting and resetting the master host, and for setting and unsetting read-only mode. Because of that, this user must have SUPER, REPLICATION SLAVE, REPLICATION CLIENT, and PROCESS privileges on all nodes within the cluster.

OCF_RESKEY_replication_passwd=MySQL replication user password

MySQL replication password. Used for replication client and slave.

OCF_RESKEY_replication_port=MySQL replication port

The port on which the Master MySQL instance is listening.

OCF_RESKEY_max_slave_lag=Maximum time (seconds) a MySQL slave is allowed to lag behind a master

The maximum number of seconds a replication slave is allowed to lag behind its master. Do not set this to zero. What the cluster manager does in case a slave exceeds this maximum lag is determined by the evict_outdated_slaves parameter.

OCF_RESKEY_evict_outdated_slaves=Determines whether to shut down badly lagging slaves

If set to true, any slave which is more than max_slave_lag seconds behind the master has its MySQL instance shut down. If this parameter is set to false in a primitive or clone resource, it is simply ignored. If set to false in a master/slave resource, then exceeding the maximum slave lag will merely push down the master preference so the lagging slave is never promoted to the new master.