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 | Standard HA, tolerates any one failure | |
Four-node (full) | 1 | 1 | 1+3 | Demo setup, single INFRA/ETCD | |
Production (simu) | 2 | 3 | n | n | 2 INFRA, 3 ETCD |
| 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, andmysql. 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 supplies the minimum full HA configuration. It tolerates the failure of any one node and recovers automatically.
| ID | NODE | PGSQL | INFRA | ETCD |
|---|---|---|---|---|
| 1 | node-1 | pg-meta-1 | infra-1 | etcd-1 |
| 2 | node-2 | pg-meta-2 | infra-2 | etcd-2 |
| 3 | node-3 | pg-meta-3 | infra-3 | etcd-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
If your virtualization environment or hardware resources permit it, use more nodes to deploy modules separately. Dedicated nodes can improve reliability, monitoring, and performance.
| ID | NODE | INFRA | ETCD | MINIO | PGSQL |
|---|---|---|---|---|---|
| 1 | 10.10.10.10 | infra-1 | pg-meta-1 | ||
| 2 | 10.10.10.11 | infra-2 | pg-meta-2 | ||
| 3 | 10.10.10.21 | etcd-1 | |||
| 4 | 10.10.10.22 | etcd-2 | |||
| 5 | 10.10.10.23 | etcd-3 | |||
| 6 | 10.10.10.31 | minio-1 | |||
| 7 | 10.10.10.32 | minio-2 | |||
| 8 | 10.10.10.33 | minio-3 | |||
| 9 | 10.10.10.34 | minio-4 | |||
| 10 | 10.10.10.40 | pg-src-1 | |||
| 11 | 10.10.10.41 | pg-src-2 | |||
| 12 | 10.10.10.42 | pg-src-3 | |||
| 13 | 10.10.10.50 | pg-test-1 | |||
| 14 | 10.10.10.51 | pg-test-2 | |||
| 15 | 10.10.10.52 | pg-test-3 | |||
| 16 | …… |
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)