INFRA Arch
Running production-grade, highly available PostgreSQL clusters typically requires a comprehensive set of infrastructure services (foundation) for support, such as monitoring and alerting, log collection, time synchronization, DNS resolution, and local software repositories. Pigsty provides the INFRA module to solve this problem — it’s an optional module, but we strongly recommend enabling it.
Overview
The diagram below shows the architecture of a single-node deployment. The right half represents the components included in the INFRA module:
| Component | Type | Description |
|---|---|---|
| Nginx | Web Server | Unified entry for WebUI, local repo, reverse proxy |
| CA | Certificate | Issues encryption certificates within the environment |
| Grafana | Visualization | Presents metrics, logs, and traces; hosts dashboards, reports, and custom data apps |
| VictoriaMetrics | Time Series DB | Scrapes all metrics, Prometheus API compatible, provides VMUI query interface |
| VictoriaLogs | Log Platform | Centralized log storage; all nodes run Vector by default, pushing logs here |
| VictoriaTraces | Tracing | Collects slow SQL, service traces, and other tracing data |
| VMAlert | Alert Engine | Evaluates alerting rules, pushes events to Alertmanager |
| AlertManager | Alert Manager | Aggregates alerts, dispatches notifications via email, Webhook, etc. |
| BlackboxExporter | Blackbox Probe | Probes reachability of IPs/VIPs/URLs |
| DNSMASQ | DNS Service | Provides DNS resolution for domains used within Pigsty [Optional] |
| Chronyd | Time Sync | Provides NTP time synchronization to ensure all nodes have consistent time [Optional] |
Nginx
Nginx is the access entry point for all WebUI services in Pigsty, using ports 80 / 443 for HTTP/HTTPS by default. Live Demo
Infrastructure components with WebUIs can be exposed uniformly through Nginx, such as Grafana, VictoriaMetrics (VMUI), AlertManager, and HAProxy console. Additionally, local yum/apt repo and other static resources are served internally via Nginx.
Nginx configures local web servers or reverse proxy servers based on definitions in infra_portal.
infra_portal:
home : { domain: i.pigsty }
By default, it exposes Pigsty’s admin homepage: i.pigsty. You can expose more services; see Nginx Management for details.
Pigsty allows rich customization of Nginx as a local file server or reverse proxy, with self-signed or real HTTPS certificates. For more information, see: Tutorial: Nginx—Expose Web Services via Proxy and Tutorial: Certbot—Request and Renew HTTPS Certificates
Local Software Repository
Pigsty creates a local software repository on the Infra node during installation to accelerate subsequent software installations. Live Demo
This repository defaults to the /www/pigsty directory,
served by Nginx, mounted at the /pigsty path, accessible via ports 80/443.
http://<admin_ip>/pigsty/http://i.pigsty/pigsty
Pigsty supports offline installation, which essentially pre-copies a prepared local software repository to the target environment.
When Pigsty performs production deployment and needs to create a local software repository, if it finds the /www/pigsty/repo_complete marker file already exists locally, it skips downloading packages from upstream and uses existing packages directly, avoiding internet downloads.
For more information, see: Config: INFRA - REPO
Grafana
Grafana is the core component of Pigsty’s monitoring system, used for visualizing metrics, logs, and various information. Demo
It listens on port 3000 by default, accessible via IP:3000 or http://g.pigsty.
Pigsty provides pre-built Dashboards based on VictoriaMetrics/Logs/Traces, with one-click drill-down and roll-up via URL jumps for rapid troubleshooting.
Grafana can also serve as a low-code visualization platform, so ECharts, victoriametrics-datasource, victorialogs-datasource plugins are installed by default, with Vector/Victoria datasources registered uniformly as vmetrics-*, vlogs-*, vtraces-* for easy custom dashboard extension.
For more information, see: Config: INFRA - GRAFANA.
Victoria Observability Suite
Pigsty v4.0 uses VictoriaMetrics components to replace Prometheus/Loki, providing a unified observability platform:
- VictoriaMetrics: Listens on port
8428by default, accessible viahttp://p.pigstyorhttps://i.pigsty/vmetrics/for VMUI, compatible with PromQL, remote read/write protocols, and Alertmanager API. - VMAlert: Runs alerting rules on port
8880, sends events to Alertmanager. - VictoriaLogs: Listens on port
9428by default, searchable viahttps://i.pigsty/vlogs/. Node-side Vector pushes system logs, PostgreSQL logs, etc. structured here. - VictoriaTraces: Listens on port
10428, provides Jaeger-compatible interface for slow SQL and trace analysis. - Alertmanager: Listens on port
9059, accessible viahttp://a.pigstyorhttps://i.pigsty/alertmgr/for alert routing and notification management. - Blackbox Exporter: Listens on port
9115by default, responsible for ICMP/TCP/HTTP blackbox probing.
For more information, see: Config: INFRA - VICTORIA and Config: INFRA - PROMETHEUS.
Ansible
Pigsty installs Ansible on the meta node by default. Ansible is a popular ops tool with declarative config style and idempotent playbook design, greatly reducing system maintenance complexity.
DNSMASQ
DNSMASQ provides DNS resolution within the environment; domains from other modules are registered with the DNSMASQ service on INFRA nodes.
DNS records are placed in the /etc/hosts.d/ directory on all INFRA nodes by default.
For more information, see: Config: INFRA - DNS and Tutorial: DNS—Configure Domain Resolution
Chronyd
NTP service synchronizes time across all nodes in the environment (optional).
For more information, see: Config: NODES - NTP
Others
| Endpoint | Component | Native Port | Notes | Public Demo |
|---|---|---|---|---|
/ | Nginx | 80/443 | Homepage, local repo, file server | demo.pigsty.io |
/ui/ | Grafana | 3000 | Grafana dashboard entry | demo.pigsty.io/ui/ |
/vmetrics/ | VictoriaMetrics | 8428 | Time series DB Web UI | demo.pigsty.io/vmetrics/ |
/vlogs/ | VictoriaLogs | 9428 | Log DB Web UI | demo.pigsty.io/vlogs/ |
/vtraces/ | VictoriaTraces | 10428 | Tracing Web UI | demo.pigsty.io/vtraces/ |
/vmalert/ | VMAlert | 8880 | Alert rule management | demo.pigsty.io/vmalert/ |
/alertmgr/ | AlertManager | 9059 | Alert management Web UI | demo.pigsty.io/alertmgr/ |
/blackbox/ | Blackbox | 9115 | Blackbox probe |
A standard Pigsty deployment includes an INFRA module that provides services for managed nodes and database clusters:
The INFRA module is not mandatory for HA PostgreSQL—for example, in slim install mode, the Infra module is not installed. However, the INFRA module provides essential supporting services for running production-grade HA PostgreSQL clusters; it’s strongly recommended to enable it for the complete Pigsty DBaaS experience.
If you already have your own infrastructure (Nginx, local repo, monitoring system, DNS, NTP), you can disable the INFRA module and modify config to use existing infrastructure.
| Component | Port | Default Domain | Description |
|---|---|---|---|
| Nginx | 80/443 | i.pigsty | Web portal, local repo |
| Grafana | 3000 | g.pigsty | Visualization platform |
| VictoriaMetrics | 8428 | p.pigsty | Time series DB (VMUI, Prometheus compatible) |
| VictoriaLogs | 9428 | - | Log database (receives Vector push) |
| VictoriaTraces | 10428 | - | Trace / slow SQL storage |
| VMAlert | 8880 | - | Metrics computation, alerting rules |
| AlertManager | 9059 | a.pigsty | Alert aggregation and dispatch |
| BlackboxExporter | 9115 | - | Blackbox monitoring probes |
| DNSMasq | 53 | - | DNS server |
| Chronyd | 123 | - | NTP time server |
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.

