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")
  • client_binary β€” location of the MariaDB client binary
    • (optional, string, default "mysql")
  • config β€” configuration file
    • (optional, string, default "/etc/my.cnf")
  • datadir β€” directory containing databases
    • (optional, string, default "/var/lib/mysql")
  • user β€” user running MariaDB daemon
    • (optional, string, default "mysql")
  • group β€” group running MariaDB daemon (for logfile and directory permissions)
    • (optional, string, default "mysql")
  • log β€” the logfile to be used for mysqld.
    • (optional, string, default "/var/log/mysqld.log")
  • 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 for mysqld.
    • (optional, string, default "/var/run/mysql/mysqld.pid")
  • socket β€” the socket to be used for mysqld.
    • (optional, string, default "/var/lib/mysql/mysql.sock")
  • test_table β€” table to be tested in monitor statement (in database.table notation)
    • (optional, string, default "mysql.user")
  • test_user β€” MariaDB test user, must have select privilege on test_table
    • (optional, string, default "root")
  • 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)
  • additional_parameters β€” additional parameters which are passed to the mysqld on startup (e.g. --skip-external-locking or --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 have SUPER, REPLICATION SLAVE, REPLICATION CLIENT, PROCESS and RELOAD privileges on all nodes within the cluster. mandatory if you define a promotable resource πŸ‘‘
    • (optional, string, default "root")
  • 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")
  • replication_require_ssl β€” enables SSL connection to local MySQL service for replication user. i.e. if REQUIRE SSL for replication user in MySQL set, this should be set to "true".
    • (optional, string, default "false")
  • 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 πŸ”₯


πŸ‘‘ 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