Skip to content
Vonng edited this page Aug 31, 2024 · 25 revisions

Pigsty Wiki

Webite: pigsty.io Version: 3.0.0 License: AGPLv3 GitHub Stars Extensions: 335

Battery-Included, Local-First PostgreSQL Distribution as an Free & Better RDS Alternative!

"PostgreSQL In Great STYle": Postgres, Infras, Graphics, Service, Toolbox, it's all Yours.

Features | Website | Docs | Demo | Blog | Discuss | Roadmap | 中文站 | 专业版 | 博客 | 特性

Get Started with the latest v3.0.1 release: curl -fsSL https://repo.pigsty.io/get | bash

pigsty-desc

Features

Advantages

  • Unparalleled Extension: We packed 135 RPM and 133 DEB extensions in addition to the official PGDG repo.
  • Stunning Observability: Ultimate experience with 3000+ metrics visualized in 30+ organized dashboards.
  • Reliable Best Practices: Proven & Polished in large-scale production environment (25K vCPU) for 5 years+.
  • NO Docker/Kubernetes: We choose the hard way to deliver RDS based on bare OS WITHOUT Containers!
  • Infrastructure as Code: Describe everything with declarative API and provision with idempotent playbooks!
  • Free OSS & Local-First: Pigsty is a free software under AGPLv3. Build for PostgreSQL with passion & love.

Benefits

  • Full Control: Unleash the full power of PostgreSQL with 335+ extensions, and gain full control of your data!
  • Rest Assured: Self-healing HA from hardware failures and Point-In-Time-Recovery from human error & bugs!
  • Keen Insight: You can't manage what you can't measure. Gain penetrating insight through all-seeing panels!
  • Self-Reliant: Self-serving enterprise RDS service with all its dependencies in the absence of a dedicated DBA!
  • Anti-Entropy: Describe everything in code, minimize complexity with IaC & SOP, Administration with GitOps!
  • Get more, Pay less: No vendor lock-in, Run your own RDS to reclaim 90%+ hardware bonus from the Cloud!

Get Started

Postgres: 16.4 Linux EL Support: 7/8/9 Debian Support: 11/12 Ubuntu Support: 20/22 Alma Rocky CentOS OracleLinux

Prepare a fresh x86_64 node that runs any compatible Linux OS Distros, then Download Pigsty with:

curl -fsSL https://repo.pigsty.io/get | bash; cd ~/pigsty;

Next, bootstrap, configure, and run the install.yml playbook with an admin user (nopass ssh & sudo):

./bootstrap; ./configure; ./install.yml;

Finally, you will get a pigsty singleton node ready, with Web service on port 80/443 and Postgres on port 5432.

Install with get script
$ curl -fsSL https://repo.pigsty.io/get | bash
[v3.0.1] ===========================================
$ curl -fsSL https://repo.pigsty.io/get | bash
[Site] https://pigsty.io
[Demo] https://demo.pigsty.cc
[Repo] https://github.com/Vonng/pigsty
[Docs] https://pigsty.io/docs/setup/install
[Download] ===========================================
[ OK ] version = v3.0.1 (from default)
curl -fSL https://repo.pigsty.io/src/pigsty-v3.0.1.tgz -o /tmp/pigsty-v3.0.1.tgz
######################################################################## 100.0%
[ OK ] md5sums = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  /tmp/pigsty-v3.0.1.tgz
[Install] ===========================================
[WARN] os user = root , it's recommended to install as a sudo-able admin
[ OK ] install = /root/pigsty, from /tmp/pigsty-v3.0.1.tgz
[TodoList] ===========================================
cd /root/pigsty
./bootstrap      # [OPTIONAL] install ansible & use offline package
./configure      # [OPTIONAL] preflight-check and config generation
./install.yml    # install pigsty modules according to your config.
[Complete] ===========================================

HINT: To install a specific version, pass the version string as the first parameter:

curl -fsSL https://repo.pigsty.io/get | bash -s v3.0.1
Or clone src with git

You can also download the pigsty source with git, remember to check out a specific version tag, the main branch is for development.

git clone https://github.com/Vonng/pigsty; cd pigsty; git checkout v3.0.1

Example: Singleton Installation on RockyLinux 9.3:

asciicast


Architecture

Pigsty uses a modular design. There are 4 CORE modules available by default:

PGSQL Self-healing PostgreSQL HA cluster powered by Patroni, Pgbouncer, PgBackrest & HAProxy

INFRA Nginx, Local Repo, DNSMasq, and the entire Prometheus & Grafana observability stack.

NODE Init node name, repo, pkg, NTP, ssh, admin, tune, expose services, collect logs & metrics.

ETCD Etcd cluster is used as a reliable distributive configuration store by PostgreSQL HA Agents.

You can compose them freely in a declarative manner. INFRA & NODE will suffice for host monitoring. ETCD and PGSQL are used for HA PG clusters; Installing them on multiple nodes automatically forms HA clusters.

The default install.yml playbook will install INFRA, NODE, ETCD & PGSQL on the current node. Which gives you an out-of-the-box PostgreSQL singleton instance (admin_ip:5432) with everything ready.

pigsty-arch.jpg

The node can be used as an admin controller to deploy & monitor more nodes & clusters. For example, you can install these 4 OPTIONAL extended modules for advanced use cases:

MinIO S3-compatible object storage service; used as an optional central backup server for PGSQL.

Redis Deploy Redis servers in standalone master-replica, sentinel, and native cluster mode.

Ferret Native support for FerretDB — adding MongoDB wire protocol compatibility to Postgres!

Docker Launch optional docker daemons to run other stateless parts besides Pigsty RDS.

Of course, you can deploy different kinds of HA PostgreSQL clusters on multiple nodes, as much as you want.

Clone this wiki locally