Planning Architecture and Nodes
Pigsty uses a modular architecture. Select the modules for your requirements and define the deployment through declarative configuration.
Common Patterns
Use these common deployment patterns as a starting point. Adjust the configuration for your requirements:
| Pattern | INFRA | ETCD | PGSQL | MINIO | Description |
|---|---|---|---|---|---|
Single-node (meta) | 1 | 1 | 1 | Single-node deployment default | |
Slim deploy (slim) | 1 | 1 | Database only, no monitoring infra | ||
Infra-only (infra) | 1 | Monitoring infrastructure only | |||
Rich deploy (rich) | 1 | 1 | 1 | 1 | Single-node + object storage + local repo with all extensions |
| Multi-node Pattern | INFRA | ETCD | PGSQL | MINIO | Description |
|---|---|---|---|---|---|
Two-node (dual) | 1 | 1 | 2 | Semi-HA, tolerates specific node failure | |
Three-node (trio) | 3 | 3 | 3 | 3 | Three-node HA, Silo EC:1 |
Four-node (full) | 1 | 1 | 1+3 | Demo setup, single INFRA/ETCD | |
Production simulation (simu) | 3 | 5 | 9 | 4 | 20 nodes, including 2 additional proxies |
| Large-scale (custom) | 3 | 5 | n | n | 3 INFRA, 5 ETCD |
Select the architecture for your reliability requirements and available resources. Production deployments with full high availability require at least 3 nodes. With 2 nodes, use the Semi-HA configuration.
Architecture Consulting Services can help you plan the Pigsty configuration.
Trade-offs
- Monitoring requires at least 1 INFRA node. Production typically uses 2 nodes; large deployments use 3.
- PostgreSQL HA requires at least 1 ETCD node. Production typically uses 3 nodes; large deployments use 5. An even-member ETCD cluster tolerates no more failures than an odd-member cluster with one fewer member. Prefer an odd number of members.
- Silo object storage requires at least 1 MINIO node. Production typically uses 4 or more nodes in an MNMD cluster.
- Production PostgreSQL clusters typically have at least two nodes: a primary and a replica. More demanding deployments use 3 nodes. Deployments with high read loads can have dozens of replicas.
- Advanced PostgreSQL configurations include offline instances, synchronous instances, standby clusters, and delayed clusters.
Single-Node Setup
The single-node configuration puts all components on one node. It installs four core modules by default. Use it for demonstrations, development, or testing.
An external S3/MinIO backup repository can supply the required recovery time and recovery point objectives (RTO/RPO). With this protection, a single-node configuration can serve standard production environments.
These single-node variants are available:
- Rich (
rich) is a production template with local Silo storage, a local software repository, and all PostgreSQL extensions. - Slim (
slim) installs PGSQL and ETCD without the monitoring infrastructure. Slim Installation can expand to multiple nodes with HA. - Infra-only (
infra) installs only INFRA to monitor other instances. It does not install database services. - Alternative kernels replace the standard PostgreSQL kernel with a derivative.
Templates include
pgsql,mssql,polar,ivory, andhalo. Other templates includepgtde,oriole,agens, andpgedge.
Two-Node Setup
The two-node configuration enables database replication and Semi-HA. It improves data redundancy and supplies limited automatic failover:
Automatic recovery depends on which node fails:
- If
node-1fails, manually promotenode-2. Automatic failover is unavailable. - If
node-2fails,node-1is automatically promoted.
Three-Node Setup
The three-node template deploys INFRA, ETCD, PGSQL, and MINIO (Silo) on every node. It tolerates one node failure when the remaining two can communicate and replica state permits failover. Silo uses a three-node, single-drive-per-node EC:1 pool. An existing single-node object store cannot be expanded directly into this topology; create a new pool and migrate objects.
| ID | NODE | PGSQL | INFRA | ETCD | MINIO |
|---|---|---|---|---|---|
| 1 | node-1 | pg-meta-1 | infra-1 | etcd-1 | minio-1 |
| 2 | node-2 | pg-meta-2 | infra-2 | etcd-2 | minio-2 |
| 3 | node-3 | pg-meta-3 | infra-3 | etcd-3 | minio-3 |
Four-Node Setup
The Pigsty Sandbox uses the standard four-node configuration.
In the demonstration configuration, INFRA and ETCD do not have HA. You can extend the configuration as follows:
| ID | NODE | PGSQL | INFRA | ETCD | MINIO |
|---|---|---|---|---|---|
| 1 | node-1 | pg-meta-1 | infra-1 | etcd-1 | minio-1 |
| 2 | node-2 | pg-test-1 | infra-2 | etcd-2 | |
| 3 | node-3 | pg-test-2 | etcd-3 | ||
| 4 | node-4 | pg-test-3 |
More Nodes
The ha/simu simulation template and vagrant/spec/simu.rb currently use 20 nodes, separating key services into groups:
| Node Group | IP Range | Count | Main Role |
|---|---|---|---|
infra / pg-meta | 10.10.10.10 to 10.10.10.12 | 3 | INFRA and metadata database cluster |
proxy | 10.10.10.18 to 10.10.10.19 | 2 | HAProxy / VIP access |
minio | 10.10.10.21 to 10.10.10.24 | 4 | Silo, four data disks per node |
etcd | 10.10.10.25 to 10.10.10.29 | 5 | ETCD, also used as Redis Sentinel test nodes |
pg-src | 10.10.10.31 to 10.10.10.33 | 3 | Source PostgreSQL cluster |
pg-dst | 10.10.10.41 to 10.10.10.43 | 3 | Destination PostgreSQL cluster |
This template simulates functionality and production topology. Size real production deployments and choose service placement according to capacity, failure domains, and dependencies.