Skip to content

Nodes

A node is an abstraction of hardware/OS resources—physical machines, bare metal, VMs, or containers/pods.

A node is an abstraction of hardware resources and operating systems. It can be a physical machine, bare metal, virtual machine, or container/pod.

Any machine running a Linux OS (with systemd daemon) and standard CPU/memory/disk/network resources can be treated as a node.

Nodes can have modules installed. Pigsty has several node types, distinguished by which modules are deployed:

Type Description
Regular Node A node managed by Pigsty
ADMIN Node The node that runs Ansible to issue management commands
INFRA Node Nodes with the INFRA module installed
ETCD Node Nodes with the ETCD module for DCS
MINIO Node Nodes with the MINIO module for object storage
PGSQL Node Nodes with the PGSQL module installed
Nodes with other modules…

In a singleton Pigsty deployment, multiple roles converge on one node: it serves as the regular node, admin node, infra node, ETCD node, and database node simultaneously.


Regular Node

Nodes managed by Pigsty can have modules installed. The node.yml playbook configures nodes to the desired state. A regular node may run the following services:

Component Port Description Status
node_exporter 9100 Host metrics exporter Enabled
haproxy 9101 HAProxy load balancer (admin port) Enabled
vector 9598 Log collection agent Enabled
docker 9323 Container runtime support Optional
keepalived n/a L2 VIP for node cluster Optional
keepalived_exporter 9650 Keepalived status monitor Optional

Here, node_exporter exposes host metrics, vector sends logs to the collection system, and haproxy provides load balancing. These three are enabled by default. Docker, keepalived, and keepalived_exporter are optional and can be enabled as needed.


ADMIN Node

A Pigsty deployment has exactly one admin node—the node that runs Ansible playbooks and issues control/deployment commands.

This node has ssh/sudo access to all other nodes. Admin node security is critical and access must be strictly controlled; see Security Model: Trust Boundaries for its trust scope and critical assets.

During single-node installation and configuration, the current node becomes the admin node. However, alternatives exist. For example, if your laptop can SSH to all managed nodes and has Ansible installed, it can serve as the admin node—though this isn’t recommended for production.

For instance, you might use your laptop to manage a Pigsty VM in the cloud. In this case, your laptop is the admin node.

In serious production environments, the admin node is typically 1-2 dedicated DBA machines. In resource-constrained setups, INFRA nodes often double as admin nodes since all INFRA nodes have Ansible installed by default.


INFRA Node

A Pigsty deployment may have 1 or more INFRA nodes; large production environments typically have 2-3.

The infra group in the inventory defines which nodes are INFRA nodes. These nodes run the INFRA module with these components:

Component Port Description
nginx 80/443 Web UI, local software repository
grafana 3000 Visualization platform
victoriaMetrics 8428 Time-series database (metrics)
victoriaLogs 9428 Log collection server
victoriaTraces 10428 Trace collection server
vmalert 8880 Alerting and derived metrics
alertmanager 9059 Alert aggregation and routing
blackbox_exporter 9115 Blackbox probing (ping nodes/VIPs)
dnsmasq 53 Internal DNS resolution
chronyd 123 NTP time server
ansible - Playbook execution

Nginx serves as the module’s entry point, providing the web UI and local software repository. With multiple INFRA nodes, services on each are independent, but you can access all monitoring data sources from any INFRA node’s Grafana.

Pigsty is licensed under Apache-2.0, though embedded Grafana component uses AGPLv3.


ETCD Node

The ETCD module provides Distributed Consensus Service (DCS) for PostgreSQL high availability.

The etcd group in the inventory defines ETCD nodes. These nodes run etcd servers on two ports:

Component Port Description
etcd 2379 ETCD key-value store (client port)
etcd 2380 ETCD cluster peer communication

MINIO Node

The MINIO module provides optional backup storage for PostgreSQL.

The minio inventory group defines MINIO module nodes. In v4.5.0, these nodes run Silo servers on:

Component Port Description
silo 9000 S3 API endpoint
silo 9001 Silo admin console

PGSQL Node

Nodes with the PGSQL module are called PGSQL nodes. Node and PostgreSQL instance have a 1:1 deployment—one PG instance per node.

PGSQL nodes can borrow identity from their PostgreSQL instance—controlled by node_id_from_pg, defaulting to true, meaning the node name is set to the PG instance name.

PGSQL nodes run these additional components beyond regular node services:

Component Port Description Status
postgres 5432 PostgreSQL database server Enabled
pgbouncer 6432 PgBouncer connection pool Enabled
patroni 8008 Patroni HA management Enabled
pg_exporter 9630 PostgreSQL metrics exporter Enabled
pgbouncer_exporter 9631 PgBouncer metrics exporter Enabled
pgbackrest_exporter 9854 pgBackRest metrics exporter Enabled
vip-manager n/a Binds L2 VIP to cluster primary Optional
{{ pg_cluster }}-primary 5433 HAProxy service: pooled read/write Enabled
{{ pg_cluster }}-replica 5434 HAProxy service: pooled read-only Enabled
{{ pg_cluster }}-default 5436 HAProxy service: primary direct connection Enabled
{{ pg_cluster }}-offline 5438 HAProxy service: offline read Enabled
{{ pg_cluster }}-<service> 543x HAProxy service: custom PostgreSQL services Custom

The vip-manager is only enabled when users configure a PG VIP. Additional custom services can be defined in pg_services, exposed via haproxy using additional service ports.


Node Relationships

Regular nodes typically reference an INFRA node via the admin_ip parameter as their infrastructure provider. For example, with global admin_ip = 10.10.10.10, all nodes use infrastructure services at this IP.

Parameters that reference ${admin_ip}:

Parameter Module Default Value Description
repo_endpoint INFRA http://${admin_ip}:80 Software repo URL
repo_upstream.baseurl INFRA http://${admin_ip}/pigsty Local repo baseurl
infra_portal.endpoint INFRA ${admin_ip}:<port> Nginx proxy backend
dns_records INFRA ["${admin_ip} i.pigsty", ...] DNS records
node_default_etc_hosts NODE ["${admin_ip} i.pigsty"] Default static DNS
node_etc_hosts NODE - Custom static DNS
node_dns_servers NODE ["${admin_ip}"] Dynamic DNS servers
node_ntp_servers NODE - NTP servers (optional)

Typically the admin node and INFRA node coincide. With multiple INFRA nodes, the admin node is usually the first one; others serve as backups.

In large-scale production deployments, you might separate the Ansible admin node from INFRA module nodes. For example, use 1-2 small dedicated hosts under the DBA team as the control hub (ADMIN nodes), and 2-3 high-spec physical machines as monitoring infrastructure (INFRA nodes).

Typical node counts by deployment scale:

Scale ADMIN INFRA ETCD MINIO PGSQL
Single-node 1 1 1 0 1
3-node 1 3 3 0 3
Small prod 1 2 3 0 N
Large prod 2 3 5 4+ N