Minimal Install
install Postgres with minimal dependencies
If you just want HA PostgreSQL it self, without monitor, infra, etc..., consider the slim installation.
There’s no INFRA
modules, No monitoring, No local repo Just ETCD
& PGSQL
and partial of NODE
Overview
To use slim installation, you need to:
Use the slim.yml
config template (configure -c slim
)
Run the slim.yml
playbook instead of install.yml
Slim installation only installs these essential components:
Component | Required | Description |
---|---|---|
patroni | REQUIRED | Bootstrap HA PostgreSQL cluster |
etcd | REQUIRED | meta database dependency (DCS) for patroni |
pgbouncer | OPTIONAL | Connection pooler for postgres |
vip-manager | OPTIONAL | L2 VIP binding to postgres cluster leader |
haproxy | OPTIONAL | Auto-routing service |
chronyd | OPTIONAL | Time synchronization with NTP server |
tuned | OPTIONAL | Node tuned template and kernel parameters management |
You can turn off the optional components, the only two required components are patroni
and etcd
.
Packages are directly installed from the Internet upstream repo, offline install is not applicable here.
Configure
Config file example: conf/slim.yml
for slim installation:
all:
children:
# actually not used, a placeholder
infra: { hosts: { 10.10.10.10: { infra_seq: 1 } } }
# etcd cluster
etcd:
hosts:
10.10.10.10: { etcd_seq: 1 }
vars:
etcd_cluster: etcd
# postgres cluster 'pg-meta' with 2 instances
pg-meta:
hosts:
10.10.10.10: { pg_seq: 1, pg_role: primary }
10.10.10.11: { pg_seq: 2, pg_role: replica }
vars:
pg_cluster: pg-meta
pg_databases: [ { name: meta ,baseline: cmdb.sql ,comment: pigsty meta database ,schemas: [pigsty] ,extensions: [{name: vector}]}]
pg_users:
- { name: dbuser_meta ,password: DBUser.Meta ,pgbouncer: true ,roles: [ dbrole_admin ] ,comment: pigsty admin user }
- { name: dbuser_view ,password: DBUser.Viewer ,pgbouncer: true ,roles: [ dbrole_readonly ] ,comment: read-only viewer for meta database }
node_crontab: [ '00 01 * * * postgres /pg/bin/pg-backup full' ] # make a full backup every 1am
vars: # global parameters
version: v3.5.0 # pigsty version string
admin_ip: 10.10.10.10 # admin node ip address
region: default # upstream mirror region: default,china,europe
node_tune: oltp # node tuning specs: oltp,olap,tiny,crit
pg_conf: oltp.yml # pgsql tuning specs: {oltp,olap,tiny,crit}.yml
# slim installation setup
nginx_enabled: false # nginx not exists
dns_enabled: false # dnsmasq not exists
prometheus_enabled: false # prometheus not exists
grafana_enabled: false # grafana not exists
pg_exporter_enabled: false # disable pg_exporter
pgbouncer_exporter_enabled: false # disable pgbouncer_exporter
pgbackrest_exporter_enabled: false # disable pgbackrest_exporter
pg_vip_enabled: false # disable pg_vip
#----------------------------------#
# Repo, Node, Packages
#----------------------------------#
node_repo_modules: node,infra,pgsql # use node_repo_modules instead of repo_modules
node_repo_remove: true # remove existing node repo for node managed by pigsty?
pg_version: 17 # default postgres version
#pg_extensions: [pg17-time ,pg17-gis ,pg17-rag ,pg17-fts ,pg17-feat ,pg17-lang ,pg17-type ,pg17-util ,pg17-func ,pg17-admin ,pg17-stat ,pg17-sec ,pg17-fdw ,pg17-sim ,pg17-etl ] #,pg17-olap]
Install
Use the slim.yml
playbook instead of the install.yml
playbook:
./slim.yml