# clusterlabs/pacemaker architecture

> Architecture diagram of the GitHub repository clusterlabs/pacemaker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/clusterlabs/pacemaker
- Repository: https://github.com/clusterlabs/pacemaker

## Overview

Pacemaker is a high-availability cluster resource manager. Administrators configure resources and constraints; Pacemaker coordinates cluster membership and configuration, computes a desired resource plan, executes and monitors actions, and recovers from failures, including fencing nodes when needed. The graph preserves the major daemon and library responsibilities visible in the tree. Many implementation excerpts were not provided, so most detailed runtime links are marked dashed and unverified rather than presented as inspected call paths.

Main entry points: [`daemons/based`](https://github.com/clusterlabs/pacemaker/tree/main/daemons/based) (Configuration Service), [`daemons/controld`](https://github.com/clusterlabs/pacemaker/tree/main/daemons/controld) (Cluster Controller), [`lib/pacemaker/pcmk_scheduler.c`](https://github.com/clusterlabs/pacemaker/blob/main/lib/pacemaker/pcmk_scheduler.c) (Action Scheduler), [`daemons/controld/controld_transition.c`](https://github.com/clusterlabs/pacemaker/blob/main/daemons/controld/controld_transition.c) (Transition Engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Administration"]
  node_cli["Cluster Tools"]
  node_monitor["Cluster Monitor<br/>[crm_mon.c]"]
end

subgraph group_coordination["Cluster Coordination"]
  node_based["Configuration Service"]
  node_controld["Cluster Controller"]
  node_cluster["Membership and Messaging"]
  node_attrd["Attribute Service"]
end

subgraph group_planning["Planning and State"]
  node_cib[("Cluster Configuration")]
  node_cib_api["CIB Client API<br/>[cib_client.c]"]
  node_scheduler["Action Scheduler<br/>[pcmk_scheduler.c]"]
  node_status_unpack["Status Unpacking<br/>[unpack.c]"]
  node_transition["Transition Engine"]
end

subgraph group_execution["Execution and Recovery"]
  node_execd["Resource Executor<br/>[execd_commands.c]"]
  node_services["Agent Execution<br/>[services.c]"]
  node_service_backend["Platform Backends<br/>[services_linux.c]"]
  node_fenced["Fencing Service<br/>[fenced_commands.c]"]
  node_fencing_client["Fencing Client API<br/>[st_client.c]"]
  node_alerts["Alerting<br/>[execd_alerts.c]"]
end

node_administrator(("Administrator"))

node_administrator -.->|"configures"| node_cli
node_cli -.->|"submits requests"| node_cib_api
node_cib_api -.->|"connects to"| node_based
node_based -.->|"reads and updates"| node_cib
node_controld -.->|"tracks membership"| node_cluster
node_controld -.->|"uses configuration"| node_based
node_controld -.->|"shares attributes"| node_attrd
node_based -.->|"requests planning"| node_scheduler
node_scheduler -.->|"interprets status"| node_status_unpack
node_scheduler -.->|"provides actions"| node_transition
node_transition -.->|"dispatches actions"| node_execd
node_execd -.->|"runs agents"| node_services
node_services -.->|"selects backend"| node_service_backend
node_transition -.->|"requests fencing"| node_fencing_client
node_fencing_client -.->|"sends commands"| node_fenced
node_execd -.->|"handles alerts"| node_alerts
node_monitor -.->|"queries cluster"| node_cib_api
node_monitor -.->|"reports status"| node_administrator

click node_cli "https://github.com/clusterlabs/pacemaker/tree/main/tools"
click node_monitor "https://github.com/clusterlabs/pacemaker/blob/main/tools/crm_mon.c"
click node_cib "https://github.com/clusterlabs/pacemaker/tree/main/daemons/based"
click node_cib_api "https://github.com/clusterlabs/pacemaker/blob/main/lib/cib/cib_client.c"
click node_based "https://github.com/clusterlabs/pacemaker/tree/main/daemons/based"
click node_controld "https://github.com/clusterlabs/pacemaker/tree/main/daemons/controld"
click node_cluster "https://github.com/clusterlabs/pacemaker/tree/main/lib/cluster"
click node_attrd "https://github.com/clusterlabs/pacemaker/tree/main/daemons/attrd"
click node_scheduler "https://github.com/clusterlabs/pacemaker/blob/main/lib/pacemaker/pcmk_scheduler.c"
click node_status_unpack "https://github.com/clusterlabs/pacemaker/blob/main/lib/pengine/unpack.c"
click node_transition "https://github.com/clusterlabs/pacemaker/blob/main/daemons/controld/controld_transition.c"
click node_execd "https://github.com/clusterlabs/pacemaker/blob/main/daemons/execd/execd_commands.c"
click node_services "https://github.com/clusterlabs/pacemaker/blob/main/lib/services/services.c"
click node_service_backend "https://github.com/clusterlabs/pacemaker/blob/main/lib/services/services_linux.c"
click node_fenced "https://github.com/clusterlabs/pacemaker/blob/main/daemons/fenced/fenced_commands.c"
click node_fencing_client "https://github.com/clusterlabs/pacemaker/blob/main/lib/fencing/st_client.c"
click node_alerts "https://github.com/clusterlabs/pacemaker/blob/main/daemons/execd/execd_alerts.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_monitor toneBlue
class node_based,node_controld,node_cluster,node_attrd toneAmber
class node_cib,node_cib_api,node_scheduler,node_status_unpack,node_transition toneMint
class node_execd,node_services,node_service_backend,node_fenced,node_fencing_client,node_alerts toneRose
class node_administrator toneIndigo
```

## Components

### Administration

- [Cluster Tools](https://github.com/clusterlabs/pacemaker/tree/main/tools): `tools`
- [Cluster Monitor](https://github.com/clusterlabs/pacemaker/blob/main/tools/crm_mon.c): `tools/crm_mon.c`

### Cluster Coordination

- [Configuration Service](https://github.com/clusterlabs/pacemaker/tree/main/daemons/based): `daemons/based`
- [Cluster Controller](https://github.com/clusterlabs/pacemaker/tree/main/daemons/controld): `daemons/controld`
- [Membership and Messaging](https://github.com/clusterlabs/pacemaker/tree/main/lib/cluster): `lib/cluster`
- [Attribute Service](https://github.com/clusterlabs/pacemaker/tree/main/daemons/attrd): `daemons/attrd`

### Planning and State

- [Cluster Configuration](https://github.com/clusterlabs/pacemaker/tree/main/daemons/based): `daemons/based`
- [CIB Client API](https://github.com/clusterlabs/pacemaker/blob/main/lib/cib/cib_client.c): `lib/cib/cib_client.c`
- [Action Scheduler](https://github.com/clusterlabs/pacemaker/blob/main/lib/pacemaker/pcmk_scheduler.c): `lib/pacemaker/pcmk_scheduler.c`
- [Status Unpacking](https://github.com/clusterlabs/pacemaker/blob/main/lib/pengine/unpack.c): `lib/pengine/unpack.c`
- [Transition Engine](https://github.com/clusterlabs/pacemaker/blob/main/daemons/controld/controld_transition.c): `daemons/controld/controld_transition.c`

### Execution and Recovery

- [Resource Executor](https://github.com/clusterlabs/pacemaker/blob/main/daemons/execd/execd_commands.c): `daemons/execd/execd_commands.c`
- [Agent Execution](https://github.com/clusterlabs/pacemaker/blob/main/lib/services/services.c): `lib/services/services.c`
- [Platform Backends](https://github.com/clusterlabs/pacemaker/blob/main/lib/services/services_linux.c): `lib/services/services_linux.c`
- [Fencing Service](https://github.com/clusterlabs/pacemaker/blob/main/daemons/fenced/fenced_commands.c): `daemons/fenced/fenced_commands.c`
- [Fencing Client API](https://github.com/clusterlabs/pacemaker/blob/main/lib/fencing/st_client.c): `lib/fencing/st_client.c`
- [Alerting](https://github.com/clusterlabs/pacemaker/blob/main/daemons/execd/execd_alerts.c): `daemons/execd/execd_alerts.c`

### Other components

- **Administrator**

## Connections

- Administrator → Cluster Tools: configures
- Cluster Tools → CIB Client API: submits requests
- CIB Client API → Configuration Service: connects to
- Configuration Service → Cluster Configuration: reads and updates
- Cluster Controller → Membership and Messaging: tracks membership
- Cluster Controller → Configuration Service: uses configuration
- Cluster Controller → Attribute Service: shares attributes
- Configuration Service → Action Scheduler: requests planning
- Action Scheduler → Status Unpacking: interprets status
- Action Scheduler → Transition Engine: provides actions
- Transition Engine → Resource Executor: dispatches actions
- Resource Executor → Agent Execution: runs agents
- Agent Execution → Platform Backends: selects backend
- Transition Engine → Fencing Client API: requests fencing
- Fencing Client API → Fencing Service: sends commands
- Resource Executor → Alerting: handles alerts
- Cluster Monitor → CIB Client API: queries cluster
- Cluster Monitor → Administrator: reports status
