table of contents
OCF_HEARTBEAT_MYSQL(7) | OCF resource agents | OCF_HEARTBEAT_MYSQL(7) |
NAME¶
ocf_heartbeat_mysql - Manages a MySQL database instance
SYNOPSIS¶
mysql [start | stop | status | monitor | promote | demote | meta-data | validate-all]
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. Note, when master/slave replication is in use, the resource must be setup to use notifications. Set 'notify=true' in the metadata attributes when defining a MySQL master/slave instance.
While managing replication, the default behavior is to use uname -n values in the change master to command. Other IPs can be specified manually by adding a node attribute ${INSTANCE_ATTR_NAME}_mysql_master_IP giving the IP to use for replication. For example, if the mysql primitive you are using is p_mysql, the attribute to set will be p_mysql_mysql_master_IP.
SUPPORTED PARAMETERS¶
binary
(optional, string, default "/usr/bin/safe_mysqld")
client_binary
(optional, string, default "mysql")
config
(optional, string, default "/etc/my.cnf")
datadir
(optional, string, default "/var/lib/mysql")
user
(optional, string, default "mysql")
group
(optional, string, default "mysql")
log
(optional, string, default "/var/log/mysqld.log")
pid
(optional, string, default "/var/run/mysql/mysqld.pid")
socket
(optional, string, default "/var/lib/mysql/mysql.sock")
test_table
(optional, string, default "mysql.user")
test_user
(optional, string, default "root")
test_passwd
(optional, string, no default)
enable_creation
(optional, boolean, default 0)
additional_parameters
(optional, string, no default)
replication_user
(optional, string, default "root")
replication_passwd
(optional, string, no default)
replication_port
(optional, string, default "3306")
max_slave_lag
(optional, integer, default 3600)
evict_outdated_slaves
(optional, boolean, default false)
reader_attribute
A typical example for the use of this attribute would be to tie a set of IP addresses to MySQL slaves that can be read from.
This parameter is only meaningful in master/slave set configurations.
(unique, optional, string, default "readable")
SUPPORTED ACTIONS¶
This resource agent supports the following actions (operations):
start
stop
status
monitor
monitor (Master role)
monitor (Slave role)
promote
demote
notify
validate-all
meta-data
EXAMPLE CRM SHELL¶
The following is an example configuration for a mysql resource using the crm(8) shell:
primitive p_mysql ocf:heartbeat:mysql \
op monitor depth="0" timeout="30s" interval="20s" \
op monitor role="Master" depth="0" timeout="30s" interval="10s" \
op monitor role="Slave" depth="0" timeout="30s" interval="30s"
ms ms_mysql p_mysql \
meta notify="true" interleave="true"
EXAMPLE PCS¶
The following is an example configuration for a mysql resource using pcs(8)
pcs resource create p_mysql ocf:heartbeat:mysql \
op monitor depth="0" timeout="30s" interval="20s" \
op monitor role="Master" depth="0" timeout="30s" interval="10s" \
op monitor role="Slave" depth="0" timeout="30s" interval="30s" --master
SEE ALSO¶
AUTHOR¶
ClusterLabs contributors (see the resource agent source for information about individual authors)
03/19/2024 | resource-agents UNKNOWN |