Configs2026年5月25日·1 分钟阅读

Pigsty — Enterprise-Grade PostgreSQL Distribution with Batteries Included

An open-source PostgreSQL distribution that bundles high availability, point-in-time recovery, monitoring, and 460+ extensions into a production-ready platform deployable with a single command.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Pigsty Overview
先审查命令
npx -y tokrepo@latest install 8044ac7e-5877-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run,确认写入项后再运行此命令。

Introduction

Pigsty is a batteries-included PostgreSQL distribution that packages HA clustering, PITR backup, monitoring dashboards, and hundreds of extensions into a cohesive platform. It turns bare metal or VMs into a production-grade database service with infrastructure-as-code provisioning.

What Pigsty Does

  • Deploys PostgreSQL clusters with automatic failover using Patroni and HAProxy
  • Provides point-in-time recovery via pgBackRest with configurable retention
  • Includes Grafana dashboards with hundreds of pre-built PostgreSQL monitoring panels
  • Bundles 460+ PostgreSQL extensions including PostGIS, TimescaleDB, and pgvector
  • Manages the full infrastructure stack: DNS, NTP, CA, package repo, and observability

Architecture Overview

Pigsty uses Ansible for declarative infrastructure provisioning. A single pigsty.yml configuration file defines the entire cluster topology. The deployment includes Patroni for HA consensus, etcd as the DCS, HAProxy for connection routing, pgBouncer for connection pooling, and Prometheus/Grafana for monitoring. All components are installed from local package repos for offline capability.

Self-Hosting & Configuration

  • Minimum requirement: 1 node with 2 CPU cores and 4GB RAM for single-node mode
  • Multi-node HA clusters need 3+ nodes for proper failover consensus
  • All configuration is declarative in pigsty.yml; re-run playbooks to apply changes
  • Supports EL (Rocky, Alma, CentOS) and Debian/Ubuntu Linux distributions
  • Offline installation supported via pre-downloaded package bundles

Key Features

  • One-command deployment from bare metal to full production stack
  • 460+ curated PostgreSQL extensions available from local repo mirrors
  • Pre-built Grafana dashboards covering cluster health, query performance, and replication lag
  • Built-in connection pooling via pgBouncer with configurable pool modes
  • Supports 12 PostgreSQL kernel forks including Citus, IvorySQL, and PolarDB

Comparison with Similar Tools

  • CloudNativePG — Kubernetes-native operator; Pigsty targets VM/bare-metal deployments with a broader infrastructure scope
  • Patroni (standalone) — HA only; Pigsty wraps Patroni with monitoring, backups, extensions, and provisioning automation
  • Percona Distribution — Commercial PostgreSQL bundle; Pigsty is fully open-source with more extensions and integrated monitoring
  • Supabase — Full backend platform built on PostgreSQL; Pigsty focuses on database infrastructure without application-layer opinions

FAQ

Q: Can I add Pigsty to an existing PostgreSQL cluster? A: Pigsty is designed to provision from scratch. Migrating existing clusters requires pg_dump/restore or logical replication into a Pigsty-managed instance.

Q: How does failover work? A: Patroni monitors primary health and promotes a standby replica if the primary becomes unavailable. HAProxy automatically routes connections to the new primary.

Q: Can I use Pigsty in air-gapped environments? A: Yes, Pigsty supports offline installation via pre-built package bundles that include all dependencies.

Q: What PostgreSQL versions are supported? A: Pigsty supports PostgreSQL 13 through 17, with the latest version recommended for new deployments.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产