OCF_HEARTBEAT_DB2(7)

πŸ’… OCF_HEARTBEAT_DB2(7) β€” the ocf_heartbeat_db2 page, but make it make sense

okay so this is a page from the OCF resource agents manual, section 7. And bestie, it's about databases. IBM DB2 LUW specifically. Let's get into it 🫢


✨ NAME ✨

ocf_heartbeat_db2 β€” a Resource Agent that manages an IBM DB2 LUW databases in Standard role as primitive or in HADR roles as promotable configuration. Multiple partitions are supported.

(no cap, that's the actual NAME section, I didn't touch a word πŸ’€)


🌸 SYNOPSIS 🌸

db2 [start | stop | monitor | promote | demote | meta-data |
    validate-all]

πŸ¦‹ DESCRIPTION πŸ¦‹

So: this Resource Agent manages IBM DB2 LUW databases. It can do it in Standard role as a primitive, or in HADR roles in a promotable configuration. And yes β€” multiple partitions are supported. Iconic.

⭐ Standard mode

An instance including all or selected databases is made highly available. Configure each partition as a separate primitive resource. Simple as that πŸ’…

⭐ HADR mode

A single database in HADR configuration is made highly available by automating takeover operations. Configure a promotable resource with notifications enabled, plus an additional monitoring operation with role "Promoted".

🚨 Listen up, this part matters: in case of HADR, be very deliberate in specifying intervals/timeouts. The detection of a failure including promote must complete within HADR_PEER_WINDOW. No vibes-based timeout guessing, bestie.

In addition to honoring requirements for crash recovery etc. for your specific database, use the following relations as guidance:

"monitor interval" < HADR_PEER_WINDOW - (appr 30 sec)
"promote timeout" < HADR_PEER_WINDOW + (appr 20 sec)

For further information and examples, consult http://www.linux-ha.org/wiki/db2_(resource_agent) β€” go read it, iykyk πŸ“š


πŸŽ€ SUPPORTED PARAMETERS πŸŽ€

  • instance β€” The instance of the database(s). (unique, required, string, no default) β€” yeah this one's mandatory, no skipping πŸ™ˆ
  • dblist β€” List of databases to be managed, e.g "db1 db2". Defaults to all databases in the instance. Specify one db for HADR mode. (optional, string, no default)
  • skip_basic_sql_health_check β€” Skip basic health check SQL query. Only set to "true" when the "monitor_retries" and "monitor_retry_all_errors" parameters arent enough to avoid issues under high load. (optional, boolean, default false)
  • monitor_retries β€” Monitor retries before failing. (optional, string, default "1")
  • monitor_retries_sleep β€” Monitor sleep between tries. (optional, string, default "1")
  • monitor_retry_all_errors β€” Set to true to retry monitor-action for all errors instead of the default "db2pd" race conditions. (optional, string, default "false")
  • admin β€” DEPRECATED: The admin user of the instance. (optional, string, no default) β€” yeah she's deprecated, don't come for me πŸ’€
  • dbpartitionnum β€” The number of the partition (DBPARTITIONNUM) to be managed. (optional, string, default "0")

πŸ”₯ SUPPORTED ACTIONS πŸ”₯

This resource agent supports the following actions (operations):

  • start β€” Starts the resource. Suggested minimum timeout: 120s. πŸ’–
  • stop β€” Stops the resource. Suggested minimum timeout: 120s.
  • promote β€” Promotes the resource to the Master role. Suggested minimum timeout: 120s. πŸ‘‘
  • demote β€” Demotes the resource to the Slave role. Suggested minimum timeout: 120s.
  • monitor β€” Performs a detailed status check. Suggested minimum timeout: 60s. Suggested interval: 20s. ⭐
  • monitor (Promoted role) β€” Performs a detailed status check. Suggested minimum timeout: 60s. Suggested interval: 22s.
  • validate-all β€” Performs a validation of the resource configuration. Suggested minimum timeout: 5s. 🧚
  • meta-data β€” Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5s.

🌈 EXAMPLE CRM SHELL 🌈

Here's what a db2 resource looks like when you configure it with the crm(8) shell. Literally copy-paste energy, but like, read it first:

primitive p_db2 ocf:heartbeat:db2 \
  params \
    instance=string \
  op monitor depth="0" timeout="60s" interval="20s" \
  op monitor depth="0" timeout="60s" role="Promoted" interval="22s"

ms ms_db2 p_db2 \
  meta notify="true" interleave="true"

she ate πŸ’…


πŸ“ EXAMPLE PCS πŸ“

And the same vibe but for pcs(8):

pcs resource create p_db2 ocf:heartbeat:db2 \
  instance=string \
  op monitor OCF_CHECK_LEVEL="0" timeout="60s" interval="20s" \
  op monitor OCF_CHECK_LEVEL="0" timeout="60s" role="Promoted" interval="22s" promotable

both of these are giving "i know what i'm doing" and honestly? correct ✨


πŸ’œ SEE ALSO πŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

ClusterLabs contributors (see the resource agent source for information about individual authors)


okay that's the whole page, bestie, you're so welcome πŸ’–

resource-agents UNKNOWN β€” dated 10/01/2026 🌸 that's the version and date, mwah, go configure your clusters responsibly πŸŽ€

πŸ“¦ where this page comes from