Skip to content

Version v2.7.0 of the documentation is no longer actively maintained. The site that you are currently viewing is an archived snapshot. For up-to-date documentation, see the latest version.

Module: PIGSTY

  • RELEASENOTE

    In Docs

    ReferencePIGSTY

    Version Time Description Release v2.7.0 2024-05-20 Extension Overwhelming, new docker apps v2.7.0 v2.6.0 2024-02-28 PG 16 as default version, ParadeDB & DuckDB v2.6.0 v2.5.1 2023-12-01 Routine update, pg16 major extensions v2.5.1 v2.5.0 2023-10-24 …

    Version Time Description Release v2.7.0 2024-05-20 Extension Overwhelming, new docker apps v2.7.0 v2.6.0 2024-02-28 PG 16 as default version, ParadeDB & DuckDB v2.6.0 v2.5.1 2023-12-01 Routine update, pg16 major extensions v2.5.1 v2.5.0 2023-10-24 …

  • PGSQL Architecture

    In Module: PGSQL

    ReferencePIGSTY

    Overview of the PGSQL module and key concepts PGSQL for production environments is organized in clusters, which clusters are logical entities consisting of a set of database instances associated by primary-replica. Each database cluster is an …

    Overview of the PGSQL module and key concepts PGSQL for production environments is organized in clusters, which clusters are logical entities consisting of a set of database instances associated by primary-replica. Each database cluster is an …

  • Service

    In About Pigsty

    AboutBusinessPIGSTY

    Pigsty is a battery-included use PostgreSQL database distribution, a local-first alternative to RDS/cloud database services, allowing users to run a fully-featured local RDS service at a hardware cost of just a few core months. The software itself is …

    Pigsty is a battery-included use PostgreSQL database distribution, a local-first alternative to RDS/cloud database services, allowing users to run a fully-featured local RDS service at a hardware cost of just a few core months. The software itself is …

  • FAQ

    In Getting Started

    SetupFAQPIGSTY

    If you have any unlisted questions or suggestions, please create an Issue or ask the community for help. How to Get the Pigsty Source Package? Use the following command to install Pigsty with one click: bash -c "$(curl -fsSL …

    If you have any unlisted questions or suggestions, please create an Issue or ask the community for help. How to Get the Pigsty Source Package? Use the following command to install Pigsty with one click: bash -c "$(curl -fsSL …

  • FAQ

    In Module: REDIS

    SetupFAQPIGSTY

    ABORT due to existing redis instance use redis_clean = true and redis_safeguard = false to force clean redis data This happens when you run redis.yml to init a redis instance that is already running, and redis_clean is set to false. If redis_clean …

    ABORT due to existing redis instance use redis_clean = true and redis_safeguard = false to force clean redis data This happens when you run redis.yml to init a redis instance that is already running, and redis_clean is set to false. If redis_clean …

  • FAQ

    In Module: NODE

    SetupFAQPIGSTY

    How to configure NTP service? If NTP is not configured, use a public NTP service or sync time with the admin node. If your nodes already have NTP configured, you can leave it there by setting node_ntp_enabled to false. Otherwise, if you have …

    How to configure NTP service? If NTP is not configured, use a public NTP service or sync time with the admin node. If your nodes already have NTP configured, you can leave it there by setting node_ntp_enabled to false. Otherwise, if you have …

  • FAQ

    In Module: MONGO

    SetupFAQPIGSTY

    Install mongosh cat > /etc/yum.repos.d/mongo.repo <<EOF [mongodb-org-7.0] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/7.0/x86_64/ gpgcheck=0 enabled=1 EOF yum install -y mongodb-mongosh # or just …

    Install mongosh cat > /etc/yum.repos.d/mongo.repo <<EOF [mongodb-org-7.0] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/7.0/x86_64/ gpgcheck=0 enabled=1 EOF yum install -y mongodb-mongosh # or just …

  • FAQ

    In Module: MINIO

    SetupFAQPIGSTY

    Fail to launch multi-node / multi-driver MinIO cluster. In Multi-Driver or Multi-Node mode, MinIO will refuse to start if the data dir is not a valid mount point. Use mounted disks for MinIO data dir rather than some regular directory. You can use …

    Fail to launch multi-node / multi-driver MinIO cluster. In Multi-Driver or Multi-Node mode, MinIO will refuse to start if the data dir is not a valid mount point. Use mounted disks for MinIO data dir rather than some regular directory. You can use …

  • FAQ

    In Module: INFRA

    SetupFAQPIGSTY

    Which components are included in INFRA Ansible for automation, deployment, and administration; Nginx for exposing any WebUI service and serving the yum/apt repo; Self-Signed CA for SSL/TLS certificates; Prometheus for monitoring metrics Grafana for …

    Which components are included in INFRA Ansible for automation, deployment, and administration; Nginx for exposing any WebUI service and serving the yum/apt repo; Self-Signed CA for SSL/TLS certificates; Prometheus for monitoring metrics Grafana for …

  • FAQ

    In Module: ETCD

    SetupFAQPIGSTY

    What is the impact of ETCD failure? ETCD availability is critical for the PGSQL cluster’s HA, which is guaranteed by using multiple nodes. With a 3-node ETCD cluster, if one node is down, the other two nodes can still function normally; and with a …

    What is the impact of ETCD failure? ETCD availability is critical for the PGSQL cluster’s HA, which is guaranteed by using multiple nodes. With a 3-node ETCD cluster, if one node is down, the other two nodes can still function normally; and with a …

  • FAQ

    In Module: DOCKER

    SetupFAQPIGSTY

    How to install Docker ? Install with the docker.yml playbook, targeting at any node managed by Pigsty. ./docker.yml -l <selector>

    How to install Docker ? Install with the docker.yml playbook, targeting at any node managed by Pigsty. ./docker.yml -l <selector>

  • Access Control

    In Concept

    ConceptPIGSTYINFRAPGSQLSecurity

    Pigsty has a battery-included access control model based on Role System and Privileges. Role System Pigsty has a default role system consist of four default roles and four default users: Role name Attributes Member of Description dbrole_readonly …

    Pigsty has a battery-included access control model based on Role System and Privileges. Role System Pigsty has a default role system consist of four default roles and four default users: Role name Attributes Member of Description dbrole_readonly …

  • Security

    In Getting Started

    SetupPIGSTYSecurity

    Pigsty already provides a secure-by-default authentication and access control model, which is sufficient for most scenarios. But if you want to further strengthen the security of the system, the following suggestions are for your reference: …

    Pigsty already provides a secure-by-default authentication and access control model, which is sufficient for most scenarios. But if you want to further strengthen the security of the system, the following suggestions are for your reference: …

  • Privacy Policy

    In About Pigsty

    AboutPIGSTY

    Pigsty Software When you install the Pigsty software, if you use offline packages in a network-isolated environment, we will not receive any data about you. If you choose to install online, then when downloading relevant software packages, our …

    Pigsty Software When you install the Pigsty software, if you use offline packages in a network-isolated environment, we will not receive any data about you. If you choose to install online, then when downloading relevant software packages, our …

  • Cost Analysis

    In References

    ReferencePIGSTYCost

    Cost Reference EC2 vCPU-Month RDS vCPU-Month DHH’s self-hosted core-month price (192C 384G) 25.32 Junior open-source DBA reference salary 15K/person-month IDC self-hosted data center (exclusive physical machine: 64C384G) 19.53 Intermediate …

    Cost Reference EC2 vCPU-Month RDS vCPU-Month DHH’s self-hosted core-month price (192C 384G) 25.32 Junior open-source DBA reference salary 15K/person-month IDC self-hosted data center (exclusive physical machine: 64C384G) 19.53 Intermediate …

  • Sponsorship

    In About Pigsty

    AboutPIGSTYSponsor

    Investor Pigsty is funded by MiraclePlus (formal YC China), S22 Batch. Thanks to MiraclePlus and Dr.Qi’s support. Sponsorship Pigsty is a free & open-source software nurtured by the passion of PostgreSQL community members. If our work has helped …

    Investor Pigsty is funded by MiraclePlus (formal YC China), S22 Batch. Thanks to MiraclePlus and Dr.Qi’s support. Sponsorship Pigsty is a free & open-source software nurtured by the passion of PostgreSQL community members. If our work has helped …

  • Provisioning

    In Getting Started

    SetupAdminPIGSTYProvision

    Pigsty runs on nodes, which are Bare Metals or Virtual Machines. You can prepare them manually, or using terraform & vagrant for provisioning. Sandbox Pigsty has a sandbox, which is a 4-node deployment with fixed IP addresses and other identifiers. …

    Pigsty runs on nodes, which are Bare Metals or Virtual Machines. You can prepare them manually, or using terraform & vagrant for provisioning. Sandbox Pigsty has a sandbox, which is a 4-node deployment with fixed IP addresses and other identifiers. …

  • License

    In About Pigsty

    AboutPIGSTY

    Pigsty is open sourced under the AGPLv3 license, which is a copyleft license. Summary Pigsty use the AGPLv3 license, which is a strong copyleft license that requires you to also distribute the source code of your derivative works under the same …

    Pigsty is open sourced under the AGPLv3 license, which is a copyleft license. Summary Pigsty use the AGPLv3 license, which is a strong copyleft license that requires you to also distribute the source code of your derivative works under the same …

  • Playbooks

    In Getting Started

    SetupPlaybookPIGSTY

    Playbooks are used in Pigsty to install modules on nodes. To run playbooks, just treat them as executables. e.g. run with ./install.yml. Playbooks Here are default playbooks included in Pigsty. Playbook Function install.yml Install Pigsty on current …

    Playbooks are used in Pigsty to install modules on nodes. To run playbooks, just treat them as executables. e.g. run with ./install.yml. Playbooks Here are default playbooks included in Pigsty. Playbook Function install.yml Install Pigsty on current …

  • High Availability

    In Concept

    ConceptPIGSTYPGSQL

    Overview Primary Failure RTO ≈ 30s, RPO < 1MB, Replica Failure RTO≈0 (reset current conn) Pigsty’s PostgreSQL cluster has battery-included high-availability powered by Patroni, Etcd, and HAProxy When your have two or more instances in the PostgreSQL …

    Overview Primary Failure RTO ≈ 30s, RPO < 1MB, Replica Failure RTO≈0 (reset current conn) Pigsty’s PostgreSQL cluster has battery-included high-availability powered by Patroni, Etcd, and HAProxy When your have two or more instances in the PostgreSQL …

  • File Hierarchy

    In References

    ReferencePIGSTY

    Pigsty FHS #------------------------------------------------------------------------------ # pigsty # ^-----@app # extra demo application resources # ^-----@bin # bin scripts # ^-----@docs # document (can be docsified) # ^-----@files # ansible file …

    Pigsty FHS #------------------------------------------------------------------------------ # pigsty # ^-----@app # extra demo application resources # ^-----@bin # bin scripts # ^-----@docs # document (can be docsified) # ^-----@files # ansible file …

  • Infra as Code

    In Concept

    ConfigPIGSTY

    Infra as Code, Database as Code, Declarative API & Idempotent Playbooks, GitOPS works like a charm. Pigsty provides a declarative interface: Describe everything in a config file, and Pigsty operates it to the desired state with idempotent playbooks. …

    Infra as Code, Database as Code, Declarative API & Idempotent Playbooks, GitOPS works like a charm. Pigsty provides a declarative interface: Describe everything in a config file, and Pigsty operates it to the desired state with idempotent playbooks. …

  • Community

    In About Pigsty

    AboutPIGSTY

    The Pigsty community already offers free WeChat/Discord/Telegram Q&A Office Hours, and we are also happy to provide more free value-added services to our supporters. GitHub Our GitHub Repo: https://github.com/Vonng/pigsty , welcome to watch and star …

    The Pigsty community already offers free WeChat/Discord/Telegram Q&A Office Hours, and we are also happy to provide more free value-added services to our supporters. GitHub Our GitHub Repo: https://github.com/Vonng/pigsty , welcome to watch and star …

  • Planning

    In Getting Started

    SetupAdminPIGSTY

    Pigsty v2.7 planning starts by selecting a deployment topology and preparing the matching hosts, operating systems, network, and administrator access. Planning Checklist Choose a single-node, monitoring-only, or highly available topology from the …

    Pigsty v2.7 planning starts by selecting a deployment topology and preparing the matching hosts, operating systems, network, and administrator access. Planning Checklist Choose a single-node, monitoring-only, or highly available topology from the …

  • Event & News

    In About Pigsty

    AboutPIGSTY

    Latest Event PGCon.Dev 2024 Pigsty v2.7 Released! PostgreSQL Website: Pigsty v2.7 Released, free RDS PG with 255 extensions available Postgres Weekly: [https://postgresweekly.com/issues/556) Pigsty Blog: Pigsty v2.7: Extension Overwhelming Pigsty …

    Latest Event PGCon.Dev 2024 Pigsty v2.7 Released! PostgreSQL Website: Pigsty v2.7 Released, free RDS PG with 255 extensions available Postgres Weekly: [https://postgresweekly.com/issues/556) Pigsty Blog: Pigsty v2.7: Extension Overwhelming Pigsty …

  • Preparation

    In Getting Started

    SetupAdminPIGSTYPreparation

    Node Pigsty supports the Linux kernel and x86_64/amd64 arch, applicable to any node. A “node” refers to a resource that is SSH accessible and offers a bare OS environment, such as a physical machine, a virtual machine, or an OS container equipped …

    Node Pigsty supports the Linux kernel and x86_64/amd64 arch, applicable to any node. A “node” refers to a resource that is SSH accessible and offers a bare OS environment, such as a physical machine, a virtual machine, or an OS container equipped …

  • Parameters

    In References

    ParamReferencePIGSTY

    There are 280+ parameters in Pigsty describing all aspect of the deployment. ID Name Module Section Type Level Comment 101 version INFRA META string G pigsty version string 102 admin_ip INFRA META ip G admin node ip address 103 region INFRA META …

    There are 280+ parameters in Pigsty describing all aspect of the deployment. ID Name Module Section Type Level Comment 101 version INFRA META string G pigsty version string 102 admin_ip INFRA META ip G admin node ip address 103 region INFRA META …

  • History

    In About Pigsty

    AboutPIGSTY

    Origin Story The Pigsty project kicked off between 2018 and 2019, originating from Tantan, a dating app akin to China’s Tinder, now acquired by Momo. Tantan, a startup with a Nordic vibe, was founded by a team of Swedish engineers. Renowned for …

    Origin Story The Pigsty project kicked off between 2018 and 2019, originating from Tantan, a dating app akin to China’s Tinder, now acquired by Momo. Tantan, a startup with a Nordic vibe, was founded by a team of Swedish engineers. Renowned for …

  • Configuration

    In Getting Started

    SetupConfigPIGSTY

    Pigsty treats Infra & Database as Code. You can describe the infrastructure & database clusters through a declarative interface. All your essential work is to describe your need in the inventory, then materialize it with a simple idempotent playbook. …

    Pigsty treats Infra & Database as Code. You can describe the infrastructure & database clusters through a declarative interface. All your essential work is to describe your need in the inventory, then materialize it with a simple idempotent playbook. …

  • Roadmap

    In About Pigsty

    AboutPIGSTY

    New Features on the Radar Maintaining Deb packages for Pigsty extensions ARM architecture support for infrastructure components Adding more extensions to PostgreSQL A command-line tool that’s actually good More pre-configured scenario-based …

    New Features on the Radar Maintaining Deb packages for Pigsty extensions ARM architecture support for infrastructure components Adding more extensions to PostgreSQL A command-line tool that’s actually good More pre-configured scenario-based …

  • Offline Install

    In Getting Started

    SetupInstallPIGSTYOffline

    Pigsty’s Standard Installation process requires Internet access, but production database servers are often isolated from the Internet. Therefore, Pigsty offers an offline installation feature, allowing you to complete the installation and deployment …

    Pigsty’s Standard Installation process requires Internet access, but production database servers are often isolated from the Internet. Therefore, Pigsty offers an offline installation feature, allowing you to complete the installation and deployment …

  • Modules

    In About Pigsty

    AboutPIGSTY

    Core Modules Pigsty offers four CORE modules, which are essential for providing PostgreSQL service: PGSQL : An autonomous, highly available PostgreSQL cluster powered by Patroni, Pgbouncer, HAproxy, PgBackrest, and others. INFRA : Local software …

    Core Modules Pigsty offers four CORE modules, which are essential for providing PostgreSQL service: PGSQL : An autonomous, highly available PostgreSQL cluster powered by Patroni, Pgbouncer, HAproxy, PgBackrest, and others. INFRA : Local software …

  • Cluster Model

    In Concept

    ArchPIGSTY

    PGSQL for production environments is organized in clusters, which clusters are logical entities consisting of a set of database instances associated by primary-replica. Each database cluster is an autonomous serving unit consisting of at least one …

    PGSQL for production environments is organized in clusters, which clusters are logical entities consisting of a set of database instances associated by primary-replica. Each database cluster is an autonomous serving unit consisting of at least one …

  • Features

    In About Pigsty

    AboutPIGSTY

    “PostgreSQL In Great STYle”: Postgres, Infras, Graphics, Service, Toolbox, it’s all Yours. —— Battery-Included, Local-First PostgreSQL Distribution as an Open-Source RDS Alternative Values Extensibility: Powerful Extensions Ready for use: PostGIS, …

    “PostgreSQL In Great STYle”: Postgres, Infras, Graphics, Service, Toolbox, it’s all Yours. —— Battery-Included, Local-First PostgreSQL Distribution as an Open-Source RDS Alternative Values Extensibility: Powerful Extensions Ready for use: PostGIS, …

  • Architecture

    In Concept

    ArchConceptPIGSTY

    Modular Architecture and Declarative Interface! Pigsty deployment is described by config inventory and materialized with ansible playbooks. Pigsty works on Linux x86_64 common nodes, i.e., bare metals or virtual machines. Pigsty uses a modular …

    Modular Architecture and Declarative Interface! Pigsty deployment is described by config inventory and materialized with ansible playbooks. Pigsty works on Linux x86_64 common nodes, i.e., bare metals or virtual machines. Pigsty uses a modular …

  • Installation

    In Getting Started

    SetupInstallPIGSTY

    Install Pigsty with 4 steps: Prepare, Download, Configure and Install. Also check offline installation if you don’t have the Internet access. Short Version Prepare a fresh Linux x86_64 node that runs compatible OS, then run as a sudo-able user: curl …

    Install Pigsty with 4 steps: Prepare, Download, Configure and Install. Also check offline installation if you don’t have the Internet access. Short Version Prepare a fresh Linux x86_64 node that runs compatible OS, then run as a sudo-able user: curl …