PIGSTY

Percona

支持 TDE 的 Percona Postgres 发行版

Percona Postgres 是一个带有 pg_tde(透明数据加密)扩展的补丁 Postgres 内核。

它与 PostgreSQL 18.1 兼容,在所有 Pigsty 支持的平台上都可用。


快速开始

使用 pgtde 配置模板 安装 Pigsty。

curl -fsSL https://repo.pigsty.io/get | bash; cd ~/pigsty;
./configure -c pgtde     # 使用 percona postgres 内核
./install.yml            # 使用 pigsty 设置一切

配置

需要调整以下参数来部署 Percona 集群:

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  }
    pg_databases:
      - name: meta
        baseline: cmdb.sql
        comment: pigsty tde database
        schemas: [pigsty]
        extensions: [ vector, postgis, pg_tde ,pgaudit, { name: pg_stat_monitor, schema: monitor } ]
    pg_hba_rules:
      - { user: dbuser_view , db: all ,addr: infra ,auth: pwd ,title: 'allow grafana dashboard access cmdb from infra nodes' }
    node_crontab: [ '00 01 * * * postgres /pg/bin/pg-backup full' ] # 每天凌晨 1 点进行全量备份

    # Percona PostgreSQL TDE 临时设置
    pg_packages: [ percona-main, pgsql-common ]  # 安装 percona postgres 包
    pg_libs: 'pg_tde, pgaudit, pg_stat_statements, pg_stat_monitor, auto_explain'

扩展

Percona 提供了 80 个可用的扩展,包括 pg_tde, pgvector, postgis, pgaudit, set_user, pg_stat_monitor 等实用三方扩展。

nameversioncomment
hstore_plperlu1.0transform between hstore and plperlu
jsonb_plperl1.0transform between jsonb and plperl
intagg1.1integer aggregator and enumerator (obsolete)
pltcl1.0PL/Tcl procedural language
isn1.3data types for international product numbering standards
pgstattuple1.5show tuple-level statistics
postgis_topology-33.5.4PostGIS topology spatial types and functions
postgis_raster3.5.4PostGIS raster types and functions
tsm_system_rows1.0TABLESAMPLE method which accepts number of rows as a limit
lo1.2Large Object maintenance
hstore_plperl1.0transform between hstore and plperl
ltree1.3data type for hierarchical tree-like structures
postgis_raster-33.5.4PostGIS raster types and functions
postgis_topology3.5.4PostGIS topology spatial types and functions
pgrowlocks1.2show row-level locking information
address_standardizer_data_us-33.5.4Address Standardizer US dataset example
uuid-ossp1.1generate universally unique identifiers (UUIDs)
postgis-33.5.4PostGIS geometry and geography spatial types and functions
hstore_plpython3u1.0transform between hstore and plpython3u
postgis3.5.4PostGIS geometry and geography spatial types and functions
set_user4.2.0similar to SET ROLE but with added logging
postgis_tiger_geocoder-33.5.4PostGIS tiger geocoder and reverse geocoder
jsonb_plperlu1.0transform between jsonb and plperlu
pg_surgery1.0extension to perform surgery on a damaged relation
xml21.2XPath querying and XSLT
pg_stat_monitor2.3The pg_stat_monitor is a PostgreSQL Query Performance Monitoring tool, based on PostgreSQL contrib module pg_stat_statements. pg_stat_monitor provides aggregated statistics, client information, plan details including plan, and histogram information.
pg_tde2.1pg_tde access method
plpgsql1.0PL/pgSQL procedural language
address_standardizer-33.5.4Used to parse an address into constituent elements. Generally used to support geocoding address normalization step.
tablefunc1.0functions that manipulate whole tables, including crosstab
hstore1.8data type for storing sets of (key, value) pairs
vector0.8.1vector data type and ivfflat and hnsw access methods
postgis_tiger_geocoder3.5.4PostGIS tiger geocoder and reverse geocoder
dblink1.2connect to other PostgreSQL databases from within a database
pltclu1.0PL/TclU untrusted procedural language
pg_trgm1.6text similarity measurement and index searching based on trigrams
sslinfo1.2information about SSL certificates
pg_stat_statements1.12track planning and execution statistics of all SQL statements executed
bool_plperlu1.0transform between bool and plperlu
cube1.5data type for multidimensional cubes
ltree_plpython3u1.0transform between ltree and plpython3u
amcheck1.5functions for verifying relation integrity
postgis_sfcgal3.5.4PostGIS SFCGAL functions
plpython3u1.0PL/Python3U untrusted procedural language
tsm_system_time1.0TABLESAMPLE method which accepts time in milliseconds as a limit
intarray1.5functions, operators, and index support for 1-D arrays of integers
btree_gist1.8support for indexing common datatypes in GiST
plperlu1.0PL/PerlU untrusted procedural language
fuzzystrmatch1.2determine similarities and distance between strings
bool_plperl1.0transform between bool and plperl
btree_gin1.3support for indexing common datatypes in GIN
pg_prewarm1.2prewarm relation data
pg_repack1.5.3Reorganize tables in PostgreSQL databases with minimal locks
citext1.8data type for case-insensitive character strings
pgcrypto1.4cryptographic functions
moddatetime1.0functions for tracking last modification time
plperl1.0PL/Perl procedural language
seg1.4data type for representing line segments or floating-point intervals
earthdistance1.2calculate great-circle distances on the surface of the Earth
unaccent1.1text search dictionary that removes accents
postgres_fdw1.2foreign-data wrapper for remote PostgreSQL servers
pg_logicalinspect1.0functions to inspect logical decoding components
tcn1.0Triggered change notifications
bloom1.0bloom access method - signature file based index
dict_int1.0text search dictionary template for integers
autoinc1.0functions for autoincrementing fields
address_standardizer_data_us3.5.4Address Standardizer US dataset example
postgis_sfcgal-33.5.4PostGIS SFCGAL functions
jsonb_plpython3u1.0transform between jsonb and plpython3u
file_fdw1.0foreign-data wrapper for flat file access
pgaudit18.0provides auditing functionality
dict_xsyn1.0text search dictionary template for extended synonym processing
pg_walinspect1.1functions to inspect contents of PostgreSQL Write-Ahead Log
pg_buffercache1.6examine the shared buffer cache
refint1.0functions for implementing referential integrity (obsolete)
pg_freespacemap1.3examine the free space map (FSM)
insert_username1.0functions for tracking who changed a table
address_standardizer3.5.4Used to parse an address into constituent elements. Generally used to support geocoding address normalization step.
pg_visibility1.2examine the visibility map (VM) and page-level visibility info
pageinspect1.13inspect the contents of database pages at a low level