96 lines
5.2 KiB
YAML
96 lines
5.2 KiB
YAML
---
|
|
#==============================================================#
|
|
# File : polar.yml
|
|
# Desc : Pigsty 1-node PolarDB Kernel Config Template
|
|
# Ctime : 2020-08-05
|
|
# Mtime : 2025-12-28
|
|
# Docs : https://pigsty.io/docs/conf/polar
|
|
# License : Apache-2.0 @ https://pigsty.io/docs/about/license/
|
|
# Copyright : 2018-2026 Ruohang Feng / Vonng (rh@vonng.com)
|
|
#==============================================================#
|
|
|
|
# This is the config template for PolarDB PG Kernel,
|
|
# Which is a PostgreSQL 15 fork with RAC flavor features
|
|
# tutorial: https://pigsty.io/docs/pgsql/kernel/polardb
|
|
#
|
|
# Usage:
|
|
# curl https://repo.pigsty.io/get | bash
|
|
# ./configure -c polar
|
|
# ./deploy.yml
|
|
|
|
all:
|
|
children:
|
|
infra: { hosts: { 10.10.10.10: { infra_seq: 1 }} ,vars: { repo_enabled: false }}
|
|
etcd: { hosts: { 10.10.10.10: { etcd_seq: 1 }} ,vars: { etcd_cluster: etcd }}
|
|
#minio: { hosts: { 10.10.10.10: { minio_seq: 1 }} ,vars: { minio_cluster: minio }}
|
|
|
|
#----------------------------------------------#
|
|
# PolarDB Database Cluster
|
|
#----------------------------------------------#
|
|
pg-meta:
|
|
hosts:
|
|
10.10.10.10: { pg_seq: 1, pg_role: primary }
|
|
vars:
|
|
pg_cluster: pg-meta
|
|
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 }
|
|
pg_databases:
|
|
- {name: meta ,baseline: cmdb.sql ,comment: pigsty meta database ,schemas: [pigsty]}
|
|
pg_hba_rules: # https://pigsty.io/docs/pgsql/config/hba
|
|
- { user: all ,db: all ,addr: intra ,auth: pwd ,title: 'everyone intranet access with password' ,order: 800 }
|
|
pg_crontab: # https://pigsty.io/docs/pgsql/admin/crontab
|
|
- '00 01 * * * /pg/bin/pg-backup full'
|
|
|
|
# PolarDB Ad Hoc Settings
|
|
pg_version: 15 # PolarDB PG is based on PG 15
|
|
pg_mode: polar # PolarDB PG Compatible mode
|
|
pg_packages: [ polardb, pgsql-common ] # Replace PG kernel with PolarDB kernel
|
|
pg_exporter_exclude_database: 'template0,template1,postgres,polardb_admin'
|
|
pg_default_roles: # PolarDB require replicator as superuser
|
|
- { name: dbrole_readonly ,login: false ,comment: role for global read-only access }
|
|
- { name: dbrole_offline ,login: false ,comment: role for restricted read-only access }
|
|
- { name: dbrole_readwrite ,login: false ,roles: [dbrole_readonly] ,comment: role for global read-write access }
|
|
- { name: dbrole_admin ,login: false ,roles: [pg_monitor, dbrole_readwrite] ,comment: role for object creation }
|
|
- { name: postgres ,superuser: true ,comment: system superuser }
|
|
- { name: replicator ,superuser: true ,replication: true ,roles: [pg_monitor, dbrole_readonly] ,comment: system replicator } # <- superuser is required for replication
|
|
- { name: dbuser_dba ,superuser: true ,roles: [dbrole_admin] ,pgbouncer: true ,pool_mode: session, pool_connlimit: 16 ,comment: pgsql admin user }
|
|
- { name: dbuser_monitor ,roles: [pg_monitor] ,pgbouncer: true ,parameters: {log_min_duration_statement: 1000 } ,pool_mode: session ,pool_connlimit: 8 ,comment: pgsql monitor user }
|
|
|
|
vars: # global variables
|
|
#----------------------------------------------#
|
|
# INFRA : https://pigsty.io/docs/infra/param
|
|
#----------------------------------------------#
|
|
version: v4.0.0 # pigsty version string
|
|
admin_ip: 10.10.10.10 # admin node ip address
|
|
region: default # upstream mirror region: default,china,europe
|
|
infra_portal: # infra services exposed via portal
|
|
home : { domain: i.pigsty } # default domain name
|
|
|
|
#----------------------------------------------#
|
|
# NODE : https://pigsty.io/docs/node/param
|
|
#----------------------------------------------#
|
|
nodename_overwrite: false # do not overwrite node hostname on single node mode
|
|
node_repo_modules: node,infra,pgsql # add these repos directly to the singleton node
|
|
node_tune: oltp # node tuning specs: oltp,olap,tiny,crit
|
|
|
|
#----------------------------------------------#
|
|
# PGSQL : https://pigsty.io/docs/pgsql/param
|
|
#----------------------------------------------#
|
|
pg_version: 15 # PolarDB is compatible with PG 15
|
|
pg_conf: oltp.yml # pgsql tuning specs: {oltp,olap,tiny,crit}.yml
|
|
|
|
#----------------------------------------------#
|
|
# PASSWORD : https://pigsty.io/docs/setup/security/
|
|
#----------------------------------------------#
|
|
grafana_admin_password: pigsty
|
|
grafana_view_password: DBUser.Viewer
|
|
pg_admin_password: DBUser.DBA
|
|
pg_monitor_password: DBUser.Monitor
|
|
pg_replication_password: DBUser.Replicator
|
|
patroni_password: Patroni.API
|
|
haproxy_admin_password: pigsty
|
|
minio_secret_key: S3User.MinIO
|
|
etcd_root_password: Etcd.Root
|
|
|
|
... |