OCF_HEARTBEAT_MARIAD(7) | OCF resource agents | OCF_HEARTBEAT_MARIAD(7) |
ocf_heartbeat_mariadb - Manages a MariaDB master/slave instance
mariadb [start | stop | status | monitor | promote | demote | meta-data | validate-all]
Resource script for MariaDB.
Manages a complete master/slave replication setup with GTID, for simpler uses look at the mysql resource agent which supports older replication forms which mysql and mariadb have in common.
The resource must be setup to use notifications. Set 'notify=true' in the metadata attributes when defining a MariaDB master/slave instance.
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 mariadb primitive you are using is p_mariadb, the attribute to set will be p_mariadb_mysql_master_IP.
binary
(optional, string, default "/usr/bin/mysqld_safe")
client_binary
(optional, string, default "mysql")
config
(optional, string, default "/etc/mysql/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/mysql/error.log")
node_list
(required, string, no default)
pid
(optional, string, default "/var/run/mysqld/mysqld.pid")
socket
(optional, string, default "/var/run/mysqld/mysqld.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")
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
The following is an example configuration for a mariadb resource using the crm(8) shell:
primitive p_mariadb ocf:heartbeat:mariadb \
params \
node_list=string \
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_mariadb p_mariadb \
meta notify="true" interleave="true"
The following is an example configuration for a mariadb resource using pcs(8)
pcs resource create p_mariadb ocf:heartbeat:mariadb \
node_list=string \
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
http://clusterlabs.org/
ClusterLabs contributors (see the resource agent source for information about individual authors)
06/27/2020 | resource-agents UNKNOWN |