OCF_HEARTBEAT_MARIAD(7)
π OCF_HEARTBEAT_MARIAD(7) β like, the full manual, bestie π
okay so this is from the OCF resource agents manual set, and it's literally all about ocf_heartbeat_mariadb. buckle up, she's a big one but she serves π
β¨ NAME β¨
ocf_heartbeat_mariadb β manages a MariaDB promotable instance π
π¦ SYNOPSIS π¦
mariadb [start | stop | status | monitor | promote | demote | meta-data
| validate-all]
πΈ DESCRIPTION πΈ
so this is a resource script for MariaDB. that's the whole vibe fr.
ngl, it manages a complete promotable replication setup with GTID β like the full main-character setup β¨. if you want something simpler, go look at the mysql resource agent instead, which supports the older replication forms that mysql and mariadb have in common. iykyk π
heads up though: the resource must be set up to use notifications. set notify=true in the metadata attributes when you're defining a MariaDB promotable instance. no cap, that's mandatory. π
the default behavior is to use uname -n values in the change promoted to command. but you can also specify other IPs manually β just add a node attribute ${INSTANCE_ATTR_NAME}_mysql_master_IP giving the IP to use for replication. for example, if the mariadb primitive you're using is p_mariadb, the attribute you set will be p_mariadb_mysql_master_IP. π«Ά
π SUPPORTED PARAMETERS π
binaryβ location of the MariaDB server binary- (optional, string, default
"/usr/bin/safe_mysqld")
- (optional, string, default
client_binaryβ location of the MariaDB client binary- (optional, string, default
"mysql")
- (optional, string, default
configβ configuration file- (optional, string, default
"/etc/my.cnf")
- (optional, string, default
datadirβ directory containing databases- (optional, string, default
"/var/lib/mysql")
- (optional, string, default
userβ user running MariaDB daemon- (optional, string, default
"mysql")
- (optional, string, default
groupβ group running MariaDB daemon (for logfile and directory permissions)- (optional, string, default
"mysql")
- (optional, string, default
logβ the logfile to be used formysqld.- (optional, string, default
"/var/log/mysqld.log")
- (optional, string, default
node_listβ all node names of nodes that will execute mariadb. please separate each node name with a space. this is required for the promoted selection to function!- (required, string, no default) π don't skip her
pidβ the pidfile to be used formysqld.- (optional, string, default
"/var/run/mysql/mysqld.pid")
- (optional, string, default
socketβ the socket to be used formysqld.- (optional, string, default
"/var/lib/mysql/mysql.sock")
- (optional, string, default
test_tableβ table to be tested in monitor statement (indatabase.tablenotation)- (optional, string, default
"mysql.user")
- (optional, string, default
test_userβ MariaDB test user, must have select privilege ontest_table- (optional, string, default
"root")
- (optional, string, default
test_passwdβ MariaDB test user password- (optional, string, no default)
enable_creationβ if the MariaDB database does not exist, it will be created- (optional, boolean, default
0)
- (optional, boolean, default
additional_parametersβ additional parameters which are passed to themysqldon startup (e.g.--skip-external-lockingor--skip-grant-tables)- (optional, string, no default)
replication_userβ MariaDB replication user. this user is used for starting and stopping MariaDB replication, for setting and resetting the promoted host, and for setting and unsetting read-only mode. because of that, this user must haveSUPER,REPLICATION SLAVE,REPLICATION CLIENT,PROCESSandRELOADprivileges on all nodes within the cluster. mandatory if you define a promotable resource π- (optional, string, default
"root")
- (optional, string, default
replication_passwdβ MariaDB replication password. used for replication client and unpromoted. mandatory if you define a promotable resource π₯- (optional, string, no default)
replication_portβ the port on which the Promoted MariaDB instance is listening- (optional, string, default
"3306")
- (optional, string, default
replication_require_sslβ enables SSL connection to local MySQL service for replication user. i.e. ifREQUIRE SSLfor replication user in MySQL set, this should be set to"true".- (optional, string, default
"false")
- (optional, string, default
replication_master_ssl_caβ the SSL CA certificate to be used for replication over SSL- (optional, string, no default)
replication_master_ssl_certβ the SSL CA certificate to be used for replication over SSL- (optional, string, no default)
replication_master_ssl_keyβ the SSL certificate key to be used for replication over SSL- (optional, string, no default)
β SUPPORTED ACTIONS β
this resource agent supports the following actions (operations) β here's the whole roster, bestie π«Ά
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.monitor (Unpromoted role)β performs a detailed status check. suggested minimum timeout:30s. suggested interval:30s.promoteβ promotes the resource to the Master role. suggested minimum timeout:120s.demoteβ demotes the resource to the Slave role. suggested minimum timeout:120s.notifyβ suggested minimum timeout:90s.validate-allβ performs a validation of the resource configuration. suggested minimum timeout:5s.meta-dataβ retrieves resource agent metadata (internal use only β don't touch, that's for the machinery π). suggested minimum timeout:5s.
π§ EXAMPLE CRM SHELL π§
here's an example configuration for a mariadb resource using the crm(8) shell β copy it, it's cute:
primitive p_mariadb ocf:heartbeat:mariadb \
params \
node_list=string \
op monitor depth="0" timeout="30s" interval="20s" \
op monitor role="Promoted" depth="0" timeout="30s" interval="10s" \
op monitor role="Unpromoted" depth="0" timeout="30s" interval="30s"
ms ms_mariadb p_mariadb \
meta notify="true" interleave="true"
π EXAMPLE PCS π
and here's the same idea but for a mariadb resource using pcs(8):
pcs resource create p_mariadb ocf:heartbeat:mariadb \
node_list=string \
op monitor OCF_CHECK_LEVEL="0" timeout="30s" interval="20s" \
op monitor role="Promoted" OCF_CHECK_LEVEL="0" timeout="30s" interval="10s" \
op monitor role="Unpromoted" OCF_CHECK_LEVEL="0" timeout="30s" interval="30s" promotable
π₯ SEE ALSO π₯
http://clusterlabs.org/β go look, she's iconic π
π AUTHOR π
ClusterLabs contributors (see the resource agent source for information about individual authors) π«Ά
that's the whole thing, bestie β you're so ready. βπ
resource-agents UNKNOWN Β· 10/01/2026 Β· OCF_HEARTBEAT_MARIAD(7) β mwah, go slay your cluster π
β¨π
π¦ where this page comes from
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms