This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

References

Detailed reference information and lists, including supported OS distros, available modules, monitor metrics, extensions, cost comparison and analysis, glossary

1 - Supported Linux

Pigsty compatible Linux OS distribution major versions and CPU architectures

Pigsty runs on Linux, supporting amd64/x86_64 and arm64/aarch64 arch, plus 3 major distros: EL, Debian, Ubuntu.

Pigsty runs bare-metal without containers. Supports latest 2 major releases for each of the 3 major distros across both archs.

Overview

Recommended OS versions: RockyLinux 10.0, Ubuntu 24.04, Debian 13.1.

DistroArchOS CodePG18PG17PG16PG15PG14PG13
RHEL / Rocky / Alma 10x86_64el10.x86_64
RHEL / Rocky / Alma 10aarch64el10.aarch64
Ubuntu 24.04 (noble)x86_64u24.x86_64
Ubuntu 24.04 (noble)aarch64u24.aarch64
Debian 13 (trixie)x86_64d13.x86_64
Debian 13 (trixie)aarch64d13.aarch64

EL

Pigsty supports RHEL / Rocky / Alma / Anolis / CentOS 8, 9, 10.

EL DistroArchOS CodePG18PG17PG16PG15PG14PG13
RHEL10 / Rocky10 / Alma10x86_64el10.x86_64
RHEL10 / Rocky10 / Alma10aarch64el10.aarch64
RHEL9 / Rocky9 / Alma9x86_64el9.x86_64
RHEL9 / Rocky9 / Alma9aarch64el9.aarch64
RHEL8 / Rocky8 / Alma8x86_64el8.x86_64
RHEL8 / Rocky8 / Alma8aarch64el8.aarch64
RHEL7 / CentOS7x86_64el7.x86_64
RHEL7 / CentOS7aarch64-

Ubuntu

Pigsty supports Ubuntu 24.04 / 22.04:

Ubuntu DistroArchOS CodePG18PG17PG16PG15PG14PG13
Ubuntu 24.04 (noble)x86_64u24.x86_64
Ubuntu 24.04 (noble)aarch64u24.aarch64
Ubuntu 22.04 (jammy)x86_64u22.x86_64
Ubuntu 22.04 (jammy)aarch64u22.aarch64
Ubuntu 20.04 (focal)x86_64u20.x86_64
Ubuntu 20.04 (focal)aarch64-

Debian

Pigsty supports Debian 12 / 13, latest Debian 13.1 recommended:

Debian DistroArchOS CodePG18PG17PG16PG15PG14PG13
Debian 13 (trixie)x86_64d13.x86_64
Debian 13 (trixie)aarch64d13.aarch64
Debian 12 (bookworm)x86_64d12.x86_64
Debian 12 (bookworm)aarch64d12.aarch64
Debian 11 (bullseye)x86_64d11.x86_64
Debian 11 (bullseye)aarch64-

Vagrant

For local VM deployment, use these Vagrant base images (same as used in Pigsty dev):


Terraform

For cloud deployment, use these Terraform base images (Aliyun example):

  • Rocky 8.10 : rockylinux_8_10_x64_20G_alibase_20240923.vhd
  • Rocky 9.6 : rockylinux_9_6_x64_20G_alibase_20250101.vhd
  • Ubuntu 22.04 : ubuntu_22_04_x64_20G_alibase_20240926.vhd
  • Ubuntu 24.04 : ubuntu_24_04_x64_20G_alibase_20240923.vhd
  • Debian 12.11 : debian_12_11_x64_20G_alibase_20241201.vhd
  • Debian 13 : debian_13_x64_20G_alibase_20250101.vhd

2 - Pigsty Modules

This article lists all available modules in Pigsty and the module roadmap.

Core Modules

Pigsty provides four core modules that are essential for delivering fully-featured, highly available PostgreSQL services:

  • PGSQL: Self-healing PostgreSQL clusters with HA, PITR, IaC, SOP, monitoring, and 440 extensions out of the box.
  • INFRA: Local software repo, VictoriaMetrics, Grafana, VictoriaLogs, AlertManager, PushGateway, Blackbox Exporter…
  • NODE: Tune nodes to desired state: hostname, timezone, NTP, ssh, sudo, haproxy, docker, vector, keepalived.
  • ETCD: Distributed key-value store serving as DCS for HA PostgreSQL clusters: consensus, config management, service discovery.

Kernel Modules

Pigsty provides four kernel modules as optional in-place replacements for the vanilla PostgreSQL kernel, offering different database flavors:

  • MSSQL: Microsoft SQL Server wire-protocol compatible PG kernel, powered by AWS, WiltonDB & Babelfish!
  • IVORY: Oracle-compatible PostgreSQL 16 kernel, from the IvorySQL open-source project by HighGo.
  • POLAR: “Cloud-native” PostgreSQL kernel open-sourced by Alibaba Cloud, an Aurora-style RAC PostgreSQL fork.
  • CITUS: Distributed PostgreSQL cluster via extension (Azure Hyperscale), with native Patroni HA support!

Extension Modules

Pigsty provides four extension modules that are not essential for core functionality but can enhance PostgreSQL capabilities:

  • MINIO: S3-compatible simple object storage server, serving as optional backup repository for PostgreSQL, with production deployment and monitoring support.
  • REDIS: Redis server, high-performance data structure server, supporting standalone, sentinel, and cluster deployment modes with comprehensive monitoring.
  • MONGO: Native FerretDB deployment support — adding MongoDB wire-protocol level API compatibility to PostgreSQL!
  • DOCKER: Docker daemon service, enabling one-click deployment of containerized stateless software templates to extend Pigsty’s capabilities!

Peripheral Modules

Pigsty also supports peripheral modules that are closely related to the PostgreSQL kernel (extensions, forks, derivatives, wrappers):

  • DUCKDB: Powerful embedded OLAP database. Pigsty provides binaries, dynamic libraries, and related PG extensions: pg_duckdb, pg_lakehouse, and duckdb_fdw.
  • SUPABASE: Pigsty allows running the popular Firebase open-source alternative — Supabase — on existing HA PostgreSQL clusters!
  • GREENPLUM: MPP data warehouse based on PostgreSQL 12 kernel, currently with monitoring and RPM installation support only. (Beta)
  • CLOUDBERRY: Open-source fork by original Greenplum developers after it went closed-source, based on PG 14 kernel, currently RPM installation support only. (Beta)
  • NEON: Serverless PostgreSQL kernel with database branching capabilities. (WIP)

Pilot Modules

Pigsty is adding support for some pilot modules related to the PostgreSQL ecosystem. These may become official Pigsty modules in the future:

  • KAFKA: Deploy KRaft-powered Kafka message queues with Pigsty, with out-of-the-box monitoring support. (Beta)
  • MYSQL: Deploy highly available MySQL 8.0 clusters with Pigsty, with out-of-the-box monitoring support (for critique/migration evaluation). (Beta)
  • KUBE: Production-grade Kubernetes deployment and monitoring using SealOS. (Alpha)
  • VICTORIA: Alternative Infra implementation based on VictoriaMetrics and VictoriaLogs, offering better performance and resource utilization. (Alpha)
  • JUPYTER: Out-of-the-box Jupyter Notebook environment for data analysis and machine learning scenarios. (Alpha)

Monitoring Other Databases

Pigsty’s INFRA module can be used standalone as an out-of-the-box monitoring infrastructure to monitor other nodes or existing PostgreSQL databases:

  • Existing PostgreSQL Services: Pigsty can monitor external PostgreSQL services not managed by Pigsty, still providing relatively complete monitoring support.
  • RDS PG: PostgreSQL RDS services provided by cloud vendors can be monitored as standard external Postgres instances.
  • PolarDB: Alibaba Cloud’s cloud-native database can be monitored as external PostgreSQL 11 / 14 instances.
  • KingBase: A Chinese domestic database provided by KINGBASE, monitored as external PostgreSQL 12 instances.
  • Greenplum / YMatrixDB monitoring: Currently monitored as horizontally sharded PostgreSQL clusters.

3 - Extensions

This article lists PostgreSQL extensions supported by Pigsty and their compatibility across different systems.

Pigsty has 440 extensions. See PGEXT.CLOUD for details, maintained by PIGSTY.

CategoryAllPGDGPIGSTYCONTRIBMISSPG18PG17PG16PG15PG14PG13
ALL440149268710408429428430415386
EL434143268716397421422424412382
Debian4261052507114394416414416404371

pigsty-ecosystem.jpg

4 - File Hierarchy

How Pigsty’s file system structure is designed and organized, and directory structures used by each module.

Pigsty FHS

Pigsty’s home directory is located at ~/pigsty by default. The file structure within this directory is as follows:

#------------------------------------------------------------------------------
# pigsty
#  ^-----@app                    # Extra application resources and examples
#  ^-----@bin                    # Utility scripts
#  ^-----@docs                   # Documentation (docsify-compatible)
#  ^-----@files                  # Ansible file resources
#            ^-----@victoria     # VictoriaMetrics rule definitions
#            ^-----@grafana      # Grafana dashboards
#            ^-----@postgres     # /pg/bin/ scripts
#            ^-----@migration    # PGSQL migration task definitions
#            ^-----@pki          # Self-signed CA and certificates
#  ^-----@roles                  # Ansible role implementations
#  ^-----@templates              # Ansible template files
#  ^-----@vagrant                # Vagrant sandbox VM templates
#  ^-----@terraform              # Terraform cloud VM provisioning templates
#  ^-----configure               # Configuration wizard script
#  ^-----ansible.cfg             # Ansible default configuration
#  ^-----pigsty.yml              # Pigsty default configuration file
#  ^-----*.yml                   # Ansible playbooks
#------------------------------------------------------------------------------
# /etc/pigsty/
#  ^-----@targets                # File-based service discovery targets
#  ^-----@dashboards             # Grafana monitoring dashboards
#  ^-----@datasources            # Grafana data sources
#  ^-----@playbooks              # Ansible playbooks
#------------------------------------------------------------------------------

CA FHS

Pigsty’s self-signed CA is located in files/pki/ under the Pigsty home directory.

You must keep the CA key file secure: files/pki/ca/ca.key. This key is generated by the ca role during deploy.yml or infra.yml execution.

# pigsty/files/pki
#  ^-----@ca                      # Self-signed CA key and certificate
#         ^[email protected]           # CRITICAL: Keep this secret
#         ^[email protected]           # CRITICAL: Trusted everywhere
#  ^-----@csr                     # Certificate signing requests
#  ^-----@misc                    # Miscellaneous certificates, issued certs
#  ^-----@etcd                    # ETCD server certificates
#  ^-----@minio                   # MinIO server certificates
#  ^-----@nginx                   # Nginx SSL certificates
#  ^-----@infra                   # Infra client certificates
#  ^-----@pgsql                   # PostgreSQL server certificates
#  ^-----@mongo                   # MongoDB/FerretDB server certificates
#  ^-----@mysql                   # MySQL server certificates (placeholder)

Nodes managed by Pigsty will have the following certificate files installed:

/etc/pki/ca.crt                             # Root certificate added to all nodes
/etc/pki/ca-trust/source/anchors/ca.crt     # Symlink to system trust anchors

All infra nodes will have the following certificates:

/etc/pki/infra.crt                          # Infra node certificate
/etc/pki/infra.key                          # Infra node private key

When your admin node fails, the files/pki directory and pigsty.yml file should be available on the backup admin node. You can use rsync to achieve this:

# run on meta-1, rsync to meta2
cd ~/pigsty;
rsync -avz ./ meta-2:~/pigsty

NODE FHS

The node data directory is specified by the node_data parameter, defaulting to /data, owned by root with permissions 0777.

Each component’s default data directory is located under this data directory:

/data
#  ^-----@postgres                   # PostgreSQL database directory
#  ^-----@backups                    # PostgreSQL backup directory (when no dedicated backup disk)
#  ^-----@redis                      # Redis data directory (shared by multiple instances)
#  ^-----@minio                      # MinIO data directory (single-node single-disk mode)
#  ^-----@etcd                       # ETCD main data directory
#  ^-----@infra                      # Infra module data directory
#  ^-----@docker                     # Docker data directory
#  ^-----@...                        # Other component data directories

Prometheus FHS

Prometheus main configuration file is located at roles/infra/templates/prometheus/prometheus.yml.j2 and is rendered to /etc/prometheus/prometheus.yml on all infrastructure nodes.

VictoriaMetrics-related scripts and rule definitions are placed in the files/victoria/ directory under the Pigsty home directory, and are copied to /etc/prometheus/ on all infrastructure nodes.

# /etc/prometheus/
#  ^-----prometheus.yml              # Prometheus main configuration file
#  ^-----@bin                        # Utility scripts: check config, show status, reload, rebuild
#  ^-----@rules                      # Recording and alerting rule definitions
#            ^-----infra.yml         # Infra rules and alerts
#            ^-----etcd.yml          # ETCD rules and alerts
#            ^-----node.yml          # Node rules and alerts
#            ^-----pgsql.yml         # PGSQL rules and alerts
#            ^-----redis.yml         # Redis rules and alerts
#            ^-----minio.yml         # MinIO rules and alerts
#            ^-----kafka.yml         # Kafka rules and alerts
#            ^-----mysql.yml         # MySQL rules and alerts
#  ^-----@targets                    # File-based service discovery target definitions
#            ^-----@infra            # Infra static target definitions
#            ^-----@node             # Node static target definitions
#            ^-----@pgsql            # PGSQL static target definitions
#            ^-----@pgrds            # PGSQL remote RDS targets
#            ^-----@redis            # Redis static target definitions
#            ^-----@minio            # MinIO static target definitions
#            ^-----@mongo            # MongoDB static target definitions
#            ^-----@mysql            # MySQL static target definitions
#            ^-----@etcd             # ETCD static target definitions
#            ^-----@ping             # Ping static target definitions
#            ^-----@patroni          # Patroni static targets (used when Patroni SSL is enabled)
#            ^-----@.....            # Other monitoring target definitions
# /etc/alertmanager.yml              # Alertmanager main configuration file
# /etc/blackbox.yml                  # Blackbox exporter main configuration file

PostgreSQL FHS

The following parameters are related to PostgreSQL database directory structure:

  • pg_dbsu_home: Postgres default user home directory, defaults to /var/lib/pgsql
  • pg_bin_dir: Postgres binary directory, defaults to /usr/pgsql/bin/
  • pg_data: Postgres database directory, defaults to /pg/data
  • pg_fs_main: Postgres main data disk mount point, defaults to /data
  • pg_fs_backup: Postgres backup disk mount point, defaults to /data/backups (optional, can also backup to a subdirectory on the main data disk)
# Working assumptions:
#   {{ pg_fs_main }} main data directory, default location: `/data`          [fast SSD]
#   {{ pg_fs_backup }} backup data disk, default location: `/data/backups`     [cheap HDD]
#--------------------------------------------------------------#
# Default configuration:
#     pg_fs_main = /data             High-speed SSD
#     pg_fs_backup = /data/backups     Cheap HDD (optional)
#
#     /pg      -> /data/postgres/pg-test-15    (symlink)
#     /pg/data -> /data/postgres/pg-test-15/data
#--------------------------------------------------------------#
- name: create postgresql directories
  tags: pg_dir
  become: yes
  block:

    - name: make main and backup data dir
      file: path={{ item }} state=directory owner=root mode=0777
      with_items:
        - "{{ pg_fs_main }}"
        - "{{ pg_fs_backup }}"

    # pg_cluster_dir:    "{{ pg_fs_main }}/postgres/{{ pg_cluster }}-{{ pg_version }}"
    - name: create postgres directories
      file: path={{ item }} state=directory owner={{ pg_dbsu }} group=postgres mode=0700
      with_items:
        - "{{ pg_fs_main }}/postgres"
        - "{{ pg_cluster_dir }}"
        - "{{ pg_cluster_dir }}/bin"
        - "{{ pg_cluster_dir }}/log"
        - "{{ pg_cluster_dir }}/tmp"
        - "{{ pg_cluster_dir }}/cert"
        - "{{ pg_cluster_dir }}/conf"
        - "{{ pg_cluster_dir }}/data"
        - "{{ pg_cluster_dir }}/meta"
        - "{{ pg_cluster_dir }}/stat"
        - "{{ pg_cluster_dir }}/change"
        - "{{ pg_backup_dir }}/backup"

Data File Structure

# Physical directories
{{ pg_fs_main }}     /data                      # Top-level data directory, typically fast SSD mount point
{{ pg_dir_main }}    /data/postgres             # Contains all Postgres instance data (may have multiple instances/versions)
{{ pg_cluster_dir }} /data/postgres/pg-test-15  # Contains `pg-test` cluster data (major version 15)
                     /data/postgres/pg-test-15/bin            # PostgreSQL utility scripts
                     /data/postgres/pg-test-15/log            # Logs: postgres/pgbouncer/patroni/pgbackrest
                     /data/postgres/pg-test-15/tmp            # Temporary files, e.g., rendered SQL files
                     /data/postgres/pg-test-15/cert           # PostgreSQL server certificates
                     /data/postgres/pg-test-15/conf           # PostgreSQL configuration file index
                     /data/postgres/pg-test-15/data           # PostgreSQL main data directory
                     /data/postgres/pg-test-15/meta           # PostgreSQL identity information
                     /data/postgres/pg-test-15/stat           # Statistics, log reports, summary digests
                     /data/postgres/pg-test-15/change         # Change records

{{ pg_fs_backup }}     /data/backups                            # Optional backup disk directory/mount point
                     /data/backups/postgres/pg-test-15/backup # Actual storage location for cluster backups

# Symlinks
/pg             ->   /data/postgres/pg-test-15                # pg root symlink
/pg/data        ->   /data/postgres/pg-test-15/data           # pg data directory
/pg/backup      ->   /var/backups/postgres/pg-test-15/backup  # pg backup directory

Binary File Structure

On EL-compatible distributions (using yum), PostgreSQL default installation location is:

/usr/pgsql-${pg_version}/

Pigsty creates a symlink named /usr/pgsql pointing to the actual version specified by the pg_version parameter, for example:

/usr/pgsql -> /usr/pgsql-15

Therefore, the default pg_bin_dir is /usr/pgsql/bin/, and this path is added to the system PATH environment variable, defined in: /etc/profile.d/pgsql.sh.

export PATH="/usr/pgsql/bin:/pg/bin:$PATH"
export PGHOME=/usr/pgsql
export PGDATA=/pg/data

On Ubuntu/Debian, the default PostgreSQL Deb package installation location is:

/usr/lib/postgresql/${pg_version}/bin

Pgbouncer FHS

Pgbouncer runs under the same user as {{ pg_dbsu }} (defaults to postgres), with configuration files located in /etc/pgbouncer.

  • pgbouncer.ini: Connection pool main configuration file
  • database.txt: Defines databases in the connection pool
  • userlist.txt: Defines users in the connection pool
  • pgb_hba.conf: Defines access permissions for the connection pool

Redis FHS

Pigsty provides basic support for Redis deployment and monitoring.

Redis binaries are installed in /bin/ via RPM packages or binary copy, including:

redis-server
redis-server
redis-cli
redis-sentinel
redis-check-rdb
redis-check-aof
redis-benchmark
/usr/libexec/redis-shutdown

For a Redis instance named redis-test-1-6379, the related resources are as follows:

/usr/lib/systemd/system/redis-test-1-6379.service               # Service (on Debian: /lib/systemd)
/etc/redis/redis-test-1-6379.conf                               # Configuration
/data/redis/redis-test-1-6379                                   # Database directory
/data/redis/redis-test-1-6379/redis-test-1-6379.rdb             # RDB file
/data/redis/redis-test-1-6379/redis-test-1-6379.aof             # AOF file
/var/log/redis/redis-test-1-6379.log                            # Log
/var/run/redis/redis-test-1-6379.pid                            # PID

For Ubuntu/Debian, the default systemd service directory is /lib/systemd/system/ instead of /usr/lib/systemd/system/.

5 - Parameters

Pigsty configuration parameter overview and navigation

Pigsty provides approximately 380+ configuration parameters distributed across 8 core modules, allowing fine-grained control over all aspects of the system.


Module Navigation

This page provides navigation and overview for all Pigsty configuration parameters. Click on a module name to jump to the detailed parameter documentation.

ModuleParameter GroupsTotal ParametersDescription
PGSQL9123PostgreSQL database cluster core configuration
INFRA1082Infrastructure components: repo, Nginx, DNS, monitoring, Grafana, etc.
NODE1183Host node tuning: identity, DNS, packages, tuning, security, admin, time, VIP, etc.
ETCD213Distributed configuration storage and service discovery
REDIS121Redis cache and data structure server
MINIO221S3-compatible object storage service
FERRET19MongoDB-compatible database FerretDB
DOCKER18Docker container engine

PGSQL

The PGSQL module provides 9 groups with 123 PostgreSQL-related configuration parameters.

Parameter GroupCountDescription
PG_ID11PostgreSQL cluster and instance identity parameters
PG_BUSINESS12Business users, databases, services, and access control rules
PG_INSTALL10PostgreSQL installation: version, paths, packages
PG_BOOTSTRAP38PostgreSQL cluster initialization: Patroni high availability
PG_PROVISION8PostgreSQL cluster template provisioning: roles, privileges, extensions
PG_BACKUP6pgBackRest backup and recovery configuration
PG_ACCESS17Service exposure, connection pool, VIP, DNS client access configuration
PG_MONITOR17PostgreSQL monitoring exporter configuration
PG_REMOVE4PostgreSQL instance cleanup and uninstallation configuration

INFRA

The INFRA module provides 10 groups with 82 infrastructure-related configuration parameters.

Parameter GroupCountDescription
META5Pigsty meta information: version, admin IP, region, language, proxy
CA3Self-signed CA certificate management
INFRA_ID3Infrastructure node identity and service portal
REPO10Local software repository configuration
INFRA_PACKAGE2Infrastructure node package installation
NGINX14Nginx web server and reverse proxy configuration
DNS3DNSMasq DNS resolution service configuration
VICTORIA19VictoriaMetrics/Logs/Traces observability suite
PROMETHEUS7Alertmanager and Blackbox Exporter
GRAFANA8Grafana visualization platform configuration

NODE

The NODE module provides 11 groups with 83 host node-related configuration parameters.

Parameter GroupCountDescription
NODE_ID5Node identity parameters
NODE_DNS6Node DNS configuration
NODE_PACKAGE4Node package management
NODE_TUNE10Node kernel tuning parameters
NODE_SEC4Node security parameters
NODE_ADMIN9Node admin user configuration
NODE_TIME5Node time synchronization
NODE_VIP8Node VIP configuration
HAPROXY10HAProxy load balancer configuration
NODE_EXPORTER3Node exporter configuration
VECTOR6Vector log collector configuration

ETCD

The ETCD module provides 2 groups with 13 distributed configuration storage parameters.

Parameter GroupCountDescription
ETCD10ETCD cluster deployment and configuration
ETCD_REMOVE3ETCD cluster removal: safeguard, data cleanup, etc.

REDIS

The REDIS module provides 21 Redis-related configuration parameters.

Parameter GroupCountDescription
REDIS21Redis cluster deployment and configuration

MINIO

The MINIO module provides 2 groups with 21 MinIO object storage parameters.

Parameter GroupCountDescription
MINIO18MinIO cluster deployment and configuration
MINIO_REMOVE3MinIO cluster removal: safeguard, data cleanup, etc.

FERRET

The FERRET module provides 9 FerretDB-related configuration parameters.

Parameter GroupCountDescription
FERRET9FerretDB deployment and configuration

DOCKER

The DOCKER module provides 8 Docker container engine configuration parameters.

Parameter GroupCountDescription
DOCKER8Docker container engine configuration

Parameter Overview

The following tables provide a comprehensive summary of all parameters, organized by module.

PGSQL Parameters

PG_ID parameter group defines PostgreSQL cluster and instance identity, including cluster name, instance number, role, shard, etc.

ParameterTypeDescription
pg_modeenumpgsql cluster mode: pgsql,citus,mssql,mysql,polar,ivory,oracle,gpsql
pg_clusterstringpgsql cluster name, required identity parameter
pg_seqintpgsql instance number, required identity parameter
pg_roleenumpgsql instance role, required, can be primary, replica, offline
pg_instancesdictDefine multiple pg instances on one node, using {port:ins_vars} format
pg_upstreamipUpstream node IP for cascaded replica or standby cluster
pg_shardstringpgsql shard name, required for citus and gpsql horizontal sharding clusters
pg_groupintpgsql shard number, positive integer, required for citus and gpsql clusters
gp_roleenumGreenplum role for this cluster, can be master or segment
pg_exportersdictSet up additional pg_exporters on this node to monitor remote postgres instances
pg_offline_queryboolSet to true to mark this replica as special offline instance for Offline service

PG_BUSINESS parameter group defines business users, databases, services, access control rules, and default system user credentials.

ParameterTypeDescription
pg_usersuser[]Postgres business users
pg_databasesdatabase[]Postgres business databases
pg_servicesservice[]Postgres business services
pg_hba_ruleshba[]Postgres business HBA rules
pgb_hba_ruleshba[]Pgbouncer business HBA rules
pg_replication_usernameusernamePostgres replication username, default replicator
pg_replication_passwordpasswordPostgres replication password, default DBUser.Replicator
pg_admin_usernameusernamePostgres admin username, default dbuser_dba
pg_admin_passwordpasswordPostgres admin password, default DBUser.DBA
pg_monitor_usernameusernamePostgres monitor username, default dbuser_monitor
pg_monitor_passwordpasswordPostgres monitor password, default DBUser.Monitor
pg_dbsu_passwordpassworddbsu password, empty string means no dbsu password, best not to set

PG_INSTALL parameter group configures PostgreSQL installation options, including version, paths, packages, and extensions.

ParameterTypeDescription
pg_dbsuusernameOS dbsu name, default postgres, best not to change
pg_dbsu_uidintOS dbsu uid and gid, default 26 for postgres user and group
pg_dbsu_sudoenumdbsu sudo privilege: none, limit, all, nopass, default limit
pg_dbsu_homepathPostgreSQL home directory, default /var/lib/pgsql
pg_dbsu_ssh_exchangeboolExchange postgres dbsu ssh keys between pgsql cluster
pg_versionenumPostgres major version to install, default 18
pg_bin_dirpathPostgres binary directory, default /usr/pgsql/bin
pg_log_dirpathPostgres log directory, default /pg/log/postgres
pg_packagesstring[]pg packages to install, ${pg_version} will be replaced
pg_extensionsstring[]pg extensions to install, ${pg_version} will be replaced

PG_BOOTSTRAP parameter group configures PostgreSQL cluster initialization, including Patroni HA, data directory, storage, connections, encoding, etc.

ParameterTypeDescription
pg_datapathPostgres data directory, default /pg/data
pg_fs_mainpathPostgres main data mount point, default /data/postgres
pg_fs_backuppathpg backup data mount point, default /data/backups
pg_storage_typeenumpg main data storage type: SSD, HDD, default SSD
pg_dummy_filesizesizeSize of /pg/dummy, default reserves 64MB for emergency
pg_listenip(s)postgres/pgbouncer listen address, default 0.0.0.0
pg_portportPostgres listen port, default 5432
pg_localhostpathPostgres Unix socket directory for local connections
pg_namespacepathTop-level key namespace in etcd, used by patroni & vip
patroni_enabledboolIf disabled, postgres cluster won’t be created during init
patroni_modeenumPatroni working mode: default, pause, remove
patroni_portportPatroni listen port, default 8008
patroni_log_dirpathPatroni log directory, default /pg/log/patroni
patroni_ssl_enabledboolSecure patroni RestAPI with SSL?
patroni_watchdog_modeenumPatroni watchdog mode: automatic, required, off, default off
patroni_usernameusernamePatroni restapi username, default postgres
patroni_passwordpasswordPatroni restapi password, default Patroni.API
pg_primary_dbstringPrimary database name in cluster, used by Citus, default postgres
pg_parametersdictOverride PostgreSQL parameters in postgresql.auto.conf
pg_filespath[]Extra files to copy to PGDATA directory (e.g., license files)
pg_confenumConfig template: oltp, olap, crit, tiny, default oltp.yml
pg_max_connintPostgres max connections, auto uses recommended value
pg_shared_buffer_ratiofloatPostgres shared buffer memory ratio, default 0.25, range 0.1~0.4
pg_rtointRecovery Time Objective (seconds), default 30s
pg_rpointRecovery Point Objective (bytes), default 1MiB
pg_libsstringPreloaded libraries, default pg_stat_statements,auto_explain
pg_delayintervalWAL replay delay for standby cluster, for delayed replica
pg_checksumboolEnable data checksums for postgres cluster?
pg_pwd_encenumPassword encryption algorithm: fixed to scram-sha-256
pg_encodingenumDatabase cluster encoding, default UTF8
pg_localeenumDatabase cluster locale setting, default C
pg_lc_collateenumDatabase cluster collation, default C
pg_lc_ctypeenumDatabase character type, default C
pg_io_methodenumPostgreSQL IO method: auto, sync, worker, io_uring
pg_etcd_passwordpasswordPassword for this PostgreSQL cluster in etcd, default uses cluster name
pgsodium_keystringpgsodium encryption master key, 64-bit hex, default sha256(pg_cluster)
pgsodium_getkey_scriptpathpgsodium getkey script path, default uses template pgsodium_getkey

PG_PROVISION parameter group configures PostgreSQL cluster template provisioning, including default roles, privileges, schemas, extensions, and HBA rules.

ParameterTypeDescription
pg_provisionboolProvision postgres cluster business objects after bootstrap?
pg_initstringCluster template initialization script, default pg-init
pg_default_rolesrole[]Default predefined roles and system users in postgres cluster
pg_default_privilegesstring[]Default privileges when admin user creates database objects
pg_default_schemasstring[]List of default schemas to create
pg_default_extensionsextension[]List of default extensions to create
pg_reloadboolReload postgres config immediately after HBA changes
pg_default_hba_ruleshba[]Postgres host-based authentication rules, global PG default HBA
pgb_default_hba_ruleshba[]Pgbouncer default host-based authentication rules, global PGB default HBA

PG_BACKUP parameter group configures pgBackRest backup and recovery, including repository type, path, retention policy, etc.

ParameterTypeDescription
pgbackrest_enabledboolEnable pgbackrest on pgsql host?
pgbackrest_cleanboolDelete previous pg backup data during init?
pgbackrest_log_dirpathpgbackrest log directory, default /pg/log/pgbackrest
pgbackrest_methodenumpgbackrest repo method: local, minio, etc.
pgbackrest_init_backupboolExecute full backup immediately after pgbackrest init? default true
pgbackrest_repodictpgbackrest repository definition

PG_ACCESS parameter group configures service exposure, connection pool, VIP, DNS, and other client access options.

ParameterTypeDescription
pgbouncer_enabledboolIf disabled, pgbouncer connection pool won’t be configured
pgbouncer_portportpgbouncer listen port, default 6432
pgbouncer_log_dirpathpgbouncer log directory, default /pg/log/pgbouncer
pgbouncer_auth_queryboolUse AuthQuery to fetch unlisted business users from postgres?
pgbouncer_poolmodeenumPooling mode: transaction, session, statement, default transaction
pgbouncer_sslmodeenumpgbouncer client SSL mode, default disabled
pgbouncer_ignore_paramstring[]pgbouncer ignore startup parameters list
pg_weightintRelative load balancing weight in service, default 100, range 0-255
pg_service_providerstringDedicated haproxy node group name, or empty for local haproxy
pg_default_service_destenumIf svc.dest=‘default’, default service points to postgres or pgbouncer
pg_default_servicesservice[]Postgres default service definition list, global shared
pg_vip_enabledboolEnable L2 VIP for pgsql primary node? default disabled
pg_vip_addresscidr4VIP address format <ipv4>/<mask>, required when vip enabled
pg_vip_interfacestringVIP network interface to listen, default eth0
pg_dns_suffixstringpgsql dns suffix, default empty
pg_dns_targetenumPG DNS resolves to: auto, primary, vip, none, or specific IP

PG_MONITOR parameter group configures PostgreSQL monitoring exporters, including pg_exporter, pgbouncer_exporter, and pgbackrest_exporter.

ParameterTypeDescription
pg_exporter_enabledboolEnable pg_exporter on pgsql host?
pg_exporter_configstringpg_exporter config file/template name
pg_exporter_cache_ttlsstringpg_exporter collector tiered TTL config, default ‘1,10,60,300’
pg_exporter_portportpg_exporter listen port, default 9630
pg_exporter_paramsstringExtra URL parameters passed in pg_exporter dsn
pg_exporter_urlpgurlIf specified, overrides auto-generated postgres DSN connection string
pg_exporter_auto_discoveryboolEnable monitoring auto database discovery? default enabled
pg_exporter_exclude_databasestringExcluded database names when auto discovery enabled, comma-separated
pg_exporter_include_databasestringOnly monitor databases in this list when auto discovery enabled
pg_exporter_connect_timeoutintpg_exporter connection timeout in ms, default 200
pg_exporter_optionsargpg_exporter extra command line options
pgbouncer_exporter_enabledboolEnable pgbouncer_exporter on pgsql host?
pgbouncer_exporter_portportpgbouncer_exporter listen port, default 9631
pgbouncer_exporter_urlpgurlIf specified, overrides auto-generated pgbouncer dsn connection string
pgbouncer_exporter_optionsargpgbouncer_exporter extra command line options
pgbackrest_exporter_enabledboolEnable pgbackrest_exporter on pgsql host?
pgbackrest_exporter_portportpgbackrest_exporter listen port, default 9854
pgbackrest_exporter_optionsargpgbackrest_exporter extra command line options

PG_REMOVE parameter group configures PostgreSQL instance cleanup and uninstallation behavior, including data directory, backup, and package removal control.

ParameterTypeDescription
pg_rm_databoolClean postgres data directory when removing pgsql instance?
pg_rm_backupboolClean pgbackrest backup when removing primary?
pg_rm_pkgboolUninstall related packages when removing pgsql instance?
pg_safeguardboolSafeguard to prevent accidental pgsql cleanup? default false

INFRA Parameters

META parameter group defines Pigsty meta information, including version number, admin node IP, repository region, default language, and proxy settings.

ParameterTypeDescription
versionstringPigsty version string
admin_ipipAdmin node IP address
regionenumUpstream mirror region: default, china, europe
languageenumDefault language, en or zh
proxy_envdictGlobal proxy environment variables for package downloads

CA parameter group configures Pigsty self-signed CA certificate management, including whether to create CA, CA name, and certificate validity.

ParameterTypeDescription
ca_createboolCreate CA if not exists? default true
ca_cnstringCA CN name, fixed to pigsty-ca
cert_validityintervalCertificate validity, default 20 years

INFRA_ID parameter group defines infrastructure node identity, including node sequence number, service portal configuration, and data directory.

ParameterTypeDescription
infra_seqintInfrastructure node sequence number, required identity parameter
infra_portaldictInfrastructure service list exposed via Nginx portal
infra_datapathInfrastructure data directory, default /data/infra

REPO parameter group configures local software repository, including repository enable switch, directory path, upstream source definitions, and packages to download.

ParameterTypeDescription
repo_enabledboolCreate software repository on this infra node?
repo_homepathSoftware repository home directory, default /www
repo_namestringSoftware repository name, default pigsty
repo_endpointurlRepository access point: domain or ip:port format
repo_removeboolRemove existing upstream repo source definition files when building local repo?
repo_modulesstringEnabled upstream repository module list, comma-separated
repo_upstreamupstream[]Upstream repository source definitions: where to download packages
repo_packagesstring[]Which packages to download from upstream
repo_extra_packagesstring[]Which extra packages to download from upstream
repo_url_packagesstring[]Extra packages to download by URL

INFRA_PACKAGE parameter group defines packages to install on infrastructure nodes, including RPM/DEB and PIP packages.

ParameterTypeDescription
infra_packagesstring[]Packages to install on infrastructure nodes
infra_packages_pipstringPackages to install via pip on infrastructure nodes

NGINX parameter group configures Nginx web server and reverse proxy, including enable switch, ports, SSL mode, certificates, and basic authentication.

ParameterTypeDescription
nginx_enabledboolEnable nginx on this infra node?
nginx_cleanboolClean existing nginx config during init?
nginx_exporter_enabledboolEnable nginx_exporter on this infra node?
nginx_exporter_portportnginx_exporter listen port, default 9113
nginx_sslmodeenumnginx SSL mode: disable, enable, enforce
nginx_cert_validitydurationnginx self-signed certificate validity, default 397d
nginx_homepathnginx content directory, default /www, symlinks to nginx_data
nginx_datapathnginx actual data directory, default /data/nginx
nginx_usersdictnginx basic auth users: username and password dictionary
nginx_portportnginx listen port, default 80
nginx_ssl_portportnginx SSL listen port, default 443
certbot_signboolUse certbot to sign certificates?
certbot_emailstringcertbot notification email address
certbot_optionsstringcertbot extra command line arguments

DNS parameter group configures DNSMasq DNS resolution service, including enable switch, listen port, and dynamic DNS records.

ParameterTypeDescription
dns_enabledboolSet up dnsmasq on this infra node?
dns_portportDNS server listen port, default 53
dns_recordsstring[]Dynamic DNS records resolved by dnsmasq

VICTORIA parameter group configures VictoriaMetrics/Logs/Traces observability suite, including enable switches, ports, data retention policies, etc.

ParameterTypeDescription
vmetrics_enabledboolEnable VictoriaMetrics on this infra node?
vmetrics_cleanboolClean VictoriaMetrics data during init?
vmetrics_portportVictoriaMetrics listen port, default 8428
vmetrics_scrape_intervalintervalGlobal scrape interval, default 10s
vmetrics_scrape_timeoutintervalGlobal scrape timeout, default 8s
vmetrics_optionsargVictoriaMetrics extra command line arguments
vlogs_enabledboolEnable VictoriaLogs on this infra node?
vlogs_cleanboolClean VictoriaLogs data during init?
vlogs_portportVictoriaLogs listen port, default 9428
vlogs_optionsargVictoriaLogs extra command line arguments
vtraces_enabledboolEnable VictoriaTraces on this infra node?
vtraces_cleanboolClean VictoriaTraces data during init?
vtraces_portportVictoriaTraces listen port, default 10428
vtraces_optionsargVictoriaTraces extra command line arguments
vmalert_enabledboolEnable VMAlert on this infra node?
vmalert_portportVMAlert listen port, default 8880
vmalert_optionsargVMAlert extra command line arguments

PROMETHEUS parameter group configures Alertmanager and Blackbox Exporter, providing alerting management and network probing.

ParameterTypeDescription
blackbox_enabledboolSet up blackbox_exporter on this infra node?
blackbox_portportblackbox_exporter listen port, default 9115
blackbox_optionsargblackbox_exporter extra command line options
alertmanager_enabledboolSet up alertmanager on this infra node?
alertmanager_portportAlertManager listen port, default 9059
alertmanager_optionsargalertmanager extra command line options
exporter_metrics_pathpathexporter metrics path, default /metrics

GRAFANA parameter group configures Grafana visualization platform, including enable switch, port, admin credentials, and data source configuration.

ParameterTypeDescription
grafana_enabledboolEnable Grafana on this infra node?
grafana_portportGrafana listen port, default 3000
grafana_cleanboolClean data during Grafana init?
grafana_admin_usernameusernameGrafana admin username, default admin
grafana_admin_passwordpasswordGrafana admin password, default pigsty
grafana_auth_proxyboolEnable Grafana auth proxy?
grafana_pgurlurlExternal PostgreSQL database URL (for Grafana persistence)
grafana_view_passwordpasswordGrafana metadb PG datasource password

NODE Parameters

NODE_ID parameter group defines node identity parameters, including node name, cluster name, and whether to borrow identity from PostgreSQL.

ParameterTypeDescription
nodenamestringNode instance identifier, uses hostname if missing, optional
node_clusterstringNode cluster identifier, uses ’nodes’ if missing, optional
nodename_overwriteboolOverwrite node hostname with nodename?
nodename_exchangeboolExchange nodename between playbook hosts?
node_id_from_pgboolBorrow postgres identity as node identity if possible?

NODE_DNS parameter group configures node DNS resolution, including static hosts records and dynamic DNS servers.

ParameterTypeDescription
node_write_etc_hostsboolModify /etc/hosts on target nodes?
node_default_etc_hostsstring[]Static DNS records in /etc/hosts
node_etc_hostsstring[]Extra static DNS records in /etc/hosts
node_dns_methodenumHow to handle existing DNS servers: add, none, overwrite
node_dns_serversstring[]Dynamic DNS server list in /etc/resolv.conf
node_dns_optionsstring[]DNS resolution options in /etc/resolv.conf

NODE_PACKAGE parameter group configures node software sources and package installation.

ParameterTypeDescription
node_repo_modulesenumWhich repo modules to enable on node? default local
node_repo_removeboolRemove existing repos on node when configuring node software repos?
node_packagesstring[]Packages to install on current node
node_default_packagesstring[]Default packages to install on all nodes

NODE_TUNE parameter group configures node kernel parameters, feature switches, and performance tuning templates.

ParameterTypeDescription
node_disable_numaboolDisable node NUMA, requires reboot
node_disable_swapboolDisable node Swap, use with caution
node_static_networkboolPreserve DNS resolver settings after reboot, i.e., static network, default enabled
node_disk_prefetchboolConfigure disk prefetch on HDD to improve performance
node_kernel_modulesstring[]Kernel modules to enable on this node
node_hugepage_countintNumber of 2MB hugepages allocated on host node, higher priority than ratio
node_hugepage_ratiofloatMemory hugepage ratio allocated on host node, 0 disables
node_overcommit_ratiofloatNode memory overcommit ratio (50-100), 0 disables
node_tuneenumNode tuning profile: none, oltp, olap, crit, tiny
node_sysctl_paramsdictExtra sysctl config parameters, k:v format

NODE_SEC parameter group configures node security options, including SELinux, firewall, etc.

ParameterTypeDescription
node_selinux_modeenumSELinux mode: disabled, permissive, enforcing
node_firewall_modeenumFirewall mode: off, none, zone
node_firewall_intranetcidr[]Intranet CIDR list for firewall rules
node_firewall_public_portport[]Public open port list, default [22, 80, 443, 5432]

NODE_ADMIN parameter group configures node admin user, data directory, and command aliases.

ParameterTypeDescription
node_datapathNode main data directory, default /data
node_admin_enabledboolCreate admin user on target node?
node_admin_uidintNode admin user uid and gid
node_admin_usernameusernameNode admin user name, default dba
node_admin_sudoenumAdmin user sudo privilege: limited, nopass, all, none
node_admin_ssh_exchangeboolExchange admin ssh keys between node clusters?
node_admin_pk_currentboolAdd current user’s ssh public key to admin’s authorized_keys?
node_admin_pk_liststring[]ssh public keys to add to admin user
node_aliasesdictShell alias commands to configure on host, KV dictionary

NODE_TIME parameter group configures node timezone, NTP time sync, and cron jobs.

ParameterTypeDescription
node_timezonestringSet host node timezone, empty string skips
node_ntp_enabledboolEnable chronyd time sync service?
node_ntp_serversstring[]NTP server list in /etc/chrony.conf
node_crontab_overwriteboolAppend or overwrite when writing /etc/crontab?
node_crontabstring[]Crontab entries in /etc/crontab

NODE_VIP parameter group configures node cluster L2 VIP, implemented by keepalived.

ParameterTypeDescription
vip_enabledboolEnable L2 VIP on this node cluster?
vip_addressipNode VIP address in ipv4 format, required when vip enabled
vip_vridintRequired integer 1-254, should be unique in same VLAN
vip_roleenumOptional, master/backup, default backup
vip_preemptboolOptional, true/false, default false, enable vip preemption
vip_interfacestringNode VIP network interface to listen, default eth0
vip_dns_suffixstringNode VIP DNS name suffix, default empty string
vip_auth_passpasswordVRRP auth password, auto-generated if empty
vip_exporter_portportkeepalived exporter listen port, default 9650

HAPROXY parameter group configures HAProxy load balancer and service exposure on nodes.

ParameterTypeDescription
haproxy_enabledboolEnable haproxy on this node?
haproxy_cleanboolClean all existing haproxy config?
haproxy_reloadboolReload haproxy after config?
haproxy_auth_enabledboolEnable haproxy admin page authentication?
haproxy_admin_usernameusernamehaproxy admin username, default admin
haproxy_admin_passwordpasswordhaproxy admin password, default pigsty
haproxy_exporter_portporthaproxy exporter port, default 9101
haproxy_client_timeoutintervalhaproxy client connection timeout, default 24h
haproxy_server_timeoutintervalhaproxy server connection timeout, default 24h
haproxy_servicesservice[]haproxy service list to expose on node

NODE_EXPORTER parameter group configures node monitoring exporter.

ParameterTypeDescription
node_exporter_enabledboolConfigure node_exporter on this node?
node_exporter_portportnode exporter listen port, default 9100
node_exporter_optionsargnode_exporter extra server options

VECTOR parameter group configures Vector log collector.

ParameterTypeDescription
vector_enabledboolEnable vector log collector?
vector_cleanboolClean vector data directory during init?
vector_datapathvector data directory, default /data/vector
vector_portportvector metrics listen port, default 9598
vector_read_fromenumvector reads logs from beginning or end
vector_log_endpointstring[]Log send destination endpoint, default sends to infra group

ETCD Parameters

ETCD parameter group is for etcd cluster deployment and configuration, including instance identity, cluster name, data directory, ports, and authentication password.

ParameterTypeDescription
etcd_seqintetcd instance identifier, required
etcd_clusterstringetcd cluster name, default fixed to etcd
etcd_learnerboolInitialize etcd instance as learner?
etcd_datapathetcd data directory, default /data/etcd
etcd_portportetcd client port, default 2379
etcd_peer_portportetcd peer port, default 2380
etcd_initenumetcd initial cluster state, new or existing
etcd_election_timeoutintetcd election timeout, default 1000ms
etcd_heartbeat_intervalintetcd heartbeat interval, default 100ms
etcd_root_passwordpasswordetcd root user password for RBAC authentication

ETCD_REMOVE parameter group controls etcd cluster removal behavior, including safeguard, data cleanup, and package uninstallation.

ParameterTypeDescription
etcd_safeguardbooletcd safeguard to prevent cleaning running etcd instance?
etcd_rm_databoolDelete etcd data when removing? default true
etcd_rm_pkgboolUninstall etcd package when removing? default false

REDIS Parameters

REDIS parameter group is for Redis cluster deployment and configuration, including identity, instance definitions, working mode, memory configuration, persistence, and monitoring.

ParameterTypeDescription
redis_clusterstringRedis database cluster name, required identity parameter
redis_instancesdictInstance definitions on Redis node
redis_nodeintRedis node number, positive integer, unique in cluster, required
redis_fs_mainpathRedis main data directory, default /data
redis_exporter_enabledboolRedis Exporter enabled?
redis_exporter_portportRedis Exporter listen port
redis_exporter_optionsstringRedis Exporter command arguments
redis_safeguardboolPrevent erasing existing Redis
redis_cleanboolErase existing instance when initializing Redis
redis_rmdataboolRemove data when removing Redis instance?
redis_modeenumRedis cluster mode: sentinel, cluster, standalone
redis_confstringRedis config file template, except sentinel
redis_bind_addressipRedis listen address, empty binds to host IP
redis_max_memorysizeRedis max available memory
redis_mem_policyenumRedis memory eviction policy
redis_passwordpasswordRedis password, empty disables password
redis_rdb_savestring[]Redis RDB save directives, empty array disables RDB
redis_aof_enabledboolRedis AOF enabled?
redis_rename_commandsdictRedis dangerous command rename list
redis_cluster_replicasintHow many replicas per master in Redis native cluster?
redis_sentinel_monitormaster[]Master list monitored by Redis sentinel, only for sentinel cluster

MINIO Parameters

MINIO parameter group is for MinIO cluster deployment and configuration, including identity, storage paths, ports, authentication credentials, and bucket/user provisioning.

ParameterTypeDescription
minio_seqintminio instance identifier, required
minio_clusterstringminio cluster name, default minio
minio_userusernameminio OS user, default minio
minio_httpsboolEnable HTTPS for MinIO? default true
minio_nodestringminio node name pattern
minio_datapathminio data directory, use {x...y} for multiple disks
minio_volumesstringminio core parameter, specifies member nodes and disks
minio_domainstringminio external domain, default sss.pigsty
minio_portportminio service port, default 9000
minio_admin_portportminio console port, default 9001
minio_access_keyusernameRoot access key, default minioadmin
minio_secret_keypasswordRoot secret key, default S3User.MinIO
minio_extra_varsstringExtra environment variables for minio server
minio_provisionboolExecute minio resource provisioning task? default true
minio_aliasstringminio deployment client alias
minio_endpointstringminio deployment client alias endpoint
minio_bucketsbucket[]minio buckets to create
minio_usersuser[]minio users to create

MINIO_REMOVE parameter group controls MinIO cluster removal behavior, including safeguard, data cleanup, and package uninstallation.

ParameterTypeDescription
minio_safeguardboolPrevent accidental deletion? default false
minio_rm_databoolDelete minio data when removing? default true
minio_rm_pkgboolUninstall minio package when removing? default false

FERRET Parameters

FERRET parameter group is for FerretDB deployment and configuration, including identity, underlying PostgreSQL connection, listen port, and SSL settings.

ParameterTypeDescription
mongo_seqintmongo instance number, required identity parameter
mongo_clusterstringmongo cluster name, required identity parameter
mongo_pgurlpgurlPGURL connection string for FerretDB backend
mongo_ssl_enabledboolEnable SSL? default false
mongo_listenipListen address, empty listens on all addresses
mongo_portportService port, default 27017
mongo_ssl_portportTLS listen port, default 27018
mongo_exporter_portportExporter port, default 9216
mongo_extra_varsstringExtra environment variables, default empty string

DOCKER Parameters

DOCKER parameter group is for Docker container engine deployment and configuration, including enable switch, data directory, storage driver, registry mirrors, and monitoring.

