# Module: ETCD

> Pigsty deploys etcd as DCS for reliable distributed config storage, supporting PostgreSQL HA.

---

LLMS index: [llms.txt](/llms.txt)

---

ETCD is a distributed, reliable key-value store for critical system config data.

Pigsty uses [**etcd**](https://etcd.io/) as [**DCS**](https://patroni.readthedocs.io/en/latest/dcs_failsafe_mode.html) (Distributed Config Store), critical for PostgreSQL HA and automatic failover.

The [`ETCD`](/docs/etcd) module depends on [`NODE`](/docs/node) module and is required by [`PGSQL`](/docs/pgsql) module. Install [`NODE`](/docs/node) module to manage nodes before installing [`ETCD`](/docs/etcd).

Deploy [`ETCD`](/docs/etcd) cluster before any [`PGSQL`](/docs/pgsql) cluster—`patroni` and `vip-manager` for PG HA rely on etcd for HA and L2 VIP binding to primary.

```mermaid
flowchart LR
    subgraph PGSQL [PGSQL]
        patroni[Patroni]
        vip[VIP Manager]
    end

    subgraph ETCD [ETCD]
        etcd[DCS Service]
    end

    subgraph NODE [NODE]
        node[Software Repo]
    end

    PGSQL -->|depends| ETCD -->|depends| NODE

    style PGSQL fill:#3E668F,stroke:#2d4a66,color:#fff
    style ETCD fill:#5B9CD5,stroke:#4178a8,color:#fff
    style NODE fill:#FCDB72,stroke:#d4b85e,color:#333

    style patroni fill:#2d4a66,stroke:#1e3347,color:#fff
    style vip fill:#2d4a66,stroke:#1e3347,color:#fff
    style etcd fill:#4178a8,stroke:#2d5a7a,color:#fff
    style node fill:#d4b85e,stroke:#b89a4a,color:#333
```

One etcd cluster per Pigsty deployment serves multiple PG clusters.

Pigsty enables RBAC by default. Each PG cluster uses independent credentials for multi-tenant isolation. Admins use etcd root user with full permissions over all PG clusters.

---

Section pages:

- [Configuration](/docs/etcd/config/): Choose etcd cluster size based on requirements, provide reliable access.
- [Parameters](/docs/etcd/param/): ETCD module provides 13 configuration parameters for fine-grained control over cluster behavior.
- [Administration](/docs/etcd/admin/): etcd cluster management SOP: create, destroy, scale, config, and RBAC.
- [Playbook](/docs/etcd/playbook/): Manage etcd clusters with Ansible playbooks and quick command reference.
- [Monitoring](/docs/etcd/monitor/): etcd monitoring dashboards, metrics, and alert rules.
- [Metrics](/docs/etcd/metric/): Complete monitoring metrics list provided by Pigsty ETCD module
- [FAQ](/docs/etcd/faq/): Frequently asked questions about Pigsty etcd module