ParameterTypeDescription
docker_enabledboolEnable Docker on current node? default disabled
docker_datapathDocker data directory, default /data/docker
docker_storage_driverenumDocker storage driver, default overlay2
docker_cgroups_driverenumDocker CGroup filesystem driver: cgroupfs, systemd
docker_registry_mirrorsstring[]Docker registry mirror list
docker_exporter_portportDocker monitoring metrics export port, default 9323
docker_imagestring[]Docker images to pull, default empty list
docker_image_cachepathDocker image tarball path to import, default /tmp/docker/*.tgz

6 - Playbooks

Overview and navigation of Pigsty preset playbooks

Pigsty provides a series of Ansible playbooks for automated deployment and management of various modules. This page provides navigation and summary of all playbooks.


Module Navigation

ModuleDescription
INFRA3Infrastructure module playbooks
NODE2Node management module playbooks
ETCD2ETCD cluster management playbooks
PGSQL7PostgreSQL cluster management playbooks
REDIS2Redis cluster management playbooks
MINIO2MinIO object storage management playbooks
FERRET1FerretDB management playbook
DOCKER1Docker management playbook

Playbook Summary

The following table lists all available preset playbooks in Pigsty:

PlaybookModuleFunction
deploy.ymlADMINDeploy pigsty on current environment
infra.ymlINFRAInitialize pigsty infrastructure on infra nodes
infra-rm.ymlINFRARemove infrastructure components from infra nodes
node.ymlNODEManage nodes, adjust nodes to desired state
node-rm.ymlNODERemove managed nodes from Pigsty
etcd.ymlETCDInstall and configure Etcd cluster
etcd-rm.ymlETCDRemove Etcd cluster or members
pgsql.ymlPGSQLInitialize PostgreSQL cluster or add new replicas
pgsql-rm.ymlPGSQLRemove PostgreSQL cluster or instance
pgsql-user.ymlPGSQLAdd new business users to existing PostgreSQL cluster
pgsql-db.ymlPGSQLAdd new business databases to existing PostgreSQL cluster
pgsql-monitor.ymlPGSQLMonitor remote PostgreSQL instances
pgsql-migration.ymlPGSQLGenerate migration manuals and scripts for existing PostgreSQL clusters
pgsql-pitr.ymlPGSQLExecute PostgreSQL Point-in-Time Recovery (PITR)
redis.ymlREDISInitialize Redis cluster/node/instance
redis-rm.ymlREDISRemove Redis cluster/node/instance
minio.ymlMINIOInstall MinIO cluster
minio-rm.ymlMINIORemove MinIO cluster
mongo.ymlFERRETInstall FerretDB on nodes
docker.ymlDOCKERInstall Docker Daemon and Docker Compose

Playbook Usage Notes

Protection Mechanism

Multiple modules provide deletion protection through *_safeguard parameters:

  • PGSQL: pg_safeguard prevents accidental deletion of PostgreSQL clusters
  • ETCD: etcd_safeguard prevents accidental deletion of Etcd clusters
  • MINIO: minio_safeguard prevents accidental deletion of MinIO clusters

By default, these safeguard parameters are not enabled (undefined). It’s recommended to explicitly set them to true for initialized clusters in production environments.

When the protection switch is set to true, the corresponding *-rm.yml playbook will abort immediately. You can force override through command-line parameters:

./pgsql-rm.yml -l pg-test -e pg_safeguard=false
./etcd-rm.yml -e etcd_safeguard=false
./minio-rm.yml -l minio -e minio_safeguard=false

Limiting Execution Scope

When executing playbooks, it’s recommended to use the -l parameter to limit the execution scope:

./pgsql.yml -l pg-meta            # Limit execution to pg-meta cluster
./node.yml -l 10.10.10.10         # Limit execution to specific node
./redis.yml -l redis-test         # Limit execution to redis-test cluster

Idempotency

Most playbooks are idempotent and can be executed repeatedly. However, note:

  • infra.yml does not clear data by default and can be safely re-executed. All clean parameters (vmetrics_clean, vlogs_clean, vtraces_clean, grafana_clean, nginx_clean) default to false
  • To clear infrastructure data for rebuild, you need to explicitly set the corresponding clean parameter to true
  • Be extra careful when repeatedly executing *-rm.yml deletion playbooks

Task Tags

You can use the -t parameter to execute only specific task subsets:

./pgsql.yml -l pg-test -t pg_service    # Only refresh pg-test cluster services
./node.yml -t haproxy                   # Only set up haproxy on nodes
./etcd.yml -t etcd_launch               # Only restart etcd service

Quick Command Reference

./deploy.yml                     # One-pass deployment

INFRA Module

./infra.yml                      # Initialize infrastructure
./infra-rm.yml                   # Remove infrastructure

NODE Module

./node.yml -l <cls|ip>           # Add node
./node-rm.yml -l <cls|ip>        # Remove node
bin/node-add <cls|ip>            # Add node (wrapper script)
bin/node-rm <cls|ip>             # Remove node (wrapper script)

ETCD Module

./etcd.yml                       # Initialize etcd cluster
./etcd-rm.yml                    # Remove etcd cluster
bin/etcd-add <ip>                # Add etcd member (wrapper script)
bin/etcd-rm <ip>                 # Remove etcd member (wrapper script)

PGSQL Module

./pgsql.yml -l <cls>                            # Initialize PostgreSQL cluster
./pgsql-rm.yml -l <cls>                         # Remove PostgreSQL cluster
./pgsql-user.yml -l <cls> -e username=<user>    # Create business user
./pgsql-db.yml -l <cls> -e dbname=<db>          # Create business database
./pgsql-monitor.yml -e clsname=<cls>            # Monitor remote cluster
./pgsql-pitr.yml -l <cls> -e '{"pg_pitr": {}}'  # Execute PITR recovery
bin/pgsql-add <cls>              # Initialize cluster (wrapper script)
bin/pgsql-rm <cls>               # Remove cluster (wrapper script)
bin/pgsql-user <cls> <user>      # Create user (wrapper script)
bin/pgsql-db <cls> <db>          # Create database (wrapper script)

REDIS Module

./redis.yml -l <cls>             # Initialize Redis cluster
./redis-rm.yml -l <cls>          # Remove Redis cluster

MINIO Module

./minio.yml -l <cls>             # Initialize MinIO cluster
./minio-rm.yml -l <cls>          # Remove MinIO cluster

FERRET Module

./mongo.yml -l ferret            # Install FerretDB

DOCKER Module

./docker.yml -l <host>           # Install Docker

7 - Port List

Default ports used by Pigsty components, with related parameters and status.

This page lists default ports used by Pigsty module components. Adjust as needed or use as a reference for fine-grained firewall configuration.

ModuleComponentPortParameterStatus
NODEnode_exporter9100node_exporter_portEnabled
NODEhaproxy9101haproxy_exporter_portEnabled
NODEvector9598vector_portEnabled
NODEkeepalived_exporter9650vip_exporter_portOptional
NODEchronyd123-Enabled
DOCKERdocker9323docker_exporter_portOptional
INFRAnginx80nginx_portEnabled
INFRAnginx443nginx_ssl_portEnabled
INFRAgrafana3000grafana_portEnabled
INFRAvictoriaMetrics8428vmetrics_portEnabled
INFRAvictoriaLogs9428vlogs_portEnabled
INFRAvictoriaTraces10428vtraces_portEnabled
INFRAvmalert8880vmalert_portEnabled
INFRAalertmanager9059alertmanager_portEnabled
INFRAblackbox_exporter9115blackbox_portEnabled
INFRAdnsmasq53dns_portEnabled
ETCDetcd2379etcd_portEnabled
ETCDetcd2380etcd_peer_portEnabled
MINIOminio9000minio_portEnabled
MINIOminio9001minio_admin_portEnabled
REDISredis6379redis_portOptional
REDISredis_exporter9121redis_exporter_portOptional
FERRETferretdb27017mongo_portOptional
FERRETmongo_exporter9216mongo_exporter_portEnabled
PGSQLpostgres5432pg_portEnabled
PGSQLpgbouncer6432pgbouncer_portEnabled
PGSQLpatroni8008patroni_portEnabled
PGSQLpg_exporter9630pg_exporter_portEnabled
PGSQLpgbouncer_exporter9631pgbouncer_exporter_portEnabled
PGSQLpgbackrest_exporter9854pgbackrest_exporter_portEnabled
PGSQL{{ pg_cluster }}-primary5433pg_default_servicesEnabled
PGSQL{{ pg_cluster }}-replica5434pg_default_servicesEnabled
PGSQL{{ pg_cluster }}-default5436pg_default_servicesEnabled
PGSQL{{ pg_cluster }}-offline5438pg_default_servicesEnabled
PGSQL{{ pg_cluster }}-<service>543xpg_servicesOptional