关于
1 - 亮点特性
“PostgreSQL In Great STYle”: Postgres, Infras, Graphics, Service, Toolbox, it’s all Yours.
—— 开箱即用、本地优先的 PostgreSQL 发行版,开源 RDS 替代
价值主张
- 可扩展性: 强力扩展开箱即用:深度整合 PostGIS, TimescaleDB, Citus, PGVector 等 440 插件与 Oracle / SQL Server 的 兼容内核。
- 可靠性:快速创建高可用、故障自愈的 PostgreSQL 集群,自动预置的时间点恢复、访问控制、自签名 CA 与 SSL,确保数据坚如磐石。
- 可观测性: 基于 Prometheus & Grafana 现代可观测性技术栈,提供惊艳的监控最佳实践。模块化设计,可独立使用:画廊 & Demo。
- 可用性:交付稳定可靠,自动路由,事务池化、读写分离的高性能数据库服务,通过 HAProxy,Pgbouncer,VIP 提供灵活的接入模式。
- 可维护性:简单易用,基础设施即代码,管理SOP预案,自动调参,本地软件仓库,Vagrant 沙箱 与 Terraform 模板,不停机迁移方案。
- 可组合性:模块化架构设计,可复用的 Infra,多样的可选 模块:Redis, MinIO, ETCD, FerretDB, DuckDB, Docker, Supabase。

总览
Pigsty 是一个更好的本地开源 RDS for PostgreSQL 替代:
- 开箱即用的RDS:从内核到RDS发行版,在 EL/Debian/Ubuntu 下提供 13-18 版本的生产级 PG 数据库服务。
- 丰富的扩展插件:提供无可比拟的 440+ 扩展,提供开箱即用的分布式的时序地理空间图文向量多模态数据库能力。
- 灵活的模块架构:灵活组合,自由扩展:Redis/Etcd/MinIO/Mongo;可独立使用,监控现有RDS/主机/数据库。
- 惊艳的观测能力:基于现代可观测性技术栈 Prometheus/Grafana,提供令人惊艳,无可比拟的数据库观测能力。
- 验证过的可靠性:故障自愈的高可用架构:硬件故障自动切换,流量无缝衔接。并提供自动配置的 PITR 兜底删库!
- 简单易用可维护:声明式API,GitOps就位,傻瓜式操作,Database/Infra-as-Code 以及管理SOP封装管理复杂度!
- 扎实的安全实践:加密备份一应俱全,自带基础ACL最佳实践。只要硬件与密钥安全,您无需操心数据库的安全性!
- 广泛的应用场景:低代码数据应用开发,或使用预置的 Docker Compose 模板,一键拉起使用PostgreSQL的海量软件!
- 开源的自由软件:以云数据库1/10不到的成本拥有与更好的数据库服务!帮您真正“拥有”自己的数据,实现自主可控!
PostgreSQL 整合了生态中的工具与最佳实践:
- 开箱即用的 PostgreSQL 发行版,深度整合地理、时序、分布式、图、向量、搜索、AI等 440 余个扩展插件!
- 运行于裸操作系统之上,无需容器支持,支持主流操作系统: EL 8/9/10, Ubuntu 22.04/24.04 以及 Debian 12/13。
- 基于 patroni, haproxy, 与etcd,打造故障自愈的高可用架构:硬件故障自动切换,流量无缝衔接。
- 基于 pgBackRest 与可选的 MinIO 集群提供开箱即用的 PITR 时间点恢复,为软件缺陷与人为删库兜底。
- 基于 Ansible 提供声明式的 API 对复杂度进行抽象,以 Database-as-Code 的方式极大简化了日常运维管理操作。
- Pigsty用途广泛,可用作完整应用运行时,开发演示数据/可视化应用,大量使用 PG 的软件可用 Docker 模板一键拉起。
- 提供基于 Vagrant 的本地开发测试沙箱环境,与基于 Terraform 的云端自动部署方案,开发测试生产保持环境一致。
- 部署并监控专用的 Redis(主从,哨兵,集群),MinIO,Etcd,Haproxy,MongoDB (FerretDB) 集群
开箱即用的RDS
让您立刻在本地拥有生产级的PostgreSQL数据库服务!
PostgreSQL 是一个足够完美的数据库内核,但它需要更多工具与系统的配合才能成为一个足够好的数据库服务(RDS),Pigsty 帮助 PostgreSQL 完成这一步飞跃。 Pigsty 为您解决使用 PostgreSQL 中会遇到的各种难题:内核扩展安装,连接池,负载均衡,服务接入,高可用 / 自动故障切换,日志收集,指标监控,告警,备份恢复,PITR,访问控制,参数调优,安全加密,证书签发,NTP,DNS,参数调优,配置管理,CMDB,管理预案… 您无需再为这些细节烦心劳神!
Pigsty 支持 PostgreSQL 13 ~ 18 主干内核与其他兼容分支,可运行于 EL / Debian / Ubuntu 以及 兼容操作系统发行版 上,在 x86_64 与 ARM64 芯片架构上可用,且无需容器支持。 除了数据库内核与大量开箱即用的扩展插件以外,Pigsty 还提供了数据库服务所需的完整基础设施与运行时,以及本地沙箱 / 生产环境 / 云 IaaS 自动部署方案。
Pigsty 可以一键从裸机开始拉起整套环境,触达软件交付的最后一公里。普通研发运维均可快速上手并兼职进行数据库管理,无需数据库专家即可自建企业级RDS服务!
丰富的扩展插件
超融合多模态,一切皆用 PostgreSQL,一个PG替换所有数据库!
PostgreSQL 的灵魂在于其丰富的 扩展生态,而 Pigsty 独一无二地深度整合了 PostgreSQL 生态中的 440+ 扩展,为您提供开箱即用的超融合多模态数据库!
插件间可以产生协同效应,产生 1+1 远大于 2 的效果。 您可以使用 PostGIS 处理地理空间数据,使用 TimescaleDB 分析时序/事件流数据,并使用 Citus 将其原地升级为分布式地理时空数据库; 您可以用 PGVector 存储并搜索AI嵌入,用 ParadeDB 实现 ES级全文检索,并同时使用精准的 SQL,全文检索,与模糊向量进行混合检索。 您还可以通过 Hydra、 duckdb_fdw、pg_analytics、pg_duckdb 等分析扩展,实现专用 OLAP 数据库/数据湖仓的分析表现。
使用 PostgreSQL 单一组件替代 MySQL,Kafka,ElasticSearch,MongoDB,以及大数据分析技术栈已经成为一种最佳实践 —— 单一数据库选型能够显著降低系统复杂度,极大提高研发效能与敏捷性,实现程度惊人的软硬件,研发/运维人力降本增效。
灵活的模块架构
灵活组合,自由扩展,多数据库支持,监控现有RDS/主机/数据库
Pigsty 中的组件被抽象可独立部署的 模块,并可自由组合以应对多变的需求场景。INFRA 模块带有完整的现代监控技术栈,而 NODE 模块则将节点调谐至指定状态并纳管。
在多个节点上安装 PGSQL 模块会自动组建出基于主从复制的高可用数据库集群,而同样的 ETCD 模块则为数据库高可用提供共识与元数据存储。
除了上述四个 核心模块 之外,Pigsty 还提供一系列选装功能模块:MINIO 模块可以提供本地对象存储能力,并作为集中式数据库备份仓库。
REDIS 模块能以独立主从,哨兵,原生集群的方式为数据库提供辅助。DOCKER 模块可用于拉起无状态的应用软件。
此外,Pigsty 还提供 PG 兼容 / 衍生内核的支持,您可以使用 Babelfish 提供 MS SQL Server 兼容性,使用 IvorySQL 提供 Oracle 兼容性,
使用 OpenHaloDB 提供 MySQL 兼容性,使用 OrioleDB 提供极致的 OLTP 性能。
不仅如此,你还可以使用 FerretDB 提供 MongoDB 兼容性,使用 Supabase 提供 Firebase 兼容,并使用 PolarDB 满足国产化合规要求。
更多专业版/试点模块将不断引入 Pigsty,如 GPSQL,KAFKA,DUCKDB,VICTORIA,TIGERBEETLE,KUBERNETES,CONSUL,JUPYTER,GREENPLUM,CLOUDBERRY,MYSQL, …
[
惊艳的观测能力
使用现代开源可观测性技术栈,提供无与伦比的监控最佳实践!
Pigsty 提供了基于开源的 Grafana / Prometheus 现代可观测性技术栈做 监控 的最佳实践:,Grafana 负责可视化呈现,VictoriaMetrics 用于收集监控指标,VictoriaLogs 用于日志收集与查询,Alertmanager 用于告警通知。Blackbox Exporter 负责检查服务可用性。整套系统同样被设计为一键拉起,开箱即用的 INFRA 模块。
Pigsty 所管理的任何组件都会被自动纳入监控之中,包括主机节点,负载均衡 HAProxy,数据库 Postgres,连接池 Pgbouncer,元数据库 ETCD,KV缓存 Redis,对象存储 MinIO,……,以及整套监控基础设施本身。大量的 Grafana 监控面板与预置告警规则会让你的系统观测能力有质的提升,当然,这套系统也可以被复用于您的应用监控基础设施,或者监控已有的数据库实例或 RDS。
无论是故障分析还是慢查询优化、无论是水位评估还是资源规划,Pigsty 为您提供全面的数据支撑,真正做到数据驱动。在 Pigsty 中,超过三千类监控指标被用于描述整个系统的方方面面,并被进一步加工、聚合、处理、分析、提炼并以符合直觉的可视化模式呈现在您的面前。从全局大盘总览,到某个数据库实例中单个对象(表,索引,函数)的增删改查详情都能一览无余。您可以随意上卷下钻横向跳转,浏览系统现状与历史趋势,并预测未来的演变。
此外,Pigsty的监控系统模块部分还可以 独立使用 ——用它来监控现有的主机节点与数据库实例,或者是云上的 RDS 服务。只需要一个连接串一行命令,您就可以获得极致的 PostgreSQL 可观测性体验。
久经考验的可靠性
开箱即用的高可用与时间点恢复能力,确保你的数据库坚如磐石!
对于软件缺陷或人为误操作造成的删表删库,Pigsty 提供了开箱即用的 PITR 时间点恢复能力,无需额外配置即默认启用。只要存储空间管够,基于 pgBackRest 的基础备份与 WAL 归档让您拥有快速回到过去任意时间点的能力。您可以使用本地目录/磁盘,亦或专用的 MinIO 集群或 S3 对象存储服务保留更长的回溯期限,丰俭由人。
更重要的是,Pigsty 让高可用与故障自愈成为 PostgreSQL 集群的标配,基于 patroni, etcd, 与 haproxy 打造的 高可用故障自愈架构,让您在面对硬件故障时游刃有余:主库故障自动切换的 RTO < 30s(可配置),一致性优先模式下确保数据零损失 RPO = 0。只要集群中有任意实例存活,集群就可以对外提供完整的服务,而客户端只要连接至集群中的任意节点,即可获得完整的服务。
Pigsty 内置了 HAProxy 负载均衡器用于自动流量切换,提供 DNS/VIP/LVS 等多种接入方式供客户端选用。故障切换与主动切换对业务侧除零星闪断外几乎无感知,应用不需要修改连接串重启。极小的维护窗口需求带来了极大的灵活便利:您完全可以在无需应用配合的情况下滚动维护升级整个集群。硬件故障可以等到第二天再抽空善后处置的特性,让研发,运维与 DBA 都能安心睡个好觉。 许多大型组织与核心机构已经在生产环境中长时间使用 Pigsty ,最大的部署有 25K CPU 核心与 200+ PostgreSQL 超大规格实例;在这一部署案例中,六七年内经历了数十次硬件故障与各类事故,DBA 换了几茬,但依然可以保持比 99.999% 更高的可用性战绩。
简单易用可维护
Infra as Code, 数据库即代码,声明式的API将数据库管理的复杂度来封装。
Pigsty 使用声明式的接口对外提供服务,将系统的可控制性拔高到一个全新水平:用户通过配置清单告诉 Pigsty “我想要什么样的数据库集群”,而不用去操心到底需要怎样去做。从效果上讲,这类似于 K8S 中的 CRD 与 Operator,但 Pigsty 可用于任何节点上的数据库与基础设施:不论是容器,虚拟机,还是物理机。
无论是创建/销毁集群,添加/移除从库,还是新增数据库/用户/服务/扩展/黑白名单规则,您只需要修改配置清单并运行 Pigsty 提供的幂等剧本,而 Pigsty 负责将系统调整到您期望的状态。 用户无需操心配置的细节,Pigsty将自动根据机器的硬件配置进行调优,您只需要关心诸如集群叫什么名字,有几个实例放在哪几台机器上,使用什么配置模版:事务/分析/核心/微型,这些基础信息,研发也可以自助服务。但如果您愿意跳入兔子洞中,Pigsty 也提供了丰富且精细的控制参数,满足最龟毛 DBA 的苛刻定制需求。
除此之外,Pigsty 本身的安装部署也是一键傻瓜式的,所有依赖被预先打包,在安装时可以无需互联网访问。而安装所需的机器资源,也可以通过 Vagrant 或 Terraform 模板自动获取,让您在十几分钟内就可以从零在本地笔记本或云端虚拟机上拉起一套完整的 Pigsty 部署。本地沙箱环境可以跑在1核2G的微型虚拟机中,提供与生产环境完全一致的功能模拟,可以用于开发、测试、演示与学习。
扎实的安全实践
加密备份一应俱全,只要硬件与密钥安全,您无需操心数据库的安全性。
Pigsty 针对高标准,严要求的企业级场景设计,采用业界领先的 安全最佳实践 保护您的数据安全(机密性/完整性/可用性),默认配置下的安全性便足以满足绝大多数场景下的合规要求。
Pigsty 会创建自签名的 CA (或使用您提供的 CA)签发证书,加密网络通信。需要保护的敏感管理页面与API端点都受到密码保护。 数据库备份使用 AES 算法加密,数据库密码使用 scram-sha-256 算法加密,并提供插件强制执行密码强度策略。 Pigsty 提供了一套开箱即用,简单易用,便于扩展的 ACL 模型,提供读/写/管理/ETL 的权限区分,并带有遵循最小权限原则的 HBA 规则集,通过多重防护确保系统机密性。
Pigsty 默认启用数据库校验和避免静默数据腐坏,通过从库副本提供坏块兜底。提供 CRIT 数据零丢失配置模板,使用 watchdog 确保为高可用 Fencing 兜底。 您可以通过 audit 插件审计数据库操作,系统与数据库日志全部收集备查,以满足合规要求。
Pigsty 正确配置 SELinux 与防火墙配置,并遵循最小权限原则设计操作系统用户组与文件权限,确保系统安全基线符合合规要求。 而且在 Etcd,MinIO 等附属可选组件上的安全上也毫不妥协,etcd 与 minio 均使用 RBAC 模型与 TLS 加密通信,确保系统整体安全性。
合理配置的系统通过等保三级毫无问题,只要您遵循安全性最佳实践,内网部署并合理配置安全组与防火墙,数据库安全性将不再是您的痛点。
广泛的应用场景
使用预置的Docker模板,一键拉起使用PostgreSQL的海量软件!
在各类数据密集型应用中,数据库往往是最为棘手的部分。例如 Gitlab 企业版与社区版的核心区别就是底层 PostgreSQL 数据库的监控与高可用,如果您已经有了足够好的本地 PG RDS,完全可以拒绝为软件自带的土法手造数据库组件买单。
Pigsty 提供了 Docker 模块与大量开箱即用的 Compose 模板。您可以使用 Pigsty 管理的高可用 PostgreSQL (以及 Redis 与 MinIO )作为后端存储,以无状态的模式一键拉起这些软件: Gitlab、Gitea、Wiki.js、NocoDB、Odoo、Jira、Confluence、Habour、Mastodon、Discourse、KeyCloak 等等。如果您的应用需要一个靠谱的 PostgreSQL 数据库, Pigsty 也许是最简单的获取方案。
Pigsty 也提供了与 PostgreSQL 紧密联系的应用开发工具集:PGAdmin4、PGWeb、ByteBase、PostgREST、Kong、以及 EdgeDB、FerretDB、Supabase 这些使用 PostgreSQL 作为存储的"上层数据库"。 更奇妙的是,您完全可以基于 Pigsty 内置了的 Grafana 与 Postgres ,以低代码的方式快速搭建起一个交互式的数据应用来,甚至还可以使用 Pigsty 内置的 ECharts 面板创造更有表现力的交互可视化作品。
Pigsty 为您的 AI 应用提供了一个功能强大的运行时,您的 Agent 可以在这个环境中利用 PostgreSQL 与可观测性世界的强大能力,快速构建起一个数据驱动的智能体。
开源的自由软件
Pigsty是基于 Apache-2.0 开源的自由软件,由热爱 PostgreSQL 的社区成员用热情浇灌
Pigsty 是完全 开源免费 的自由软件,它允许您在缺乏数据库专家的情况下,用几乎接近纯硬件的成本来运行企业级的 PostgreSQL 数据库服务。 作为对比,数据库厂商的“企业级数据库服务”与公有云厂商提供的 RDS 会收取底层硬件资源几倍到十几倍不等的 溢价 作为 “服务费”。
很多用户选择上云,正是因为自己搞不定数据库;很多用户使用 RDS,是因为别无他选。 我们将打破云厂商的垄断,为用户提供一个云中立的,更好的 RDS 开源替代: Pigsty 紧跟 PostgreSQL 上游主干,不会有供应商锁定,不会有恼人的 “授权费”,不会有节点数量限制,不会收集您的任何数据。您的所有的核心资产 —— 数据,都能"自主可控",掌握在自己手中。
Pigsty 本身旨在用数据库自动驾驶软件,替代大量无趣的人肉数据库运维工作,但再好的软件也没法解决所有的问题。 总会有一些的冷门低频疑难杂症需要专家介入处理。这也是为什么我们也提供专业的 订阅服务,来为有需要的企业级用户使用 PostgreSQL 提供兜底。 几万块的订阅咨询费不到顶尖 DBA 每年工资的几十分之一,让您彻底免除后顾之忧,把成本真正花在刀刃上。对于社区用户,我们亦用爱发电,提供免费的支持与日常答疑。
2 - 发展规划
版本发布策略
Pigsty 使用语义化版本号,<主版本>.<次版本>.<修订号>。Alpha / Beta / RC 版本会在版本号后添加后缀,如 -a1,-b1,-c1。
主版本更新意味着不兼容的基础性变化与重大新特性;次版本更新通常表示普通功能特性更新,较小的API变动;修订版本更新意味着 Bug 修复与软件包版本更新。
Pigsty 计划每年发布一次主版本更新,次版本更新通常跟随 PostgreSQL 小版本更新节奏,在 PostgreSQL 新版本发布后最迟一个月内跟进。 Pigsty 通常每年计划 4 - 6 个小版本,完整发布历史请参考 发行注记 。
Pigsty 使用 main 主干分支进行开发,请始终使用带有版本号的 Release。
除非您清楚知道自己在做什么,否则请勿使用 GitHub 的 main 分支,总是检出特定版本使用。
列入考虑的新特性
- 一个足够好用的命令行管理工具
- 基础设施组件的 ARM 架构支持
- 为 PostgreSQL 添加更多的扩展
- 更多预置的场景化配置模板
- 将软件仓库与安装下载源完全迁移至 Cloudflare
- 使用 SealOS 部署并监控高可用 Kubernetes 集群!
- 使用 VictoriaMetrics 替换 Prometheus 存储时序数据
- 监控部署 MySQL 数据库
- 监控 Kubernetes 中的数据库
- 提供更丰富的 Docker 应用模板
- PGLite 浏览器端支持
扩展插件与软件包
关于扩展支持的路线图,可以在这里找到:https://pgext.cloud/e/roadmap
考虑纳入
- walminer
- is_jsonb_valid https://github.com/furstenheim/is_jsonb_valid
- pg_kafka https://github.com/xstevens/pg_kafka
- pg_jieba https://github.com/jaiminpan/pg_jieba
- pg_paxos https://github.com/microsoft/pg_paxos
- OneSparse https://github.com/OneSparse/OneSparse
- PipelineDB https://github.com/pipelinedb/pipelinedb
- SQL Firewall https://github.com/uptimejp/sql_firewall
- zcurve https://github.com/bmuratshin/zcurve
- PG dot net https://github.com/Brick-Abode/pldotnet/releases
- pg_scws: https://github.com/jaiminpan/pg_scws
- themsis: https://github.com/cossacklabs/pg_themis
- pgspeck https://github.com/johto/pgspeck
- lsm3 https://github.com/postgrespro/lsm3
- monq https://github.com/postgrespro/monq
- pg_badplan https://github.com/trustly/pg_badplan
- pg_recall https://github.com/mreithub/pg_recall
- pgfsm https://github.com/michelp/pgfsm
- pg_trgm pro https://github.com/postgrespro/pg_trgm_pro
- pgsql-fio: https://github.com/csimsek/pgsql-fio
暂不考虑
- pg_tier: not ready due to incomplete dep parquet_s3_fdw
- parquet_s3_fdw: not ready due to compiler version
- pg_top: not ready due to cmake error
- timestamp9: not ready due to compiler error
- pg_tier obsolete
- pg_timeseries, we already have timescaledb
- pg_quack, we already have a pg_lakehouse
- pg_telemetry, we already have better observability
- pgx_ulid, https://github.com/pksunkara/pgx_ulid, already covered by pg_idkit (MIT, but RUST)
- embedding: obsolete
- FEAT zson https://github.com/postgrespro/zson MIT C (too old)
- GIS pghydro https://github.com/pghydro/pghydro C GPL-2.0 6.6 (no makefile)
- https://github.com/Zeleo/pg_natural_sort_order (too old)
- https://github.com/postgrespro/pg_query_state
- https://github.com/no0p/pgsampler
- pg_lz4 https://github.com/zilder/pg_lz4
- pg_amqp https://github.com/omniti-labs/pg_amqp
- tinyint https://github.com/umitanuki/tinyint-postgresql
- pg_blkchain https://github.com/blkchain/pg_blkchain
- hashtypes https://github.com/pandrewhk/hashtypes
- foreign_table_exposer https://github.com/komamitsu/foreign_table_exposer
- ldap_fdw https://github.com/guedes/ldap_fdw
- pg_backtrace https://github.com/postgrespro/pg_backtrace
- connection_limits https://github.com/tvondra/connection_limits
- fixeddecimal https://github.com/2ndQuadrant/fixeddecimal
3 - 历史沿革
历史起源
Pigsty 项目始于 2018 ~ 2019 年,起源于 探探。 探探是一个互联网交友 App —— 中国的 Tinder,现已被陌陌收购。 探探这家公司是一个北欧 Style 的创业公司,有着一个瑞典工程师初创团队。
探探在技术上极有品味,使用 PostgreSQL 与 Go 作为核心技术栈。 探探整个系统架构参照了 Instagram ,一切围绕 PostgreSQL 数据库设计。 直到几百万日活,几百万 TPS,几百 TB 数据的量级下,数据组件 只用了 PostgreSQL。 几乎所有的业务逻辑都使用 PG 存储过程实现 —— 甚至包括 100ms 的推荐算法!
探探这种深度使用 PostgreSQL 特性的非典型研发模式,对工程师与DBA的水平提出了极高的要求。 而 Pigsty ,就是我们用这种真实世界的大规模,高标准数据库集群场景打磨出的开源项目 —— 沉淀着我们作为顶尖 PostgreSQL 专家的经验与最佳实践。
发展过程
在最开始,Pigsty 并没有现在这样的愿景、目标与版图。而是旨在提供一个供我们自己使用的 PostgreSQL 监控系统。 我们调研了市面上所有的方案,开源的、商业的、云的,datadog, pgwatch,…… ,没有一个能满足我们对于可观测性的需求。 因此我们决定亲自动手,基于 Grafana 与 Prometheus 自己动手打造一个,这就是 Pigsty 的前身与雏形。 Pigsty 作为监控系统的效果相当惊艳,帮助我们解决了无数管理问题。
随后,研发人员希望在本地的开发机上也有这样的监控系统,于是我们使用 Ansible 编写了置备剧本,将这套系统从一次性建设任务转变为了可重复使用,可复制的软件。 新的功能允许用户使用 Vagrant 和 Terraform,用 Infra as Code 的方式快速拉起本地 DevBox 开发机,或生产环境服务器,并自动完成 PostgreSQL 与监控系统的部署。
接下来,我们重新设计了生产环境的 PostgreSQL 架构,引入了 Patroni 与 pgBackRest 解决了数据库的 高可用 与 时间点恢复 问题。 开发了基于逻辑复制的不停机 迁移 方案,通过蓝绿部署将生产环境两百套数据库集群滚动升级至最新大版本。并将这些能力引入 Pigsty 中。
Pigsty 是我们做给自己使用的软件,我们自己作为甲方用户,非常清楚自己需要什么,也不会在自己的需求上偷懒。 “Eat dog food”最大的好处就是,我们自己既是开发者也更是用户 —— 因此非常了解自己需要什么,也不会在自己的需求上偷懒。
我们解决了一个又一个的问题,并将解决方案沉淀到 Pigsty 里。Pigsty 的定位,也从一个监控系统,逐渐发展成为一个开箱即用的 PostgreSQL 数据库发行版。 因此在这一阶段,我们决定将 Pigsty 对外开源,并开始了一系列的技术分享与宣传,也开始有各行各业的外部用户使用起 Pigsty 并提出反馈意见。
全职创业
在 2022 年,Pigsty 项目获得了由陆奇博士发起的奇绩创坛的种子轮投资,我得以全职出来做这件事情。
作为一个开源项目,Pigsty 的发展相当不赖,在全职创业这两年里,Pigsty 在 Github 上的 Star 数从的 几百翻了几番到了 3700;上了 HN 头条推荐,增长开始滚起雪球; 在 OSSRank 开源榜单 中,Pigsty 在 PostgreSQL 生态项目中排名第 22 名,在中国人主导的项目里是最靠前的。
从前 Pigsty 只能跑在 CentOS 7 上,现今已经基本覆盖了所有主流 Linux 发行版 (EL, Debian, Ubuntu)。支持的 PG 大版本覆盖 13 - 18,维护,收录整合了PG生态中的 440 扩展插件。 其中,我本人维护了这里超过一半的扩展插件,并提供开箱即用的 RPM/DEB 包,算上 Pigsty 本身,“基于开源,回馈开源”,算是为 PG 生态做一些贡献。
Pigsty 的定位,也在不断发展的过程中,从一个 PostgreSQL 数据库发行版,进一步扩展到了 开源云数据库替代。它真正对标的是云厂商的整个云数据库品牌。
公有云的反叛者
AWS、Azure、GCP、Aliyun 等公有云厂商为初创企业提供了许多便利,但它们是闭源的,并迫使用户以高额费用租赁基础资源。
我们认为,优秀的数据库服务,应该和优秀的数据库内核一样,普及到每一个用户手中,而不是必须花费高昂的代价去向赛博领主租赁。
云计算的敏捷与弹性都很好,但它应该是自由、开源、普惠、本地优先的 —— 我们认为云计算宇宙中需要一个代表开源价值观的解决方案,在不牺牲云带来好处的前提下,将基础设施的控制权交还给用户。
因此,我们也在引领着一场 下云的运动与战役,作为公有云的反叛者,来重塑这个行业的价值观。
我们的愿景
我希望,未来的世界人人都有自由使用优秀服务的事实权利,而不是只能被圈养在几个赛博领主公有云巨头厂商的地盘上当赛博佃户甚至赛博农奴。
这正是 Pigsty要做的事 —— 一个更好的,开源免费的RDS替代。让用户能够在任何地方(包括云服务器)上,一键拉起有比云RDS更好的数据库服务。
Pigsty 是是对 PostgreSQL 的彻底补完,更是对云数据库的辛辣嘲讽。它本意是“猪圈”,但更是 Postgres In Great STYle 的缩写,即“全盛状态下的 PostgreSQL”。
Pigsty 本身是一款完全开源免费的软件,我们纯粹靠提供 咨询与服务 来维持运营 建设良好的系统也许跑个几年都不会遇到需要 ”兜底“ 的问题,但数据库的问题一但出现就不是小问题。 很多时候,专家的经验更是能够一言化腐朽为神奇,而我们为有需求的客户提供这样的服务 —— 我们认为这是一种更加公正、合理、可持续的模式。
关于团队
我是冯若航,Pigsty 的作者,Pigsty 绝大部分的代码由我 一人开发,个别特性由社区贡献。
软件领域依然存在个人英雄主义,独一无二的个体才能够创造出独一无二的作品来 —— 我希望 Pigsty 能够成为这样的作品。
如果您对我感兴趣,这里是我的个人主页:https://vonng.com/
4 - 活动新闻
最近新闻
2025-11-29: Pigsty 荣获 PostgreSQL Magneto Award!
- 第八届 PostgreSQL 生态大会(杭州)
- 演讲主题:“A World-Grade Postgres Meta Distribution”、AI 数据库考量、PostgreSQL 交付最佳实践
Pigsty v3.4.1 发布! OpenHalo 与 OrioleDB 支持,MySQL 兼容性增强,pgAdmin 改进
- 发布说明:v3.4.1
Pigsty v3.4.0 发布! 备份增强,自动 Certbot 证书,Ivory 跨平台支持,AGE 扩展,APP 改进
- 发布说明:v3.4.0
Pigsty v3.3.0 发布! 404 扩展,Odoo/Dify/Supabase 应用模板,DocumentDB 支持
- 发布说明:v3.3.0
Pigsty 3.2.2 发布!
Pigsty 3.2.1 发布!
Pigsty 3.2.0 发布!
PostgreSQL 包管理器 pig 发布!
Pigsty 3.1.0 发布,提供完整的 PostgreSQL 17.2 扩展支持
- 介绍文章:《Pigsty v3.1:Supabase自建,PG17上位,MinIO改进,ARM/Ubuntu24支持》
- PostgreSQL 官方网站新闻:《Pigsty v3.1 Release: PG17, Duck Extensions, Self-hosting Supabase, ARM & Ubuntu24》
- 发布说明:v3.1.0
- Postgres Weekly 579 期:https://postgresweekly.com/issues/579
Pigsty 3.0.4 发布! 提供扩展目录与仓库,编译 PG17扩展,自建Supabase流程优化
- 发布说明:v3.0.4
Pigsty 3.0.3 发布! 提供正式的 PostgreSQL 17 支持,优化 Etcd 运维与监控
- 发布说明:v3.0.3
Pigsty 3.0.2 发布! 精简安装模式,PolarDB 15 支持,例行问题修复(2024-09-07)
- 发布说明:v3.0.2
Pigsty 3.0.1 发布!Oracle 兼容性,Patroni 4 支持,例行问题修复 (2024-08-31)
- 发布说明:v3.0.1
Pigsty 3.0.0 发布!333 个扩展,可替换内核,完整RDS服务!
- 发布说明:v3.0.0
- 特性介绍:Pigsty v3.0.0
新闻:Pigsty提供的Yum/APT补充软件仓库,提供254个额外的开箱即用的二进制RPM/DEB扩展!
Pigsty v2.7 发布!
- PostgreSQL 官方网站: Pigsty v2.7 Released, free RDS PG with 255 extensions available
- Postgres Weekly: [https://postgresweekly.com/issues/556)
- Pigsty 博客:Pigsty v2.7:集异璧之大成
Pigsty v2.6 发布!
- PostgreSQL 官方网站:Pigsty, Battery-included PostgreSQL Distro & Free RDS Alternative, v2.6 released!
- Postgres 星球(X): https://twitter.com/PostgreSQL/status/1765323952669290515
- Postgres Weekly: https://postgresweekly.com/issues/545
- Pigsty 博客:Pigsty v2.6:PG 踢馆 OLAP
The name of this project always makes me grin: PIGSTY is actually an acronym, standing for Postgres In Great STYle! It’s a Postgres distribution that includes lots of components and tools out of the box in areas like availability, deployment, and observability. The latest release pushes everything up to Postgres 16.2 standards and introduces new ParadeDB and DuckDB FDW extensions.
这个项目的名字总能让我笑开花:PIGSTY 实际上是一个首字母缩略词,代表 Postgres In Great STYle!它是一个 Postgres 发行版,包括了大量的组件和工具,涵盖了可用性、部署和可观测性等领域。最新版本将所有内容推进到了 Postgres 16.2,并引入了新的 ParadeDB 和 DuckDB FDW 扩展。
版本发布
| 版本 | 发布时间 | 摘要 | 地址 |
|---|---|---|---|
| v3.4.1 | 2025-04-05 | OpenHalo,OrioleDB,MySQL兼容性,pgAdmin改进 | v3.4.1 |
| v3.4.0 | 2025-03-30 | 备份增强,自动Certbot证书,Ivory跨平台,AGE扩展 | v3.4.0 |
| v3.3.0 | 2025-02-24 | 404扩展,Odoo/Dify/Supabase应用模板,DocumentDB支持 | v3.3.0 |
| v3.2.2 | 2025-01-23 | 390扩展,Omnigres支持,Mooncake,Citus13与PG17支持 | v3.2.2 |
| v3.2.1 | 2025-01-12 | 350扩展,Ivory4,Citus强化,Odoo模板 | v3.2.1 |
| v3.2.0 | 2024-12-24 | 扩展管理 CLI ,Grafana 强化,ARM64 扩展补完 | v3.2.0 |
| v3.1.0 | 2024-11-22 | PG 17 作为默认大版本,配置简化,Ubuntu 24 与 ARM 支持,MinIO 改进 | v3.1.0 |
| v3.0.4 | 2024-10-30 | PG 17 扩展,OLAP 全家桶,pg_duckdb | v3.0.4 |
| v3.0.3 | 2024-09-27 | PostgreSQL 17,Etcd 运维优化,IvorySQL 3.4,PostGIS 3.5 | v3.0.3 |
| v3.0.2 | 2024-09-07 | 精简安装模式,PolarDB 15支持,监控视图更新 | v3.0.2 |
| v3.0.1 | 2024-08-31 | 例行问题修复,Patroni 4支持,Oracle兼容性改进 | v3.0.1 |
| v3.0.0 | 2024-08-25 | 333个扩展插件,可插拔内核,MSSQL,Oracle,PolarDB 兼容性 | v3.0.0 |
| v2.7.0 | 2024-05-20 | 扩展大爆炸,新增20+强力扩展插件,与多款Docker应用 | v2.7.0 |
| v2.6.0 | 2024-02-28 | PG 16 作为默认大版本,引入 ParadeDB 与 DuckDB 等扩展 | v2.6.0 |
| v2.5.1 | 2023-12-01 | 例行小版本更新,PG16重要扩展支持 | v2.5.1 |
| v2.5.0 | 2023-09-24 | Ubuntu/Debian支持:bullseye, bookworm, jammy, focal | v2.5.0 |
| v2.4.1 | 2023-09-24 | Supabase/PostgresML支持与各种新扩展:graphql, jwt, pg_net, vault | v2.4.1 |
| v2.4.0 | 2023-09-14 | PG16,监控RDS,服务咨询支持,新扩展:中文分词全文检索/图/HTTP/嵌入等 | v2.4.0 |
| v2.3.1 | 2023-09-01 | 带HNSW的PGVector,PG 16 RC1, 文档翻新,中文文档,例行问题修复 | v2.3.1 |
| v2.3.0 | 2023-08-20 | 主机VIP, ferretdb, nocodb, MySQL存根, CVE修复 | v2.3.0 |
| v2.2.0 | 2023-08-04 | 仪表盘 & 置备重做,UOS 兼容性 | v2.2.0 |
| v2.1.0 | 2023-06-10 | 支持 PostgreSQL 12 ~ 16beta | v2.1.0 |
| v2.0.2 | 2023-03-31 | 新增 pgvector 支持,修复 MinIO CVE | v2.0.2 |
| v2.0.1 | 2023-03-21 | v2 错误修复,安全增强,升级 Grafana 版本 | v2.0.1 |
| v2.0.0 | 2023-02-28 | 架构大升级,兼容性、安全性、可维护性显著增强 | v2.0.0 |
| v1.5.1 | 2022-06-18 | Grafana 安全性修复 | v1.5.1 |
| v1.5.0 | 2022-05-31 | Docker 应用程序支持 | v1.5.0 |
| v1.4.1 | 2022-04-20 | 错误修复 & 英文文档完整翻译 | v1.4.1 |
| v1.4.0 | 2022-03-31 | MatrixDB 支持,分离 INFRA/NODES/PGSQL/REDIS模块 | v1.4.0 |
| v1.3.0 | 2021-11-30 | PGCAT 重整 & PGSQL 增强 & Redis Beta支持 | v1.3.0 |
| v1.2.0 | 2021-11-03 | 默认 PGSQL 版本升级至 14 | v1.2.0 |
| v1.1.0 | 2021-10-12 | 主页, JupyterLab, PGWEB, Pev2 & pgbadger | v1.1.0 |
| v1.0.0 | 2021-07-26 | v1 正式版, 监控系统重整 | v1.0.0 |
| v0.9.0 | 2021-04-04 | Pigsty 图形界面, 命令行界面, 日志集成 | v0.9.0 |
| v0.8.0 | 2021-03-28 | 服务置备,定制对外暴露的数据库服务 | v0.8.0 |
| v0.7.0 | 2021-03-01 | 仅监控部署,监控现有 PostgreSQL 实例 | v0.7.0 |
| v0.6.0 | 2021-02-19 | 架构增强,将PG与Consul解耦 | v0.6.0 |
| v0.5.0 | 2021-01-07 | 支持在配置中定义业务数据库/用户 | v0.5.0 |
| v0.4.0 | 2020-12-14 | 支持 PostgreSQL 13,添加官方文档 | v0.4.0 |
| v0.3.0 | 2020-10-22 | 虚拟机置备方案正式定稿 | v0.3.0 |
| v0.2.0 | 2020-07-10 | PG监控系统第六版正式发布 | v0.2.0 |
| v0.1.0 | 2020-06-20 | 在生产仿真测试环境中验证通过 | v0.1.0 |
| v0.0.5 | 2020-08-19 | 离线安装模式:无需互联网访问即可交付 | v0.0.5 |
| v0.0.4 | 2020-07-27 | 将 Ansible 剧本重构为 Role Refactor playbooks into ansible roles | v0.0.4 |
| v0.0.3 | 2020-06-22 | 接口设计改进 | v0.0.3 |
| v0.0.2 | 2020-04-30 | 首次提交 | v0.0.2 |
| v0.0.1 | 2019-05-15 | 概念原型 | v0.0.1 |
会议与演讲
| 日期 | 类型 | 活动 | 主题 |
|---|---|---|---|
| 2025-11-29 | 获奖&演讲 | 第八届 PostgreSQL 生态大会(杭州) | PostgreSQL Magneto Award,世界级 Postgres 元发行版 |
| 2025-05-16 | 闪电演讲 | PGConf.Dev 2025(蒙特利尔) | Extension Delivery: 让您的 PGEXT 触达用户 |
| 2025-05-12 | 主题演讲 | PGEXT.DAY, PGCon.Dev 2025 | PostgreSQL 生态中缺失的包管理器与扩展仓库 |
| 2025-04-19 | 实战工坊 | PostgreSQL 数据库技术峰会 | 使用 Pigsty 部署 PG 生态伙伴:Dify, Odoo, Supabase |
| 2025-04-11 | 直播主持 | OSCHINA 数智Talk | 刷屏的 MCP 是炒作还是革命? |
| 2025-01-15 | 直播分享 | 开源老将与新秀第四期 | PostgreSQL 扩展吞噬数据库世界?PG包管理器 pig 与自建 RDS Pigsty |
| 2025-01-09 | 颁奖典礼 | OSCHINA 2024 年度杰出贡献专家 | 年度杰出贡献专家 |
| 2025-01-06 | 圆桌论坛 | 中国 PostgreSQL 数据库生态大会 | PostgreSQL 扩展正在吞噬数据库世界 |
| 2024-11-23 | 播客 | 技术乱炖 Podcast | 来自 Linux 基金会:为什么最近都在关注"卡脖子"? |
| 2024-08-21 | 媒体专访 | 蓝色科技浪潮 | Pigsty 作者冯若航专访:简化PG管理,推动中国开源社区 |
| 2024-08-15 | 技术大会 | GOTC 全球开源技术峰会 | PostgreSQL AI/ML/RAG 扩展生态与最佳实践 |
| 2024-07-12 | 主题演讲 | 第十三届 PG 中国技术大会 | 数据库世界的未来:扩展,服务,与 Postgres |
| 2024-05-31 | 非正式会议 | PGCon.Dev 2024 全球 PG 开发者大会 Unconference | 内置 Prometheus 指标导出器 |
| 2024-05-28 | 专题研讨 | PGCon.Dev 2024 全球 PG 开发者大会 扩展峰会 | Extension in Core & Binary Packing |
| 2024-05-10 | 直播辩论 | 三人行·云计算泥石流系列 第三期 | 公有云是骗局吗? |
| 2024-04-17 | 直播辩论 | 三人行·云计算泥石流系列 第二期 | 云数据库是智商税吗? |
| 2024-04-16 | 圆桌论坛 | Cloudflare Immerse 深圳 | 赛博菩萨圆桌论坛 |
| 2024-04-12 | 技术大会 | 2024 数据技术嘉年华 | Pigsty:解决 PostgreSQL 运维难题 |
| 2024-03-31 | 直播辩论 | 三人行·云计算泥石流系列 第一期 | 罗永浩卖云,我们却在下云? |
| 2024-01-24 | 直播主持 | OSCHINA 开源漫谈 第九期 | DBA 会被云干掉吗? |
| 2023-12-20 | 直播辩论 | 开源漫谈第七期 | 上云 or 下云,割韭菜还是降本增效? |
| 2023-11-24 | 技术大会 | 大模型时代的向量数据库 | 圆桌讨论:大模型时代向量数据库新未来 |
| 2023-09-08 | 人物专访 | 墨天轮风云人物访谈 | 冯若航:不想当段子手的技术狂,不是一位好的开源创始人 |
| 2023-08-16 | 技术大会 | DTCC 2023 | DBA之夜:PostgreSQL vs MySQL的开源协议问题 |
| 2023-08-09 | 直播辩论 | 开源漫谈第一期 | MySQL vs PostgreSQL,谁是世界第一? |
| 2023-07-01 | 技术大会 | SACC 2023 | 专题研讨会8:FinOps实践:云成本管理与优化 |
| 2023-05-12 | 线下活动 | PostgreSQL中国社区 温州站线下沙龙 | PG With DB4AI: 向量数据库 PGVECTOR & AI4DB: 数据库自动驾驶 Pigsty |
| 2023-04-08 | 技术大会 | 数据库嘉年华 2023 | 更好的开源RDS替代:Pigsty |
| 2023-04-01 | 技术大会 | PostgreSQL中国社区 西安站线下沙龙 | PG高可用与容灾最佳实践 |
| 2023-03-23 | 公开直播 | Bytebase x Pigsty | 管理 PostgreSQL 的最佳实践: Bytebase x Pigsty |
| 2023-03-04 | 技术大会 | PostgreSQL中国技术大会 | 炮打 RDS,Pigsty v2.0 发布 |
| 2023-02-01 | 技术大会 | DTCC 2022 | 开源 RDS 替代:开箱即用、自动驾驶的数据库发行版 Pigsty |
| 2022-07-21 | 直播辩论 | 云吞噬开源,那开源有机会反击吗? | 云吞噬开源,那开源有机会反击吗? |
| 2022-07-04 | 人物专访 | 专题采访:创造者说 | 90 后,辞职创业,说要卷死云数据库 |
| 2022-06-28 | 公开直播 | 贝斯的圆桌趴 |DBA 福音 - | SQL 审核最佳实践 |
| 2022-06-12 | 公开路演 | 奇绩创坛 S22 路演日 | 好用省钱的数据库发行版 Pigsty |
| 2022-06-05 | 视频直播 | PG中文社区直播分享 | Pigstyv1.5快速上手新特性介绍与生产集群搭建 |
5 - 加入社区
GitHub
我们的 GitHub 仓库地址是:https://github.com/pgsty/pigsty ,欢迎点个 ⭐️ 关注 我们。
我们欢迎任何人 提交新 Issue 或创建 Pull Request,提出功能建议并参与 Pigsty 贡献。
请注意,关于 Pigsty 文档的问题,请在 github.com/Vonng/pigsty.cc 仓库中提交 Issue。
微信群组
中文区用户主要活跃于微信群组中,目前有七个活跃的群组,1群-4群已经满员,其他群需要添加小助手微信拉入。
加入微信社群,请用搜索 “Pigsty小助手”,(微信号 pigsty-cc) 备注或发送 “加群” ,小助手会将您拉入群组中。

海外社群
Telegram: https://t.me/joinchat/gV9zfZraNPM3YjFh
Discord: https://discord.gg/j5pG8qfKxU
您也可以通过邮件联系我: [email protected]
社区求助
当您使用 Pigsty 遇到问题时,可以向社区求助,您提供的信息越丰富,就越有可能在社区得到帮助。
请参考 社区求助指南 ,尽可能提供足够的信息,以便社区成员帮助您解决问题。以下是求助提问的参考模板:
发生了什么事? (必选项)
Pigsty版本号与操作系统版本 (必选项)
$ grep version pigsty.yml
$ cat /etc/os-release
$ uname -a
一些云厂商对标准操作系统发行版进行了定制,您可以告诉我们使用的是哪一家云厂商的什么操作系统镜像。 如果您在安装操作系统后对环境进行了定制与修改,或者在您的局域网中有特定的安全规则与防火墙配置,也请在提问时告知我们。
Pigsty配置文件
请不要忘记抹掉任何敏感信息:密码,内部密钥,敏感配置等。
cat ~/pigsty/pigsty.yml
你期待发生什么?
请描述正常情况下应该发生什么事情,实际发生的情况与期待的情况有何偏离?
如何复现此问题?
请尽可能详细地告诉我们复现此问题的方法与步骤。
监控截图
如果你在使用 Pigsty 提供的监控系统,可以提供 相关 的截图。
错误日志
请尽可能提供与错误有关的日志。请不要粘贴类似 “Failed to start xxx service” 之类没有信息量的内容。
您可以从 Grafana / Loki 中查询日志,或从以下位置获取日志:
- Syslog:
/var/log/messages(rhel) or/var/log/syslog(debian) - Postgres:
/pg/log/postgres/* - Patroni:
/pg/log/patroni/* - Pgbouncer:
/pg/log/pgbouncer/* - Pgbackrest:
/pg/log/pgbackrest/*
journalctl -u patroni
journalctl -u <service name>
您已经搜索过 Issue/网站/FAQ了吗?
在 FAQ 中,我们提供了许多常见问题的解答,请在提问前检查
您也可以从 Github Issue 与 Discussion 中搜索相关问题:
有什么其他信息是我们需要知道的吗?
您提供的信息与上下文越丰富,我们越有可能帮助您解决问题。
6 - 隐私政策
Pigsty软件
当您安装 Pigsty 软件时,如果在网络隔离的环境中使用离线软件包安装,我们不会收到任何关于您的数据。
如果您选择在线安装,那么在下载相关软件包时,我们的服务器或云供应商的服务器会自动在日志中记录来访机器的 IP 地址和/或主机名,和您下载的软件包名称。
除非法律要求,我们不会与其他组织共享这些信息。(实话说也是吃饱了撑着才会去看这些东西)
Pigsty 使用的主域名为:pigsty.io ,中国大陆请使用中文备案镜像站点 pigsty.cc。
Pigsty网站
当您访问我们的网站时,我们的服务器会自动在 Nginx 日志中记录您的 IP 地址和/或主机名。
仅当您决定通过完成调查或在我们的某个网站上注册为用户来向我们发送此类信息时,我们才会存储您的电子邮件地址、姓名和地点等信息
我们收集这些信息是为了帮助我们改进网站内容、定制网页布局以及出于技术和支持目的联系人员。除非法律要求,我们不会与其他组织共享您的电子邮件地址。
本网站使用 Google Analytics,这是 Google, Inc.(“Google”)提供的一项网络分析服务。谷歌分析使用“cookies”,即放置在您计算机上的文本文件,帮助网站分析用户如何使用该网站。
cookie 生成的有关您使用网站的信息(包括您的 IP 地址)将被传输至 Google 位于美国的服务器并由其存储。谷歌将使用这些信息来评估您对网站的使用情况,为网站运营商编制网站活动报告,并提供与网站活动和互联网使用相关的其他服务。 如果法律要求,或者第三方代表 Google 处理信息,Google 还可能会将此信息传输给第三方。 Google 不会将您的 IP 地址与 Google 持有的任何其他数据关联起来。 您可以通过在浏览器上选择适当的设置来拒绝使用 cookie,但请注意,如果您这样做,您可能无法使用本网站的全部功能。使用本网站即表示您同意 Google 以上述方式和目的处理有关您的数据。
如果您对此政策有任何疑问或意见,或要求删除个人数据,您可以通过发送邮件至 [email protected] 与我们联系
7 - 开源协议
协议摘要
Pigsty 项目主体使用 Apache-2.0 开源许可证;个别可选模块使用 AGPLv3 许可证;Pigsty 文档网站使用 CC by 4.0 许可证。 项目协议地址:https://github.com/pgsty/pigsty/blob/main/LICENSE
Pigsty 项目主体
Pigsty 软件主体采用 Apache License 2.0 许可证。 这是一种宽松的开源许可证,允许您自由地使用、修改和分发本软件,包括用于商业目的,而无需公开您的源代码或使用相同许可证。
| 本协议授权您 | 本协议不提供 | 本协议的条件 |
|---|---|---|
| 商用 | 商标使用权 | 包含本许可证与版权声明 |
| 修改 | 责任与担保 | 声明对原始代码的修改 |
| 分发 | ||
| 专利授权 | ||
| 私人使用 |
Pigsty 特殊模块
Pigsty 的 INFRA 模块与 MINIO 模块受到 GNU Affero General Public License v3.0 (AGPLv3) 许可证的约束。
AGPLv3 不影响普通用户的使用:使用并不是一种“发布”,您无需操心使用 Pigsty 的业务代码是否需要开源。
当您将这些模块或者对这些模块的修改作为软件/服务的全部或一部分对外“再分发”时,您才需要考虑到 AGPLv3 的约束。
| 本协议授权您 | 本协议不提供 | 本协议的条件 |
|---|---|---|
| 商用 | 商标使用权 | 包含本许可证并显著声明 |
| 修改 | 责任与担保 | 不得修改其开源状态 |
| 分发 | 公开源代码 | |
| 专利授权 | 通过网络使用属于分发的一种 | |
| 私人使用 | 使用同样的协议开源 |
考虑到如果您选择使用该模块,那么已经使用了 AGPLv3 的 Grafana 与 MinIO,这并不是什么大问题。
这两个模块都是 可选项,您可以选择不使用它们以彻底规避 AGPLv3 的要求。
下列文件与目录使用 AGPL-3.0 授权 (Grafana, MinIO 相关组件):
| 文件与目录 | 说明 |
|---|---|
roles/infra/ | 基础设施模块 (Grafana 集成) |
roles/minio/ | MinIO 对象存储模块(作为可选备份仓库) |
files/grafana/ | Grafana 监控面板定义 |
infra.yml | INFRA 模块的安装剧本 |
infra-rm.yml | INFRA 模块的卸载剧本 |
minio.yml | MinIO 模块的安装剧本 |
minio-rm.yml | MinIO 模块的卸载剧本 |
Pigsty 文档网站
Pigsty 的文档与网站(包括但不限于:pigsty.cc,pigsty.io,pgsty.com )均使用 Creative Commons Attribution 4.0 International (CC BY 4.0) 许可证。
CC BY 4.0 是一种知识共享许可证,允许您自由地分享与演绎本站的内容,但是您必须给出 适当的署名,提供指向许可证的链接,并指出是否有对原始内容进行了修改。
| 本协议授权您 | 本协议不提供 | 本协议的条件 |
|---|---|---|
| 商用 | 商标使用权 | 署名(注明原作者) |
| 修改 | 责任与担保 | 标明修改内容 |
| 分发 | 专利授权 | 提供许可证链接 |
| 私人使用 |
SBOM 清单
以下为 Pigsty 项目所使用或相关的开源软件及其开源协议。
440 个 PostgreSQL 扩展插件的许可证请参考 PostgreSQL 扩展许可证清单。
| 模块 | 软件名称 | 许可证 | 必要性,用途与说明 | 必要性 |
|---|---|---|---|---|
| PGSQL | PostgreSQL | PostgreSQL License | PostgreSQL 内核 | 必选 |
| PGSQL | patroni | MIT License | 提供 PostgreSQL 高可用能力 | 必选 |
| ETCD | etcd | Apache License 2.0 | 提供高可用共识与分布式配置存储 | 必选 |
| INFRA | Ansible | GPLv3 | 管控工具,执行剧本,发起管控命令 | 必选 |
| INFRA | Nginx | BSD-2 | 暴露Web系统界面,提供本地软件源 | 建议 |
| PGSQL | pgbackrest | MIT License | 提供 PITR 备份/恢复管理能力 | 建议 |
| PGSQL | pgbouncer | ISC License | 提供 PostgreSQL 连接池化能力 | 建议 |
| PGSQL | vip-manager | BSD 2-Clause License | 提供自动将 L2 VIP 绑定到 PG 集群主库的能力 | 建议 |
| PGSQL | pg_exporter | Apache License 2.0 | 提供监控 PostgreSQL 与 PgBouncer 的能力 | 建议 |
| NODE | node_exporter | Apache License 2.0 | 提供主机节点监控能力 | 建议 |
| NODE | haproxy | HAPROXY’s License (GPLv2) | 提供负载均衡,对外暴露服务的能力 | 建议 |
| INFRA | Grafana | AGPLv3 | 提供数据库可视化平台 | 建议 |
| INFRA | Prometheus Stack | Apache License 2.0 | 提供监控时序数据库存储,指标采集与监控告警 | 建议 |
| INFRA | Loki | AGPLv3 | 提供集中式日志收集存储查询平台 | 建议 |
| INFRA | DNSMASQ | GPLv2 / GPLv3 | 提供DNS解析服务,提供集群名查询能力 | 建议 |
| MINIO | MinIO | AGPLv3 | 提供S3兼容的对象存储服务 | 可选 |
| NODE | keepalived | MIT License | 提供绑定在节点集群上的 VIP | 可选 |
| REDIS | Redis | Redis License (BSD-3) | 搭配PG使用的缓存服务,锁死版本 7.2.6 | 可选 |
| REDIS | Redis Exporter | MIT License | 提供 Redis 监控能力 | 可选 |
| MONGO | FerretDB | Apache License 2.0 | 提供基于PG的MongoDB兼容能力 | 可选 |
| DOCKER | docker-ce | Apache License 2.0 | 提供容器管理能力 | 可选 |
| CLOUD | SealOS | Apache License 2.0 | 提供快速部署,复制,打包K8S集群的能力 | 可选 |
| DUCKDB | DuckDB | MIT | 提供简单易用的高性能分析能力 | 可选 |
| External | Vagrant | Business Source License 1.1 | 拉起本地测试环境虚拟机 | 可选 |
| External | Terraform | Business Source License 1.1 | 一键申请云资源用于部署 | 可选 |
| External | Virtualbox | GPLv2 | 虚拟机管理软件 | 可选 |
必要性等级说明:
- 必选:提供 Pigsty 关键性核心能力,不提供关闭停用选项
- 建议:Pigsty 默认启用 的组件,可以通过配置选项停用
- 可选:Pigsty 默认支持但不启用的组件,可通过配置启用
Apache-2.0 许可证原文
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright (C) 2018-2026 Ruohang Feng, @Vonng ([email protected])
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
AGPLv3 许可证原文
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C) 2018-2026 Ruohang Feng, Author of Pigsty
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.
8 - 赞助我们
赞助我们
Pigsty 是一个开源免费的自由软件,由 PostgreSQL 社区成员用热情浇灌而成,旨在整合 PostgreSQL 生态的力量,推广 PostgreSQL 的普及。 如果我们的工作帮到了您,请考虑赞助或者支持一下我们的项目:
- 直接打钱赞助我们,用最直接有力的鼓舞表达您的真挚支持!
- 考虑采购我们的技术支持服务,我们可以提供专业的 PostgreSQL 高可用集群部署与维护服务,让您的预算花得物有所值!
- 通过文章,讲座,视频分享您使用 Pigsty 的案例与经验。
- 允许我们在 “这些用户使用了Pigsty” 中提及您的组织。
- 向有需求的朋友,同事与客户提名/推荐我们的项目与服务。
- 关注我们的 微信公众号 并转发相关技术文章至群组与朋友圈。
天使投资人
Pigsty 是由 奇绩创坛 (原YC中国,MiraclePlus) S22 所投资的项目,感谢奇绩创坛与陆奇博士对本项目的支持!
赞助者
感谢我们的赞助者 Vercel,为 Pigsty 网站提供了赞助与网站托管基础设施。
9 - 行业案例
根据 Google Analytics PV 与下载量,Pigsty 目前有约 10 万用户,一半来自中国大陆,一半来自全球其他地区。 遍布互联网、云计算、金融、自动驾驶、制造业、科技创新、ISV 与军工等多个行业。 如果您在 使用 Pigsty 并且愿意与我们分享您的案例与 Logo,欢迎联系我们,我们提供一次的免费咨询支持。
互联网
探探:两百台+物理机,用于 PostgreSQL 与 Redis 服务
哔哩哔哩:用于支持 PostgreSQL 创新业务
云厂商
Bitdeer:比特小鹿,提供 PG DBaaS
Oracle OCI:使用 Pigsty 交付 PostgreSQL 集群。
金融行业
AirWallex:监控 200+ GCP PostgreSQL 数据库
影视行业
影视飓风:自建 PG RDS / Victoria Metrics
自动驾驶
Momenta:自动驾驶,管理自建 PostgreSQL 集群
制造业
华峰集团:使用 Pigsty 交付 PostgreSQL 集群作为化工时序数据仓库
科技创新
北京领雾科技:云上 PostgreSQL 下云自建
Motphys:自建 PostgreSQL 支持 Gitlab
赛陇生物科技:自建 Supabase
杭州零码科技:自建 PostgreSQL
ISV
内蒙古豪德天沐科技有限公司
上海元芳
DSG
军工
北京某部队
上海某部队
电科36所
机械工业研究所
航天一院
10 - 订阅服务
Pigsty 旨在聚集PG生态的合力,并用自动驾驶的数据库管控软件帮助用户用好世界上 最流行 的数据库 PostgreSQL。
尽管 Pigsty 本身已经解决了 PG 使用中的诸多问题。但想真正达到企业级服务的质量,原厂提供的专家支持与兜底服务不可或缺。 我们深知专业的商业支持服务对于企业客户的重要性,因此,Pigsty 企业版在开源版本的基础上提供了一系列增值服务,帮助用户更好地用好 PostgreSQL 与 Pigsty,供有需求的客户按需选用。
如果您有下列需求,欢迎考虑 Pigsty 订阅服务:
- 在关键场景中运行数据库,需要严格 SLA 保障兜底。
- 希望对 Pigsty 与 PostgreSQL 相关疑难杂症提供兜底。
- 希望获取关于 PostgreSQL / Pigsty 生产环境最佳实践的指导。
- 希望有专家帮助解读监控图表,分析定位性能瓶颈与故障根因,给出意见。
- 希望根据现有资源与业务需求,规划满足安全/容灾/合规要求的数据库架构。
- 需要将其他数据库迁移至 PostgreSQL 数据库,或对历史遗留实例迁移与改造。
- 建设基于Prometheus / Grafana 技术栈的可观测性体系,数据大盘,可视化应用。
- 希望支持国产信创操作系统/国产信创 ARM 芯片架构,提供中文/本地化界面支持。
- 下云并寻求 RDS for PostgreSQL 的开源替代 —— 云中立,无供应商锁定的解决方案。
- 希望获取关于 Redis / ETCD / MinIO,以及 TimescaleDB / Citus 等扩展的专业支持。
- 希望规避 AGPL v3 协议对衍生作品强制使用同协议开源的的限制,进行二次开发与 OEM 贴牌。
- 希望将 Pigsty 作为 SaaS / PaaS / DBaaS 对外销售,或基于此发行版提供技术服务/咨询/云服务。
订阅计划
除了 开源版 之外,Pigsty 提供两种不同的订阅服务档位:专业版 与 企业版,您可以根据自身的实际情况与需求选购。
起售价:150,000 ¥ / 年
普通用户的默认之选
许可协议:商业许可证
PG支持:17, 18
架构支持:x86_64,Arm64
OS支持:五系大小版本
- EL 8 / 9 兼容
- Debian 12
- Ubuntu 22 / 24
功能:所有模块(信创除外)
SLA:工作日时效内响应
提供专家咨询服务:
- 软件缺陷修复
- 疑难杂症分析
- 专家工单答疑
支持:每年包含 1 人天
交付:标准离线软件包
仓库:中国大陆镜像站
Pigsty开源版
Pigsty 开源版使用 AGPLv3 许可证, 提供了完整核心功能,无需任何费用,但也不承诺任何质保服务。如果您发现了 Pigsty 的缺陷,我们非常欢迎您在 Github 上提出 Issue。
如果您属于普通终端用户(即:公有云厂商,数据库厂商除外的用户),我们实际上执行更宽松的 Apache 2.0 许可证 —— 即使您对 Pigsty 进行二次开发,我们也不会对此进行追索。
针对开源版本,我们提供 PostgreSQL 18 在 EL 9.4,Debian 12.7,Ubuntu 22.04.5 三个精准操作系统发行版最新小版本上的预制标准离线软件包(作为对开源的支持,同时提供 Debian 12 的 Arm64 离线软件包)。
使用 Pigsty 开源版本,可以让初级研发工程师 / 运维工程师拥有专业 DBA 70%+ 的能力,在缺少数据库专家的情况下,也能够轻松搭建一个高可用,高性能,易维护,安全可靠的 PostgreSQL 数据库集群。
| 代号 | 操作系统发行版版本 | x86_64 | Arm64 | PG17 | PG16 | PG15 | PG14 | PG13 |
|---|---|---|---|---|---|---|---|---|
| EL9 | RHEL 9 / Rocky9 / Alma9 | el9.x86_64 | ||||||
| U22 | Ubuntu 22.04 (jammy) | u22.x86_64 | ||||||
| D12 | Debian 12 (bookworm) | d12.x86_64 | d12.aarch64 |
= 首要支持, = 选配支持
Pigsty专业版
Pigsty 专业版订阅提供了完整的功能模块,以及对于 Pigsty 本身的质保。关于 PostgreSQL 本身与扩展插件的缺陷,我们将尽最大努力通过 PostgreSQL 全球开发者社区进行反馈与修复。
Pigsty 专业版构建于开源版基础之上,完全兼容开源版本的所有功能,并提供额外的功能模块,与更为宽广的数据库 / 操作系统版本兼容选项:我们将针对五个主流操作系统发行版的 所有小版本 提供构建选项。
Pigsty 专业版包含了对 最近两个 PostgreSQL 大版本(18,17)的支持,提供两个大版本中的所有可用的扩展插件,确保您可以通过滚动升级的方式,平滑迁移到最新的 PostgreSQL 大版本上。
Pigsty 专业版订阅允许您使用中国大陆镜像站点软件仓库,无需翻墙代理即可访问;同时我们将针对您使用的精准操作系统大小版本定制离线软件安装包,确保在断网环境下也能正常安装交付,做到自主可控。
Pigsty 专业版订阅提供了标准的专家咨询服务,包括疑难杂症分析,DBA 答疑解惑,备份合规建议等,我们承诺在工作日(5x8)时效内响应您的问题,并且每年提供 1 人天支持,以及可选的人天加购选项。
Pigsty 专业版使用商业许可证,并提供书面合同承诺的 AGPLv3 开源义务豁免,即使您对 Pigsty 进行二次开发,并违反了 AGPLv3 协议没有开源,我们亦不会对此进行追索。
Pigsty 专业版的起售价格 ¥150,000 / 年,相当于 9 vCPU 的 AWS 高可用 RDS PG 年费, 或月薪 一万元 的初级运维工程师。
| 代号 | 操作系统发行版版本 | x86_64 | Arm64 | PG17 | PG16 | PG15 | PG14 | PG13 |
|---|---|---|---|---|---|---|---|---|
| EL9 | RHEL 9 / Rocky9 / Alma9 | el9.x86_64 | el9.aarch64 | |||||
| EL8 | RHEL 8 / Rocky8 / Alma8 / Anolis8 | el8.x86_64 | el8.aarch64 | |||||
| U24 | Ubuntu 24.04 (noble) | u24.x86_64 | u24.aarch64 | |||||
| U22 | Ubuntu 22.04 (jammy) | u22.x86_64 | u22.aarch64 | |||||
| D12 | Debian 12 (bookworm) | d12.x86_64 | d12.aarch64 |
Pigsty企业版
Pigsty 企业版订阅包含 Pigsty 专业版订阅提供的全部服务内容,和以下增值服务项:
Pigsty 企业版订阅提供最为广泛的数据库/操作系统版本支持范围,包括对过保操作系统(EL7, U20, D11),国产操作系统,云厂商操作系统,以及过保数据库大版本(从 PG 13 开始)的延长支持,以及对 Arm64 架构芯片的完整支持。
Pigsty 企业版订阅提供了信创,国产化解决方案,允许您在 Pigsty 中使用 PolarDB v2.0 (此内核许可需单独采购)内核替换原生 PostgreSQL 内核,以满足国产化合规要求。
Pigsty 企业版订阅提供了更高标准的企业级咨询服务,承诺 7x24 提供 (< 1h) 的响应时间 SLA,并可提供更多种类的咨询支持:版本升级,性能瓶颈定位,年度架构评估,扩展插件收录等。
Pigsty 企业版订阅每年自带 2 人天支持,以及可选的人天加购选项,用于解决各种更为棘手复杂耗时的问题。
Pigsty 企业版允许您将 Pigsty 用于 DBaaS 用途,建设云数据库服务对外出售。
Pigsty 企业版的起步价格为 ¥400,000 / 年,相当于 24 vCPU 的 AWS 高可用 RDS 年费,或月薪 三万元 的运维专家。
| 代号 | 操作系统发行版版本 | x86_64 | PG17 | PG16 | PG15 | PG14 | PG13 | PG12 | Arm64 | PG17 | PG16 | PG15 | PG14 | PG13 | PG12 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| EL9 | RHEL 9 / Rocky9 / Alma9 | el9.x86_64 | el9.arm64 | ||||||||||||
| EL8 | RHEL 8 / Rocky8 / Alma8 / Anolis8 | el8.x86_64 | el8.arm64 | ||||||||||||
| U24 | Ubuntu 24.04 (noble) | u24.x86_64 | u24.arm64 | ||||||||||||
| U22 | Ubuntu 22.04 (jammy) | u22.x86_64 | u22.arm64 | ||||||||||||
| D12 | Debian 12 (bookworm) | d12.x86_64 | d12.arm64 | ||||||||||||
| D11 | Debian 11 (bullseye) | d12.x86_64 | d11.arm64 | ||||||||||||
| U20 | Ubuntu 20.04 (focal) | d12.x86_64 | u20.arm64 | ||||||||||||
| EL7 | RHEL7 / CentOS7 / UOS … | d12.x86_64 | el7.arm64 |
Pigsty订阅说明
功能差异
Pigsty 专业版/企业版相比开源版本,包含以下额外功能:
- 命令行管理工具: 解锁 Pigsty 命令行工具(
pig)的完整功能 - 系统定制能力:针对精确的主流Linux操作系统发行版大小版本提供预制的离线安装包
- 离线安装能力:在没有互联网访问的环境中(断网环境)实现 Pigsty 的完整安装
- PG内核多版本:允许用户自由指定并安装 PostgreSQL 生命周期内大版本的内核(13 - 17)
- 内核替换能力:允许用户使用其他 PostgreSQL 系兼容内核,替换原生 PG 内核,以及离线安装这些内核的能力
- Babelfish:提供 Microsoft SQL Server 线缆协议级兼容能力
- IvorySQL:基于 PG 提供 Oracle 语法/类型/存储过程兼容能力
- PolarDB PG:提供基于开源的 PolarDB for PostgreSQL 内核支持
- PolarDB O:信创数据库,满足国产化合规要求的 Oracle 兼容内核(仅限企业版订阅)
- 扩展支持能力:针对 440 个可用 PG Extension,提供 PG 13-18 在主流操作系统上开箱即用的安装能力。
- 完整功能模块:提供所有功能模块:
- 国产操作系统支持:提供国产信创操作系统支持选项(仅限企业版订阅)
- 国产ARM架构支持:提供国产 ARM64 架构支持选项(仅限企业版订阅)
- 中国大陆镜像仓库:无需科学上网即可顺畅安装,提供境内 YUM/APT 仓库镜像与 DockerHub 访问代理。
- 中文界面支持:监控系统中文版界面支持(Beta)
付费模式
Pigsty 订阅采用按年付费的模式,签订合同后,从合同约定日起计算一年的有效期。订阅合同到期前如果继续打款则视为自动续订。 连续订阅有折扣,第一次续签(第二年)享受 95 折优惠,第二次以及后续的续签享受订阅费用 9 折优惠,一次性订阅三年以上整体费用享受 85 折优惠。
在年度订阅合同终止后,您可以选择不续签订阅服务,Pigsty 将不再提供软件更新,技术支持,咨询服务,但您仍然可以继续使用已经安装版本的 Pigsty 专业版软件。 如果您订阅了 Pigsty 专业服务并选择不续订,在重新订阅时 无需 补齐中断期间的订阅费用,但所有折扣与优惠将重置。
Pigsty 的定价策略确保用户物有所值 —— 您可以立即获得顶尖 DBA 的数据库架构建设方案与管理最佳实践,并由其提供咨询答疑与服务支持兜底; 而付出的成本相比于全职雇佣数据库专家或使用云数据库极具竞争力。以下是市场上 企业级数据库专业服务市场定价参考:
- AWS RDS for PostgreSQL 高可用版:¥1,160 ~ ¥1,582 / (vCPU·月) ,折合人民币 14K ~ 19K/年 (每vCPU)
- 阿里云 RDS for PostgreSQL 高可用版:¥270 ~ ¥432 / (vCPU·月),折合人民币 3K ~ 5K/年 (每vCPU)
- EDB PostgreSQL 云数据库企业版: $183.3 / (vCPU·月),折合人民币 16K/年 (每vCPU)
- 富士通企业级 PostgreSQL Kubernetes: $3200 / (Core·年),折合人民币 12K/年 (每vCPU)
- Oracle 年度服务费: (Enterprise $47,500 + Rac $23,000) * 22% 每年,折合人民币 28K /年 (每vCPU)
体面数据库专业服务的公允价格是 1 ~ 2 万元 / 年,计费单位为 vCPU,即一个 CPU 线程(1 Intel 核 = 2 vCPU 线程)。 而 Pigsty 提供国内顶尖的 PostgreSQL 专家服务,并采用 按节点计费 的模式,在当下常见的高核数服务器节点上,能为用户带来无可比拟的 降本增效 体验。
Pigsty专家服务
除了 Pigsty 订阅,Pigsty 还提供按需采购的 Pigsty x PostgreSQL 专家服务 —— 业界顶级数据库专家坐堂问诊。
在三年内,提供 10 次关于 PostgreSQL 与 Pigsty 的复杂案例处理,以及不限量答疑。
业界顶级专家现场支持,可用于架构咨询,故障分析,问题排查,数据库体检,监控解读,迁移评估,教学培训,上下云参谋等连续耗时场景。
咨询任何您想要了解的问题,关于 Pigsty, PostgreSQL,数据库,云计算,AI…… 数据库老司机,云计算泥石流与您分享行业顶级洞察、认知与研判。
给出一个关于 PostgreSQL / Pigsty / 数据库相关的问题的快速诊断意见与答复,不超过 5 分钟。
联系方式
请发送邮件至 [email protected] 。中国大陆地区用户欢迎添加微信号 RuohangFeng。
11 - 常见问题
Pigsty 是什么,不是什么?
Pigsty 是一个 PostgreSQL 数据库发行版,本地优先的开源 RDS 云数据库解决方案。 Pigsty 不是数据库管理系统(DBMS),而是管理 DBMS 的工具,发行版,解决方案,与最佳实践。
类比:数据库是车,那么 DBA 是司机,RDS 是出租车服务,Pigsty 则是自动驾驶软件。
Pigsty 解决什么问题?
用好数据库的能力 极为稀缺:要么高薪聘请数据库专家自建(雇司机),或从云厂商以天价租赁 RDS(打车),但现在你有新的选项:Pigsty(自动驾驶)。 Pigsty 帮用户用好数据库:让用户在没有 DBA 的情况下,以不到 RDS 1 / 10 的成本,自建质量效率更优的本地云数据库服务!
Pigsty 的目标用户是谁?
Pigsty 有两类典型目标用户,基本盘是 中大型公司 超大规模自建企业级/生产级 PostgreSQL RDS / DBaaS 服务。 Pigsty 通过极致的可定制性,可以实现最苛刻场景的数据库管理需求,并提供企业级的支持与服务保障。
与此同时,Pigsty 也针对个人开发者,缺乏 DBA 中小企业以及开源社区提供 “开箱即用” 的 PG RDS 自建方案。
Pigsty 为什么能帮您用好数据库?
Pigsty 沉淀了顶尖专家在最复杂,最大规模的甲方 PostgreSQL 场景中打磨得到的经验与最佳实践,产品化为可复制的软件: 一次性解决扩展安装,高可用,链接池,监控,备份恢复,参数优化,IaC 批量管理,一键安装,自动化运维等诸多问题。提前规避诸多陷阱,避免重复踩坑。
Pigsty 为何比 RDS 好用?
Pigsty 提供远超 RDS 的特性集与基础设施支持,包括 440 扩展插件与 8+ 内核支持。 Pigsty 提供 PG 生态中独一无二的专业级监控系统,与久经复杂场景打磨考验的架构最佳实践,简单易用。
且用探探,苹果,阿里等顶级甲方场景打磨而成,用激情与热爱持续浇灌,深度与成熟度绝非 RDS 大锅饭可比。
Pigsty 为何比 RDS 省钱?
Pigsty 允许您使用 10 ¥/核·月的纯硬件资源,运行 400¥-1400¥/核·月的 RDS 云数据库,并省去 DBA 的工资。通常,成规模的 Pigsty 部署总拥有成本(TCO)能比 RDS 低 90% 以上。
Pigsty 能够同时降低软件许可/服务/人力的开销,自建无需加人,让您将成本花在刀刃上。
Pigsty 对研发有什么帮助?
Pigsty 整合了 PG 生态最全的扩展(440),提供了 All in PG 解决方案:单一组件替代 Redis, Kafka, MySQL, ES, 向量数据库, OLAP / 大数据分析等专用组件。
极大提高研发效能与敏捷性的同时降低复杂度成本,而且研发能在 Pigsty 的加持下实现自助管理,自主 DevOps,无需 DBA。
Pigsty 对运维有什么帮助?
Pigsty 故障自愈的高可用架构确保硬件故障无需当场处理,让运维与 DBA 睡个好觉;监控助力问题分析与性能优化;IaC 赋能超大规模集群自动化管理。
运维在 Pigsty 加持下能兼职 DBA ,而 DBA 则可以跳过系统建设阶段,节省大量工时并专注于高价值工作,或喝茶看报,学习PG。
Pigsty 的作者是谁?
Pigsty 主体由冯若航一人开发,这是一位专注于 PostgreSQL 领域 10 年的开源贡献者,数据库专家与布道师, 曾任职于阿里,探探,苹果,全栈专家。现为一人公司创始人,提供专业咨询服务。
同时他也是技术 KOL,微信数据库个人公众号榜首 《非法加冯》 的主理人,全网粉丝六万+。
Pigsty 的生态位与影响力如何?
Pigsty 全球 PostgreSQL 生态中最有影响力的中国开源项目,共有约十万用户,一半来自海外。 Pigsty 也是 PostgreSQL 生态最活跃的开源项目之一,目前在扩展分发与监控系统上占据碾压性优势。
PGEXT.Cloud 是由 Pigsty 维护的 PostgreSQL 扩展仓库,拥有全球最多的 PostgreSQL 扩展分发量。 目前已经成为多家国际 PostgreSQL 厂商的软件供应链上游。
Pigsty 目前是 PostgreSQL 生态的主要发行版之一,也是云厂商 RDS 的挑战者,目前已经广泛应用于军工,政企,医疗,互联网,金融,制造业等各个行业。
Pigsty 适合什么规模的客户?
Pigsty 源于超大规模 PostgreSQL 自动化管理的需求,但已针对易用性进行深度优化,缺乏专业 DBA 能力的个人开发者与中小型企业也可以轻松上手使用。
最大规模部署为 25K vCPU,450万QPS,六年+,最小规模部署可完整运行于 1c1g 虚拟机上作为 Demo / Devbox 使用。
Pigsty 提供哪些能力?
Pigsty 专注于整合 PostgreSQL 生态,提供 PostgreSQL 的最佳实践,但同时也支持一系列与 PostgreSQL 配合良好的开源软件。例如:
- Etcd, Redis, MinIO, DuckDB, Prometheus
- FerretDB, Babelfish, IvorySQL, PolarDB, OrioleDB
- OpenHalo, Supabase, Greenplum, Dify, Odoo, …
Pigsty 适用于哪些场景?
- 运行大规模 PostgreSQL 集群用于业务
- 自建 RDS,对象存储,缓存,数仓,Supabase, …
- 自建 Odoo,Dify,Wiki,GitLab 等企业级应用
- 运行监控基础设施,监控现有数据库与主机
- 同时组合使用多种 PG 扩展插件
- 大屏开发与交互式数据应用 Demo,数据可视化,Web 建站
Pigsty 开源免费吗?
Pigsty 是 100% 的开源软件 + 自由软件,在遵循开源许可证的前提下,您可以将其免费地,自由的用于各种商业目的。
我们珍视软件自由,对于非 DBaaS / OEM 用例,我们执行更为宽松的等效 Apache 2.0 许可证。请参阅许可证以获取更多详细信息。
Pigsty 提供商业支持吗?
Pigsty 软件本身开源免费,并提供丰俭由人的商业订阅,为 Pigsty & PostgreSQL 提供质保。 订阅提供更宽广的 OS/PG/芯片架构支持范围,以及专家咨询与支持。 Pigsty 商业订阅交付业界顶尖的管理/技术经验/解决方案, 帮助您节省宝贵的时间,替您扛雷,并为疑难杂症兜底。
Pigsty 支持国产信创吗?
Pigsty 软件本身不属于数据库,不受信创名录限制,且已有多个部队用例。但 Pigsty 开源版不提供任何形式的信创支持。 商业版订阅提供与阿里云合作的国产信创解决方案,支持使用具有信创资质的 PolarDB-O(需单独采购)作为 RDS 内核,能够运行于信创操作系统/芯片环境。
Pigsty 可以作为多租户 DBaaS 运行吗?
如果您使用了 Pigsty Infra 模块,并将其作为公有云数据库服务(DBaaS)的一部分进行分发或运营, 您可以在遵循开源许可证的前提下将其用于此目的。
如果您使用了 AGPLv3 许可证的模块,则额外受此约束。 我们保留对 公有云/数据库厂商 违反 AGPLv3 许可证进行追责的权利。 如果您不希望开源衍生作品,建议您选购 Pigsty 企业版订阅计划, 提供对此用例的清晰授权以及对于 Pigsty 可选 AGPLv3 模块开源义务的豁免。
Pigsty 可以换 Logo 贴牌为自己的产品吗?
再分发 Pigsty 时,您必须保留原作品中的版权声明、专利声明、商标声明和归属声明, 并且需要在修改的文件中附上显著的变更说明,同时保留 LICENSE 文件的内容。 在此前提下,您可以更换 PIGSTY 的 Logo 与商标,但不得宣传为 “自己原创的作品”。 我们在企业版本中提供对 OEM 与贴牌的商业授权支持。
Pigsty 的服务主体
Pigsty 是奇绩创坛 S22 被投项目,原主体 磐吉云数(北京)科技有限责任公司 已经清算剥离 Pigsty 业务,与 Pigsty 无关。
Pigsty 目前由作者冯若航个人独资运营维护,商业主体为:
- 海南诸夏云数据有限公司 / 91460000MAE6L87B94
- 海口龙华辟技数据中心 / 92460000MAG0XJ569B
- 海口龙华越航科技中心 / 92460000MACCYGBQ1N
PIGSTY® 与 PGSTY® 为海口龙华越航科技中心的注册商标。
12 - 发布注记
Pigsty 当前的最新稳定版本为 v3.7.0,最新的测试版本为 v4.0.0-b3。
| 版本 | 发布日期 | 摘要 | 发布页面 |
|---|---|---|---|
| v4.0.0 | 2026-01-07 | Infra 重构,安全加固,快速克隆,Agent 能力 | v4.0.0 |
| v3.7.0 | 2025-12-02 | PG18 成为默认,437 个扩展,EL10 与 Debian13 支持,PGEXT.CLOUD | v3.7.0 |
| v3.6.1 | 2025-08-15 | 例行 PG 小版本更新,PGDG 中国区域镜像,EL9,D13 存根 | v3.6.0 |
| v3.6.0 | 2025-07-30 | pgactive,MinIO / ETCD 改进,安装简化,配置梳理 | v3.6.0 |
| v3.5.0 | 2025-06-16 | PG18 beta,421 扩展,监控升级,代码重构 | v3.5.0 |
| v3.4.1 | 2025-04-05 | OpenHalo & OrioleDB,MySQL兼容,pgAdmin改进 | v3.4.1 |
| v3.4.0 | 2025-03-30 | 备份改进,自动证书,AGE,Ivory 全平台,本地化,架构与参数改进 | v3.4.0 |
| v3.3.0 | 2025-02-24 | 404 扩展,扩展目录,App 剧本,Nginx 定制,DocumentDB 支持 | v3.3.0 |
| v3.2.2 | 2025-01-23 | 390扩展,Omnigres支持,Mooncake,Citus13与PG17支持 | v3.2.2 |
| v3.2.1 | 2025-01-12 | 350扩展,Ivory4,Citus强化,Odoo模板 | v3.2.1 |
| v3.2.0 | 2024-12-24 | 扩展管理 CLI ,Grafana 强化,ARM64 扩展补完 | v3.2.0 |
| v3.1.0 | 2024-11-24 | PG 17 升默认大版本,配置简化,Ubuntu24与ARM 支持,Supabase,MinIO 改进 | v3.1.0 |
| v3.0.4 | 2024-10-30 | PG 17 扩展,OLAP 全家桶,pg_duckdb | v3.0.4 |
| v3.0.3 | 2024-09-27 | PostgreSQL 17,Etcd 运维优化,IvorySQL 3.4,PostGIS 3.5 | v3.0.3 |
| v3.0.2 | 2024-09-07 | 精简安装模式,PolarDB 15支持,监控视图更新 | v3.0.2 |
| v3.0.1 | 2024-08-31 | 例行问题修复,Patroni 4支持,Oracle兼容性改进 | v3.0.1 |
| v3.0.0 | 2024-08-25 | 333个扩展插件,可插拔内核,MSSQL,Oracle,PolarDB 兼容性 | v3.0.0 |
| v2.7.0 | 2024-05-20 | 扩展大爆炸,新增20+强力扩展插件,与多款Docker应用 | v2.7.0 |
| v2.6.0 | 2024-02-28 | PG 16 作为默认大版本,引入 ParadeDB 与 DuckDB 等扩展 | v2.6.0 |
| v2.5.1 | 2023-12-01 | 例行小版本更新,PG16重要扩展支持 | v2.5.1 |
| v2.5.0 | 2023-09-24 | Ubuntu/Debian支持:bullseye, bookworm, jammy, focal | v2.5.0 |
| v2.4.1 | 2023-09-24 | Supabase/PostgresML支持与各种新扩展:graphql, jwt, pg_net, vault | v2.4.1 |
| v2.4.0 | 2023-09-14 | PG16,监控RDS,服务咨询支持,新扩展:中文分词全文检索/图/HTTP/嵌入等 | v2.4.0 |
| v2.3.1 | 2023-09-01 | 带HNSW的PGVector,PG 16 RC1, 文档翻新,中文文档,例行问题修复 | v2.3.1 |
| v2.3.0 | 2023-08-20 | 主机VIP, ferretdb, nocodb, MySQL存根, CVE修复 | v2.3.0 |
| v2.2.0 | 2023-08-04 | 仪表盘 & 置备重做,UOS 兼容性 | v2.2.0 |
| v2.1.0 | 2023-06-10 | 支持 PostgreSQL 12 ~ 16beta | v2.1.0 |
| v2.0.2 | 2023-03-31 | 新增 pgvector 支持,修复 MinIO CVE | v2.0.2 |
| v2.0.1 | 2023-03-21 | v2 错误修复,安全增强,升级 Grafana 版本 | v2.0.1 |
| v2.0.0 | 2023-02-28 | 架构大升级,兼容性、安全性、可维护性显著增强 | v2.0.0 |
| v1.5.1 | 2022-06-18 | Grafana 安全性修复 | v1.5.1 |
| v1.5.0 | 2022-05-31 | Docker 应用程序支持 | v1.5.0 |
| v1.4.1 | 2022-04-20 | 错误修复 & 英文文档完整翻译 | v1.4.1 |
| v1.4.0 | 2022-03-31 | MatrixDB 支持,分离 INFRA/NODES/PGSQL/REDIS模块 | v1.4.0 |
| v1.3.0 | 2021-11-30 | PGCAT 重整 & PGSQL 增强 & Redis Beta支持 | v1.3.0 |
| v1.2.0 | 2021-11-03 | 默认 PGSQL 版本升级至 14 | v1.2.0 |
| v1.1.0 | 2021-10-12 | 主页, JupyterLab, PGWEB, Pev2 & pgbadger | v1.1.0 |
| v1.0.0 | 2021-07-26 | v1 正式版, 监控系统重整 | v1.0.0 |
| v0.9.0 | 2021-04-04 | Pigsty 图形界面, 命令行界面, 日志集成 | v0.9.0 |
| v0.8.0 | 2021-03-28 | 服务置备,定制对外暴露的数据库服务 | v0.8.0 |
| v0.7.0 | 2021-03-01 | 仅监控部署,监控现有 PostgreSQL 实例 | v0.7.0 |
| v0.6.0 | 2021-02-19 | 架构增强,将PG与Consul解耦 | v0.6.0 |
| v0.5.0 | 2021-01-07 | 支持在配置中定义业务数据库/用户 | v0.5.0 |
| v0.4.0 | 2020-12-14 | 支持 PostgreSQL 13,添加官方文档 | v0.4.0 |
| v0.3.0 | 2020-10-22 | 虚拟机置备方案正式定稿 | v0.3.0 |
| v0.2.0 | 2020-07-10 | PG监控系统第六版正式发布 | v0.2.0 |
| v0.1.0 | 2020-06-20 | 在生产仿真测试环境中验证通过 | v0.1.0 |
| v0.0.5 | 2020-08-19 | 离线安装模式:无需互联网访问即可交付 | v0.0.5 |
| v0.0.4 | 2020-07-27 | 将 Ansible 剧本重构为 Role | v0.0.4 |
| v0.0.3 | 2020-06-22 | 接口设计改进 | v0.0.3 |
| v0.0.2 | 2020-04-30 | 首次提交 | v0.0.2 |
| v0.0.1 | 2019-05-15 | 概念原型 | v0.0.1 |
v4.0.0-c1
curl https://pigsty.cc/get | bash -s v4.0.0
244 个提交,554 文件变更,+94,508 / -41,374 行,提交页面: https://github.com/pgsty/pigsty/releases/tag/v4.0.0-c1
亮点特性
- 可观测性革命: Prometheus → VictoriaMetrics(10x 性能),Loki+Promtail → VictoriaLogs+Vector
- 安全加固: 自动生成强密码、etcd RBAC、防火墙/SELinux 模式、权限收紧
- 数据库管理:
pg_databasesstate(create/absent/recreate)、strategy瞬间克隆 - PITR 与分叉:
/pg/bin/pg-forkCoW 瞬间克隆、pg-pitr增强支持 PITR 前备份 - AI Agent支持: 添加 claude code,opencode,uv 支持
- 多云 Terraform: AWS、Azure、GCP、Hetzner、DigitalOcean、Linode、Vultr、腾讯云模板
- 许可证: AGPL-3.0 → Apache-2.0
基础设施软件包更新
其中 MinIO 开始使用 pgsty 自身维护打包的 RPM/DEB
| 软件包 | 版本 | 软件包 | 版本 |
|---|---|---|---|
| grafana | 12.3.1 | victoria-metrics | 1.132.0 |
| victoria-logs | 1.43.1 | vector | 0.52.0 |
| alertmanager | 0.30.0 | blackbox_exporter | 0.28.0 |
| etcd | 3.6.7 | duckdb | 1.4.3 |
| pg_exporter | 1.1.1 | pgbackrest_exporter | 0.22.0 |
| minio | 20251203 | pig | 0.9.0 |
| uv | 0.9.18 (新) | opencode | 1.0.223 (新) |
*PostgreSQL 扩展
新扩展: pg_textsearch 0.1.0, pg_clickhouse 0.1.0, pg_ai_query 0.1.1
更新: IvorySQL 5.1, timescaledb 2.24.0, pg_search 0.20.4, pg_duckdb 1.1.1, pg_biscuit 2.0.1, pg_anon 2.5.1, pg_enigma 0.5.0, pg_session_jwt 0.4.0, pg_vectorize 0.26.0, vchord_bm25 0.3.0, wrappers 0.5.7
PG18 Deb 修复: pg_vectorize, pg_tiktoken, pg_tzf, pglite_fusion, pgsmcrypto, pgx_ulid, plprql, pg_summarize, supautils
破坏性变更
可观测性栈
| 旧组件 | 新组件 |
|---|---|
| Prometheus | VictoriaMetrics |
| Loki | VictoriaLogs |
| Promtail | Vector |
参数变更
| 移除 | 替代 |
|---|---|
node_disable_firewall | node_firewall_mode (off/none/zone) |
node_disable_selinux | node_selinux_mode (disabled/permissive/enforcing) |
pg_pwd_enc | 已移除 |
infra_pip | infra_uv |
默认值变更
| 参数 | 变化 |
|---|---|
grafana_clean | true → false |
effective_io_concurrency | 1000 → 200 |
install.yml | 重命名为 deploy.yml(保留软链接) |
可观测性
- 使用全新的 VictoriaMetrics 替代 Prometheus,用几分之一的资源实现几倍的性能。
- 使用全新的日志收集方案:VictoriaLogs + Vector,取代 Promtail + Loki。
- 统一调整了所有组件的日志格式,PG 日志使用 UTC 时间戳(log_timezone)
- 调整了 PostgreSQL 日志的轮换方式,使用按周循环截断日志轮转模式
- 在 PG 日志中记录超过 1MB 的临时文件分配,在特定模版中启用 PG 17/18 日志新参数
- 新增了 Nginx Access & Error / Syslog / PG CSV / Pgbackrest 的 vector 日志解析配置
- 注册数据源现在会在所有 Infra 节点上进行,Victoria 数据源将自动注册入 Grafana
- 新增
grafana_pgurl参数,允许指定 Grafana 使用 PG 作为后端存储元数据库 - 新增
grafana_view_pgpass参数,指定 Grafana Meta 数据源使用的密码 pgbackrest_exporter的默认选项现在将设置一个 120秒的内部缓存间隔(原本为 600s)。grafana_clean参数的默认值现在由true改为false,即默认不清除。- 新增指标收集器
pg_timeline,收集更实时的时间线指标pg_timeline_id pg_exporter更新至 1.1.1,修复大量历史遗留问题。
接口改进
install.yml剧本现在重命名为deploy.yml以更符合语义。pg_databases数据库制备功能改进- 添加删库能力:可以使用
state字段指定create,absent,recreate三种状态。 - 添加克隆能力:数据库定义中使用
strategy参数指定克隆方法 - 支持较新版本引入的 locale 配置参数:
locale_provider,icu_locale,icu_rules,builtin_locale - 支持
is_template参数,将数据库标记为模板数据库 - 添加了更多类型检查,避免了字符类参数的注入
- 允许在 extension 中指定
state: absent以删除扩展
- 添加删库能力:可以使用
pg_users用户制备功能改进,新增参数admin,类似roles,但是带有ADMIN OPTION权限可以转授。
参数优化
pg_io_method参数,auto, sync, worker, io_uring, 四种方式可选,默认 workeridle_replication_slot_timeout, 默认 7d, crit 模板 3dlog_lock_failures,oltp,crit 模版开启track_cost_delay_timing,olap,crit 模版开启log_connections,oltp/olap 开启认证日志,crit 开启全部日志。maintenance_io_concurrency设置为 100,如果使用 SSDeffective_io_concurrency从 1000 减小为 200file_copy_method参数为 PG18 默认设置为clone,提供瞬间克隆数据库的能力- 对于 PG17+,如果
pg_checksums开关关闭,在 patroni 初始化集群时显式禁用校验和 - 修复了
duckdb.allow_community_extensions总是生效的问题 - 允许通过
node_firewall_intranet指定 HBA 信任的 “内网网段” - 现在 pg_hba 与 pgbouncer_hba 支持 IPv6 的 localhost 访问
架构改进
- 在 Infra 节点上,设置固定的
/infra软连接指向 Infra 数据目录/data/infra。 - 现在 infra 的数据默认放置于 /data/infra 目录下,这使得在容器中使用更为便利。
- 本地软件仓库现在放置于 /data/nginx/pigsty, /www 现在作为软链接指向 /data/nginx 确保兼容。
- DNS 解析记录现在放置于
/infra/hosts目录下,解决了 Ansible SELinux 竞态问题 - pg_remove/pg_pitr 移除 etcd 元数据的任务,现在不再依赖 admin_ip 管理节点,而在 etcd 集群上执行
- 36 节点仿真模板 simu 简化为 20 节点的版本。
- 适配上游变化,移除 PGDG sysupdate 仓库,移除 EL 系统上所有 llvmjit 的相关包
- 为 EPEL 10 / PGDG 9/10 仓库使用操作系统完整版本号(
major.minor) - 允许在仓库定义中指定
meta参数,覆盖 yum 仓库的定义元数据 - 新增了
/pg/bin/pg-fork脚本,用于快速创建 CoW 副本数据库实例 - 调整
/pg/bin/pg-pitr脚本,现在可以用于实例级别的 PITR 恢复 - 确保 vagrant libvirt 模板默认带有 128GB 磁盘,以 xfs 挂载于
/data。 - 确保 pgboucner 不再将
0.0.0.0监听地址修改为*。 - 多云 Terraform 模板:AWS、Azure、GCP、Hetzner、DigitalOcean、Linode、Vultr、腾讯云
安全改进
configure现在会自动生成随机强密码,避免使用默认密码带来的安全隐患。- 移除
node_disable_firewall,新增node_firewall_mode,支持 off, none, zone 三种模式。 - 移除
node_disable_selinux,新增node_selinux_mode,支持 disabled, permissive, enforcing 三种模式。 - 新增 nginx basic auth 支持,可以为 Nginx Server 设置可选的 HTTP Basic Auth。
- 修复 ownca 证书有效期问题,确保了 Chrome 可以识别自签名证书。
- 更改了 MinIO 模块的默认密码,避免与众所周知的默认密码冲突
- 启用了针对 etcd 的 RBAC,每个集群现在只能管理自己的 PostgreSQL 数据库集群。
- etcd root 密码现在放置于
/etc/etcd/etcd.pass文件中,仅对管理员可读 - 为 HAProxy,Nginx,DNSMasq,Redis 等组件配置了正确的 SELinux 上下文
- 收回了所有非 root 用户对可执行脚本的拥有权限
- 将
admin_ip添加到 Patroni API 允许访问的 IP 列表白名单中 - 总是创建 admin 系统用户组,patronictl 配置收紧为仅限 admin 组用户访问
- 新增
node_admin_sudo参数,允许指定/调整数据库管理员的 sudo 权限模式(all/nopass) - 修复了若干
ansible copy content字段为空时报错的问题。 - 修复了
pg_pitr中遗留的一些问题,确保 patroni 集群恢复时没有竞态条件。
问题修复
- 修复 ownca 证书有效期 Chrome 兼容性问题
- 修复 Vector 0.52 syslog_raw 解析问题
- 修复 pg_pitr 多副本 clonefrom 时序问题
- 修复 Ansible SELinux dnsmasq 竞态条件
- 修复 EL9 aarch64 patroni & llvmjit 问题
- 修复 Debian groupadd 路径问题
- 修复空 sudoers 文件生成问题
- 修复 pgbouncer pid 路径(
/run/postgresql) - 修复
duckdb.allow_community_extensions始终生效问题 - 因上游问题隐藏 EL8 上的 pg_partman 扩展
兼容性
| 操作系统 | x86_64 | aarch64 |
|---|---|---|
| EL 8/9/10 | ✅ | ✅ |
| Debian 11/12/13 | ✅ | ✅ |
| Ubuntu 22.04/24.04 | ✅ | ✅ |
PostgreSQL: 13, 14, 15, 16, 17, 18
校验和
4c38ca59e756f239448e7eb45d2236f0 pigsty-pkg-v4.0.0.d12.aarch64.tgz
020b0ded1af009d0e758de8a33393239 pigsty-pkg-v4.0.0.d12.x86_64.tgz
513c98a3ba911eebf10a1364fd70ce90 pigsty-pkg-v4.0.0.d13.aarch64.tgz
524ca6f1e8ef6ff821eff1f618f8683e pigsty-pkg-v4.0.0.d13.x86_64.tgz
b5ad7a6b6dee0515e7a0dd33611b7aba pigsty-pkg-v4.0.0.el10.aarch64.tgz
bb20de1730c9cce75f476f3dc444eab5 pigsty-pkg-v4.0.0.el10.x86_64.tgz
fe2f27406d218216beba9b92d7da3080 pigsty-pkg-v4.0.0.el8.aarch64.tgz
f2e12f9db85b280df5e4e6504bbf69af pigsty-pkg-v4.0.0.el8.x86_64.tgz
73d79ef99e5030cb0daf5ec1bd8afe2f pigsty-pkg-v4.0.0.el9.aarch64.tgz
27b59e5b4994dd0bb17d1b4f50eff96a pigsty-pkg-v4.0.0.el9.x86_64.tgz
9838065e0c43c67a3ff2274c9b48f354 pigsty-pkg-v4.0.0.u22.aarch64.tgz
fec238e811b0f838770602ed1c93a5a1 pigsty-pkg-v4.0.0.u22.x86_64.tgz
0dc4140abd907c872c29db7b77aeb54a pigsty-pkg-v4.0.0.u24.aarch64.tgz
3aa158fb40555f34e45422a4177850b7 pigsty-pkg-v4.0.0.u24.x86_64.tgz
8eeb5d05edf865543aafcc7fcb935825 pigsty-v4.0.0.tgz
v3.7.0
亮点特性
- PostgreSQL 18 深度支持,成为默认 PG 大版本,扩展已就位!
- 新增 EL10 / Debian 13 操作系统支持,总数达 14 个!
- 新增 PostgresQL 扩展数量,总数达到 437 个!
- 支持了 Ansible 2.19 破坏性重构以后的版本!
- Supabase,PolarDB, IvorySQL, Percona 内核更新至最新版本!
- 优化了 PG 默认参数的设置逻辑,更充分利用资源。
版本更新
- PostgreSQL 18.1, 17.7, 16.11, 15.15, 14.20, 13.23
- Patroni 4.1.0
- Pgbouncer 1.25.0
- pg_exporter 1.0.3
- pgbackrest 2.57.0
- Supabase 2025-11
- PolarDB 15.15.5.0
- FerretDB 2.7.0
- DuckDB 1.4.2
- Etcd 3.6.6
- pig 0.7.4
更多软件版本更新信息,请参考:
API变化
- 为并行执行的相关参数设置了更合理的优化策略,详见 调参说明
- 在
rich与full模板中,不再默认安装 citus 扩展,因为 citus 尚未支持 PG 18 - PG 参数模板中,新增 duckdb 系列扩展存根。
- 为
min_wal_size,max_wal_size,max_slot_wal_keep_size设置 200,2000,3000 GB 的封顶上限值。 - 为
temp_file_limit设置 200 GB 的封顶上限,OLAP 设置为 2 TB。 - 适当增大连接池默认链接数量
- 新增
prometheus_port参数,且默认值为9058,避开与 EL10 RHEL Web Console 端口的冲突。 - 修改
alertmanager_port参数的默认值为9059,避开与 Kafka SSL 端口的潜在冲突。 - 新增
pg_pkg的pg_pre子任务,在安装 PG 包前移除 el9+ 上导致 LLVM 冲突的bpftool,python3-perf - 在 Debian / Ubuntu 的默认仓库定义中新增 llvm 仓库模块
- 修复了
infra-rm.yml移除软件包的逻辑
兼容性修复
- 修复了 Ubuntu/Debian 信任 CA 时 Warning 返回码错误的问题。
- 修复了 Ansible 2.19 引入的大量兼容性问题,确保在新老版本上正常运行。
- 为 seq 类变量添加了 int 类型转换,确保兼容
- 将大量 with_items 修改为 loop 语法,确保兼容
- 为密钥交换变量添加一层列表嵌套,避免在新版本下针对字符串进行字符迭代。
- 将 range 用例显式转换为 list 后使用
- 修改了 name,port 等标记保留的变量命名
- 将
play_hosts修改为ansible_play_hosts - 为部分字符串类型添加了 string 强制类型转换,避免运行时错误。
- EL10 逻辑适配:
- 修复了 EL10 缺少 ansible-collection-community-crypto 无法生成密钥的问题
- 修复了 EL10 缺少 ansible 逻辑包的问题
- 移除 modulemd_tools flamegraph timescaledb-tool
- 使用 java-21-openjdk 替代 java-17-openjdk
- aarch64 YUM 仓库名称问题
- Debian 13 逻辑适配
- 使用
bind9-dnsutils替代dnsutils - Ubuntu 24 修复
- 临时移除了上游依赖崩溃的 tcpdump 包
校验和
e00d0c2ac45e9eff1cc77927f9cd09df pigsty-v3.7.0.tgz
987529769d85a3a01776caefefa93ecb pigsty-pkg-v3.7.0.d12.aarch64.tgz
2d8272493784ae35abeac84568950623 pigsty-pkg-v3.7.0.d12.x86_64.tgz
090cc2531dcc25db3302f35cb3076dfa pigsty-pkg-v3.7.0.d13.x86_64.tgz
ddc54a9c4a585da323c60736b8560f55 pigsty-pkg-v3.7.0.el10.aarch64.tgz
d376e75c490e8f326ea0f0fbb4a8fd9b pigsty-pkg-v3.7.0.el10.x86_64.tgz
8c2deeba1e1d09ef3d46d77a99494e71 pigsty-pkg-v3.7.0.el8.aarch64.tgz
9795e059bd884b9d1b2208011abe43cd pigsty-pkg-v3.7.0.el8.x86_64.tgz
08b860155d6764ae817ed25f2fcf9e5b pigsty-pkg-v3.7.0.el9.aarch64.tgz
1ac430768e488a449d350ce245975baa pigsty-pkg-v3.7.0.el9.x86_64.tgz
e033aaf23690755848db255904ab3bcd pigsty-pkg-v3.7.0.u22.aarch64.tgz
cc022ea89181d89d271a9aaabca04165 pigsty-pkg-v3.7.0.u22.x86_64.tgz
0e978598796db3ce96caebd76c76e960 pigsty-pkg-v3.7.0.u24.aarch64.tgz
48223898ace8812cc4ea79cf3178476a pigsty-pkg-v3.7.0.u24.x86_64.tgz
v3.6.1
curl https://repo.pigsty.cc/get | bash -s v3.6.1
亮点特性
- PostgreSQL 17.6, 16.10, 15.14, 14.19, 13.22, 以及 18 Beta 3 支持
- 在中国大陆地区使用 Pigsty 提供的 PGDG APT/YUM 镜像解决更新断供问题。
- 新的网站首页: https://pgsty.com
- 增加了 el10, debian 13 的实现存根,以及 el10 的 Terraform 镜像
基础设施软件包更新
- Grafana 12.1.0
- pg_exporter 1.0.2
- pig 0.6.1
- vector 0.49.0
- redis_exporter 1.75.0
- mongo_exporter 0.47.0
- victoriametrics 1.123.0
- victorialogs: 1.28.0
- grafana-victoriametrics-ds 0.18.3
- grafana-victorialogs-ds 0.19.3
- grafana-infinity-ds 3.4.1
- etcd 3.6.4
- ferretdb 2.5.0
- tigerbeetle 0.16.54
- genai-toolbox 0.12.0
数据库软件包更新
- pg_search 0.17.3
API变更
- 从
node_kernel_modules默认值中移除br_filter内核模块。 - 在添加 PGDG YUM 源时使用操作大版本号,不再使用小版本号。
校验和
045977aff647acbfa77f0df32d863739 pigsty-pkg-v3.6.1.d12.aarch64.tgz
636b15c2d87830f2353680732e1af9d2 pigsty-pkg-v3.6.1.d12.x86_64.tgz
700a9f6d0db9c686d371bf1c05b54221 pigsty-pkg-v3.6.1.el8.aarch64.tgz
2aff03f911dd7be363ba38a392b71a16 pigsty-pkg-v3.6.1.el8.x86_64.tgz
ce07261b02b02b36a307dab83e460437 pigsty-pkg-v3.6.1.el9.aarch64.tgz
d598d62a47bbba2e811059a53fe3b2b5 pigsty-pkg-v3.6.1.el9.x86_64.tgz
13fd68752e59f5fd2a9217e5bcad0acd pigsty-pkg-v3.6.1.u22.aarch64.tgz
c25ccfb98840c01eb7a6e18803de55bb pigsty-pkg-v3.6.1.u22.x86_64.tgz
0d71e58feebe5299df75610607bf428c pigsty-pkg-v3.6.1.u24.aarch64.tgz
4fbbab1f8465166f494110c5ec448937 pigsty-pkg-v3.6.1.u24.x86_64.tgz
083d8680fa48e9fec3c3fcf481d25d2f pigsty-v3.6.1.tgz
v3.6.0
curl https://repo.pigsty.cc/get | bash -s v3.6.0
亮点特性
- 全新文档站: https://doc.pgsty.com
- 新增
pgsql-pitr剧本与备份/恢复教程,改善 PITR 体验, - 新增内核支持:Percona PG TDE (PG17)
- 优化 Supabase 自建体验,更新至最新版本,并解决了一系列官方模板的问题
- 简化安装步骤,默认使用在线安装,更加高效简单,bootstrap 过程(安装ansible)嵌入安装脚本中
设计改进
- 改善了 Etcd 模块的实现,新增独立的
etcd-rm.yml剧本与扩缩容 SOP 脚本。 - 改善了 MinIO 模块的实现,支持 HTTP 模式,创建不同属性的三个桶供开箱即用
- 重新调整梳理了所有配置模板,使用更为便利
- 针对中国大陆使用速度更快的 Docker Registry 镜像站
- 优化了 tuned 操作系统参数模板,针对现代硬件与 NVMe 磁盘优化
- 新增扩展
pgactive用于多主复制与亚秒级故障切换 - 调整
pg_fs_main/pg_fs_backup默认值,简化文件目录结构设计
问题修复
- 修复了 pgbouncer 配置文件的错误 by @housei-zzy
- 修复了 OrioleDB 在 Debian 平台上的问题
- 修复了 tuned shm 配置参数的问题
- 离线软件包直接使用 PGDG 源,避免使用断开同步的镜像站点
- 修复了 IvorySQL libxcrypt 依赖的问题
- 替换了破损与缓慢的 EPEL 软件仓库站点
- 修复了
haproxy_enabled标记位的功能
基础设施软件包更新
新增 Victoria Metrics / Victoria Logs 相关包
- genai-toolbox 0.9.0 (new)
- victoriametrics 1.120.0 -> 1.121.0 (重构)
- vmutils 1.121.0 (重命名 victoria-metrics-utils)
- grafana-victoriametrics-ds 0.15.1 -> 0.17.0
- victorialogs 1.24.0 -> 1.25.1 (重构)
- vslogcli 1.24.0 -> 1.25.1
- vlagent 1.25.1 (新增)
- grafana-victorialogs-ds 0.16.3 -> 0.18.1
- prometheus 3.4.1 -> 3.5.0
- grafana 12.0.0 -> 12.0.2
- vector 0.47.0 -> 0.48.0
- grafana-infinity-ds 3.2.1 -> 3.3.0
- keepalived_exporter 1.7.0
- blackbox_exporter 0.26.0 -> 0.27.0
- redis_exporter 1.72.1 -> 1.77.0
- rclone 1.69.3 -> 1.70.3
数据库软件包更新
- PostgreSQL 18 Beta2 更新
- pg_exporter 1.0.1,更新至最新依赖并提供 Docker 镜像
- pig 0.6.0,更新了最新扩展与仓库列表,带有
pig install子命令 - vip-manager 3.0.0 -> 4.0.0
- ferretdb 2.2.0 -> 2.3.1
- dblab 0.32.0 -> 0.33.0
- duckdb 1.3.1 -> 1.3.2
- etcd 3.6.1 -> 3.6.3
- ferretdb 2.2.0 -> 2.4.0
- juicefs 1.2.3 -> 1.3.0
- tigerbeetle 0.16.41 -> 0.16.50
- pev2 1.15.0 -> 1.16.0
PG扩展包更新
- OrioleDB 1.5 beta12
- OriolePG 17.11
- plv8 3.2.3 -> 3.2.4
- postgresql_anonymizer 2.1.1 -> 2.3.0
- pgvectorscale 0.7.1 -> 0.8.0
- wrappers 0.5.0 -> 0.5.3
- supautils 2.9.1 -> 2.10.0
- citus 13.0.3 -> 13.1.0
- timescaledb 2.20.0 -> 2.21.1
- vchord 0.3.0 -> 0.4.3
- pgactive 2.1.5 (new)
- documentdb 0.103.0 -> 0.105.0
- pg_search 0.17.0
API变更
pg_fs_backup:重命名为pg_fs_backup,默认值为/data/backups。pg_rm_bkup:重命名为pg_rm_backup,默认值为true。pg_fs_main:现在默认值调整为/data/postgres。nginx_cert_validity:新增参数,用于控制 Nginx 自签名证书的有效期,默认为397d。minio_buckets:默认值调整为创建名为pgsql、meta、data的三个桶。minio_users:移除dba用户,新增s3user_meta和s3user_data用户,分别对应meta和data桶。minio_https:新增参数,允许配置 MinIO 使用 HTTP 模式。minio_provision:新增参数,允许跳过 MinIO 置备阶段(跳过桶和用户的创建)。minio_safeguard:新增参数,启用后会在执行minio-rm.yml时中止操作。minio_rm_data:新增参数,控制在执行minio-rm.yml时是否删除 minio 数据目录。minio_rm_pkg:新增参数,控制在执行minio-rm.yml时是否卸载 minio 软件包。etcd_learner:新增参数,允许 etcd 以学习者身份初始化。etcd_rm_data:新增参数,控制在执行etcd-rm.yml时是否删除 etcd 数据目录。etcd_rm_pkg:新增参数,控制在执行etcd-rm.yml时是否卸载 etcd 软件包。
校验和
df64ac0c2b5aab39dd29698a640daf2e pigsty-v3.6.0.tgz
cea861e2b4ec7ff5318e1b3c30b470cb pigsty-pkg-v3.6.0.d12.aarch64.tgz
2f253af87e19550057c0e7fca876d37c pigsty-pkg-v3.6.0.d12.x86_64.tgz
0158145b9bbf0e4a120b8bfa8b44f857 pigsty-pkg-v3.6.0.el8.aarch64.tgz
07330d687d04d26e7d569c8755426c5a pigsty-pkg-v3.6.0.el8.x86_64.tgz
311df5a342b39e3288ebb8d14d81e0d1 pigsty-pkg-v3.6.0.el9.aarch64.tgz
92aad54cc1822b06d3e04a870ae14e29 pigsty-pkg-v3.6.0.el9.x86_64.tgz
c4fadf1645c8bbe3e83d5a01497fa9ca pigsty-pkg-v3.6.0.u22.aarch64.tgz
5477ed6be96f156a43acd740df8a9b9b pigsty-pkg-v3.6.0.u22.x86_64.tgz
196169afc1be02f93fcc599d42d005ca pigsty-pkg-v3.6.0.u24.aarch64.tgz
dbe5c1e8a242a62fe6f6e1f6e6b6c281 pigsty-pkg-v3.6.0.u24.x86_64.tgz
v3.5.0
亮点特性
- 支持 PG 18 (Beta),扩展更新,总数达到 421 个
- OrioleDB 与 OpenHalo 内核在全平台上可用
- 可使用
pig do子命令代替bin脚本 - Supabase 自建加强,解决若干遗留问题,例如复制延迟与密钥分发
- 代码重构与架构优化,优化了 Postgres 与 Pgbouncer 默认参数
- 更新了 Grafana 12, pg_exporter 1.0 与相关插件,翻修面板
curl https://repo.pigsty.cc/get | bash -s v3.5.0
- 支持 PostgreSQL 18
- 通过 pg_exporter 1.0.0 支持 PG18 监控指标
- 通过 pig 0.4.1 支持 PG18 安装 Alias。
- 提供
pg18配置模板 - 重构
pgsql模块 - PGSQL 重构,将 PG 监控抽离为单独的
pg_monitor角色,移除clean逻辑 - 去除冗余重复的任务,合并同类项,精简配置。移除
dir/utils任务块 - 所有扩展默认安装至
extensions模式中(与 supabase 安全实践保持一致) - 重命名模板文件,移除所有
.j2后缀 - 为所有模板中的
monitor函数添加SET命令清空search_path,遵循 Supabase 安全最佳实践。 - 调整 pgbouncer 默认参数,增大默认链接池大小,设置链接池清理查询。
- 新增参数
pgbouncer_ignore_param,允许配置 pgbouncer 忽略的参数列表 - 新增任务
pg_key用于生成pgsodium所需的服务端密钥 - 针对 PG 17 默认启用
sync_replication_slots - 重新调整了子任务标签,使其更符合配置小节的拆分逻辑
- 重构
pg_remove模块 - 重命名参数:
pg_rm_data,pg_rm_bkup,pg_rm_pkg用于控制删除的内容 - 重新调整角色代码结构,使用更清楚的标签进行划分
- 新增
pg_monitor模块 pgbouncer_exporter现在不再和pg_exporter共享配置文件- 新增了 TimescaleDB, Citus,pg_wait_event 的监控指标。
- 使用
pg_exporter1.0.0 ,更新了 PG16/17/18 相关监控指标。 - 使用更为紧凑,全新设计的指标收集器配置文件。
- Supabase 加强 (感谢来自 @lawso017 的贡献!)
- 将 Supabase 容器镜像与数据库模式更新至最新版本
- 现在默认支持
pgsodium服务端密钥加载 - 通过 supa-kick 定时任务解决 logflare 无法及时更新复制进度的问题
- 为 monitor 模式中的函数添加
set search_path子句以遵循安全最佳实践 - CLI 新增
pig do命令,允许通过命令行工具替代bin/中的 Shell 脚本 - 监控系统更新
- 更新 Grafana 大版本至 12.0.0,更新相关插件/数据源软件包
- 更新 Postgres 数据源 uid 命名方式(以适应新的
uid长度限制与字符限制) - 新增了 Static Datasource
- 更新了现有 Dashboard,修复若干遗留问题
基础设施软件包更新
- pig 0.4.2
- duckdb 1.3.0
- etcd 3.6.0
- vector 0.47.0
- minio 20250422221226
- mcli 20250416181326
- pev 1.5.0
- rclone 1.69.3
- mtail 3.0.8 (new)
可观测性软件包更新
- grafana 12.0.0
- grafana-victorialogs-ds 0.16.3
- grafana-victoriametrics-ds 0.15.1
- grafana-infinity-ds 3.2.1
- grafana_plugins 12.0.0
- prometheus 3.4.0
- pushgateway 1.11.1
- nginx_exporter 1.4.2
- pg_exporter 1.0.0
- pgbackrest_exporter 0.20.0
- redis_exporter 1.72.1
- keepalived_exporter 1.6.2
- victoriametrics 1.117.1
- victoria_logs 1.22.2
数据库软件包更新
- PostgreSQL 17.5, 16.9, 15.13, 14.18, 13.21
- PostgreSQL 18beta1 支持
- pgbouncer 1.24.1
- pgbackrest 2.55
- pgbadger 13.1
Postgres 扩展包更新
- spat 0.1.0a4 新扩展
- pgsentinel 1.1.0 新扩展
- pgdd 0.6.0 (pgrx 0.14.1) 新扩展
- convert 0.0.4 (pgrx 0.14.1) 新扩展
- pg_tokenizer.rs 0.1.0 (pgrx 0.13.1)
- pg_render 0.1.2 (pgrx 0.12.8)
- pgx_ulid 0.2.0 (pgrx 0.12.7)
- pg_idkit 0.3.0 (pgrx 0.14.1)
- pg_ivm 1.11.0
- orioledb 1.4.0 beta11 新增 debian/ubuntu 支持
- openhalo 14.10 新增 debian/ubuntu 支持
- omnigres 20250507 (在 d12/u22 编译最新版本失败)
- citus 12.0.3
- timescaledb 2.20.0 (移除 PG14 支持)
- supautils 2.9.2
- pg_envvar 1.0.1
- pgcollection 1.0.0
- aggs_for_vecs 1.4.0
- pg_tracing 0.1.3
- pgmq 1.5.1
- tzf-pg 0.2.0 (pgrx 0.14.1)
- pg_search 0.15.18 (pgrx 0.14.1)
- anon 2.1.1 (pgrx 0.14.1)
- pg_parquet 0.4.0 (0.14.1)
- pg_cardano 1.0.5 (pgrx 0.12) -> 0.14.1
- pglite_fusion 0.0.5 (pgrx 0.12.8) -> 14.1
- vchord_bm25 0.2.1 (pgrx 0.13.1)
- vchord 0.3.0 (pgrx 0.13.1)
- pg_vectorize 0.22.1 (pgrx 0.13.1)
- wrappers 0.4.6 (pgrx 0.12.9)
- timescaledb-toolkit 1.21.0 (pgrx 0.12.9)
- pgvectorscale 0.7.1 (pgrx 0.12.9)
- pg_session_jwt 0.3.1 (pgrx 0.12.6) -> 0.12.9
- pg_timetable 5.13.0
- ferretdb 2.2.0
- documentdb 0.103.0 (新增 aarch64支持)
- pgml 2.10.0 (pgrx 0.12.9)
- sqlite_fdw 2.5.0 (fix pg17 deb)
- tzf 0.2.2 0.14.1 (rename src)
- pg_vectorize 0.22.2 (pgrx 0.13.1)
- wrappers 0.5.0 (pgrx 0.12.9)
校验和
ab91bc05c54b88c455bf66533c1d8d43 pigsty-v3.6.0.tgz
4c9fabc2d1f0ed733145af2b6aff2f48 pigsty-pkg-v3.5.0.d12.x86_64.tgz
796d47de12673b2eb9882e527c3b6ba0 pigsty-pkg-v3.5.0.el8.x86_64.tgz
a53ef2cede1363f11e9faaaa43718fdc pigsty-pkg-v3.5.0.el9.x86_64.tgz
36da28f97a845fdc0b7bbde2d3812a67 pigsty-pkg-v3.5.0.u22.x86_64.tgz
8551b3e04b38af382163e6857778437d pigsty-pkg-v3.5.0.u24.x86_64.tgz
v3.4.1
GitHub 发布页面:v3.4.1
- 在 EL 系统上增加了对 MySQL 协议兼容 PostgreSQL 内核的支持:openHalo
- 在 EL 系统上增加了对 OLTP 增强 PostgreSQL 内核的支持:orioledb
- 优化了 pgAdmin 9.2 应用模板,具有自动服务器列表更新和 pgpass 密码填充功能
- 将 PG 默认最大连接数增加到 250、500、1000
- 从 EL8 中删除了有依赖错误的
mysql_fdw扩展
基础设施更新
- pig 0.3.4
- etcd 3.5.21
- restic 0.18.0
- ferretdb 2.1.0
- tigerbeetle 0.16.34
- pg_exporter 0.8.1
- node_exporter 1.9.1
- grafana 11.6.0
- zfs_exporter 3.8.1
- mongodb_exporter 0.44.0
- victoriametrics 1.114.0
- minio 20250403145628
- mcli 20250403170756
扩展更新
- 将 pg_search 升级到 0.15.13
- 将 citus 升级到 13.0.3
- 将 timescaledb 升级到 2.19.1
- 将 pgcollection RPM 升级到 1.0.0
- 将 pg_vectorize RPM 升级到 0.22.1
- 将 pglite_fusion RPM 升级到 0.0.4
- 将 aggs_for_vecs RPM 升级到 1.4.0
- 将 pg_tracing RPM 升级到 0.1.3
- 将 pgmq RPM 升级到 1.5.1
校验和
471c82e5f050510bd3cc04d61f098560 pigsty-v3.4.1.tgz
4ce17cc1b549cf8bd22686646b1c33d2 pigsty-pkg-v3.4.1.d12.aarch64.tgz
c80391c6f93c9f4cad8079698e910972 pigsty-pkg-v3.4.1.d12.x86_64.tgz
811bf89d1087512a4f8801242ca8bed5 pigsty-pkg-v3.4.1.el9.x86_64.tgzz
9fe2e6482b14a3e60863eeae64a78945 pigsty-pkg-v3.4.1.u22.x86_64.tgz
v3.4.0
GitHub 发布页面:v3.4.0
介绍博客:Pigsty v3.4 MySQL 兼容性和全面增强
新功能
- 增加了新的 pgBackRest 备份监控指标和仪表板
- 增强了 Nginx 服务器配置选项,支持自动 Certbot 签发
- 现在优先使用 PostgreSQL 内置的
C/C.UTF-8区域设置 - IvorySQL 4.4 现在在所有平台上完全支持(RPM/DEB 在 x86/ARM 上)
- 增加了新的软件包:Juicefs、Restic、TimescaleDB EventStreamer
- Apache AGE 图数据库扩展现在在 EL 上完全支持 PostgreSQL 13–17
- 改进了
app.ymlplaybook:无需额外配置即可启动标准 Docker 应用 - 升级 Supabase、Dify 和 Odoo 应用模板到最新版本
- 增加 electric 应用模板,本地优先的 PostgreSQL 同步引擎
基础设施包
- +restic 0.17.3
- +juicefs 1.2.3
- +timescaledb-event-streamer 0.12.0
- Prometheus 3.2.1
- AlertManager 0.28.1
- blackbox_exporter 0.26.0
- node_exporter 1.9.0
- mysqld_exporter 0.17.2
- kafka_exporter 1.9.0
- redis_exporter 1.69.0
- pgbackrest_exporter 0.19.0-2
- DuckDB 1.2.1
- etcd 3.5.20
- FerretDB 2.0.0
- tigerbeetle 0.16.31
- vector 0.45.0
- VictoriaMetrics 1.113.0
- VictoriaLogs 1.17.0
- rclone 1.69.1
- pev2 1.14.0
- grafana-victorialogs-ds 0.16.0
- grafana-victoriametrics-ds 0.14.0
- grafana-infinity-ds 3.0.0
PostgreSQL 相关
- Patroni 4.0.5
- PolarDB 15.12.3.0-e1e6d85b
- IvorySQL 4.4
- pgbackrest 2.54.2
- pev2 1.14
- WiltonDB 13.17
PostgreSQL 扩展
- pgspider_ext 1.3.0(新扩展)
- apache age 13–17 el rpm (1.5.0)
- timescaledb 2.18.2 → 2.19.0
- citus 13.0.1 → 13.0.2
- documentdb 1.101-0 → 1.102-0
- pg_analytics 0.3.4 → 0.3.7
- pg_search 0.15.2 → 0.15.8
- pg_ivm 1.9 → 1.10
- emaj 4.4.0 → 4.6.0
- pgsql_tweaks 0.10.0 → 0.11.0
- pgvectorscale 0.4.0 → 0.6.0 (pgrx 0.12.5)
- pg_session_jwt 0.1.2 → 0.2.0 (pgrx 0.12.6)
- wrappers 0.4.4 → 0.4.5 (pgrx 0.12.9)
- pg_parquet 0.2.0 → 0.3.1 (pgrx 0.13.1)
- vchord 0.2.1 → 0.2.2 (pgrx 0.13.1)
- pg_tle 1.2.0 → 1.5.0
- supautils 2.5.0 → 2.6.0
- sslutils 1.3 → 1.4
- pg_profile 4.7 → 4.8
- pg_snakeoil 1.3 → 1.4
- pg_jsonschema 0.3.2 → 0.3.3
- pg_incremental 1.1.1 → 1.2.0
- pg_stat_monitor 2.1.0 → 2.1.1
- ddl_historization 0.7 → 0.0.7(错误修复)
- pg_sqlog 3.1.7 → 1.6(错误修复)
- pg_random 删除开发后缀(错误修复)
- asn1oid 1.5 → 1.6
- table_log 0.6.1 → 0.6.4
接口变更
- 增加了新的 Docker 参数:
docker_data和docker_storage_driver(#521 由 @waitingsong 提供) - 增加了新的基础设施参数:
alertmanager_port,让您指定 AlertManager 端口 - 增加了新的基础设施参数:
certbot_sign,在 nginx 初始化期间申请证书?(默认为 false) - 增加了新的基础设施参数:
certbot_email,指定通过 Certbot 请求证书时使用的邮箱 - 增加了新的基础设施参数:
certbot_options,指定 Certbot 的额外参数 - 更新 IvorySQL,从 IvorySQL 4.4 开始将其默认二进制文件放在
/usr/ivory-4下 - 将
pg_lc_ctype和其他区域相关参数的默认值从en_US.UTF-8更改为C - 对于 PostgreSQL 17,如果使用
UTF8编码与C或C.UTF-8区域,PostgreSQL 的内置本地化规则现在优先 configure自动检测 PG 版本和环境是否都支持C.utf8,并相应调整区域相关选项- 将默认 IvorySQL 二进制路径设置为
/usr/ivory-4 - 更新
pg_packages的默认值为pgsql-main patroni pgbouncer pgbackrest pg_exporter pgbadger vip-manager - 更新
repo_packages的默认值为[node-bootstrap, infra-package, infra-addons, node-package1, node-package2, pgsql-utility, extra-modules] - 从
/etc/profile.d/node.sh中删除LANG和LC_ALL环境变量设置 - 现在使用
bento/rockylinux-8和bento/rockylinux-9作为 EL 的 Vagrant box 镜像 - 增加了新别名
extra_modules,包含额外的可选模块 - 更新 PostgreSQL 别名:
postgresql、pgsql-main、pgsql-core、pgsql-full - GitLab 仓库现在包含在可用模块中
- Docker 模块已合并到基础设施模块中
node.ymlplaybook 现在包含node_pip任务,在每个节点上配置 pip 镜像pgsql.ymlplaybook 现在包含pgbackrest_exporter任务,用于收集备份指标Makefile现在允许使用META/PKG环境变量- 增加
/pg/spool目录作为 pgBackRest 的临时存储 - 默认禁用 pgBackRest 的
link-all选项 - 默认为 MinIO 仓库启用块级增量备份
错误修复
- 修复
pg-backup中的退出状态码(#532 由 @waitingsong 提供) - 在
pg-tune-hugepage中,限制 PostgreSQL 仅使用大页面(#527 由 @waitingsong 提供) - 修复
pg-role任务中的逻辑错误 - 纠正大页面配置参数的类型转换
- 修复
slim模板中node_repo_modules的默认值问题
校验和
768bea3bfc5d492f4c033cb019a81d3a pigsty-v3.4.0.tgz
7c3d47ef488a9c7961ca6579dc9543d6 pigsty-pkg-v3.4.0.d12.aarch64.tgz
b5d76aefb1e1caa7890b3a37f6a14ea5 pigsty-pkg-v3.4.0.d12.x86_64.tgz
42dacf2f544ca9a02148aeea91f3153a pigsty-pkg-v3.4.0.el8.aarch64.tgz
d0a694f6cd6a7f2111b0971a60c49ad0 pigsty-pkg-v3.4.0.el8.x86_64.tgz
7caa82254c1b0750e89f78a54bf065f8 pigsty-pkg-v3.4.0.el9.aarch64.tgz
8f817e5fad708b20ee217eb2e12b99cb pigsty-pkg-v3.4.0.el9.x86_64.tgz
8b2fcaa6ef6fd8d2726f6eafbb488aaf pigsty-pkg-v3.4.0.u22.aarch64.tgz
83291db7871557566ab6524beb792636 pigsty-pkg-v3.4.0.u22.x86_64.tgz
c927238f0343cde82a4a9ab230ecd2ac pigsty-pkg-v3.4.0.u24.aarch64.tgz
14cbcb90693ed5de8116648a1f2c3e34 pigsty-pkg-v3.4.0.u24.x86_64.tgz
v3.3.0
- 可用扩展总数增加到 404!
- PostgreSQL 二月小版本更新:17.4、16.8、15.12、14.17、13.20
- 新功能:
app.yml脚本,用于自动安装 Odoo、Supabase、Dify 等应用。 - 新功能:在
infra_portal中进一步自定义 Nginx 配置。 - 新功能:增加 Certbot 支持,快速申请免费 HTTPS 证书。
- 新功能:
pg_default_extensions现在支持纯文本扩展列表。 - 新功能:默认仓库现在包含 mongo、redis、groonga、haproxy 等。
- 新参数:
node_aliases,为节点添加命令别名。 - 修复:解决 Bootstrap 脚本中的默认 EPEL 仓库地址问题。
- 改进:为 Debian Security 仓库添加阿里云镜像。
- 改进:IvorySQL 内核的 pgBackRest 备份支持。
- 改进:PolarDB 的 ARM64 和 Debian/Ubuntu 支持。
- pg_exporter 0.8.0 现在支持 pgbouncer 1.24 中的新指标。
- 新功能:
git、docker、systemctl等常用命令的自动补全 #506 #507 由 @waitingsong 提供。 - 改进:优化
pgbouncer配置模板中的ignore_startup_parameters#488 由 @waitingsong 提供。 - 新主页设计:Pigsty 的网站现在拥有全新的外观。
- 扩展目录:RPM/DEB 二进制包的详细信息和下载链接。
- 扩展构建:
pigCLI 现在自动设置 PostgreSQL 扩展构建环境。
更多版本信息请参考 GitHub 发布页面。
v3.2.2
- 新增扩展包:
Omnigres33个扩展,将postgres作为应用开发平台 - 新增扩展:
pg_mooncake: postgres中的duckdb - 新增扩展:
pg_xxhash - 新增扩展:
timescaledb_toolkit - 新增扩展:
pg_xenophile - 新增扩展:
pg_drop_events - 新增扩展:
pg_incremental - 升级
citus至13.0.0,支持PostgreSQL 17 - 升级
pgml至2.10.0 - 升级
pg_extra_time至2.0.0 - 升级
pg_vectorize至0.20.0
变更内容
- 升级IvorySQL至4.2版本(基于PostgreSQL 17.2)
- 为PolarDB内核添加Arm64和Debian支持
- 在默认
infra_packages中添加certbot和certbot-nginx - 增加pgbouncer的max_prepared_statements参数至256
- 移除
pgxxx-citus包别名 - 在
pg_extensions中默认隐藏pgxxx-olap类别(因为存在两对扩展冲突)
v3.2.1
亮点特性
- PG扩展插件数量提升至350个,新增强力Rust扩展anon。
- IvorySQL支持更新至PG17兼容的4.0版本
- 使用Pigsty编译的Citus,TimescaleDB与PGroonga。
- 添加Odoo一键自建模板与新app.yml剧本
新增 13 扩展插件:
- 新增 pg_anon 2.0.0
- 新增 omnisketch 1.0.2
- 新增 ddsketch 1.0.1
- 新增 pg_duration 1.0.1
- 新增 ddl_historization 0.0.7
- 新增 data_historization 1.1.0
- 新增 schedoc 0.0.1
- 新增 floatfile 1.3.1
- 新增 pg_upless 0.0.3
- 新增 pg_task 1.0.0
- 新增 pg_readme 0.7.0
- 新增 vasco 0.1.0
- 新增 pg_xxhash 0.0.1
更新扩展版本
- lower_quantile 1.0.3
- quantile 1.1.8
- sequential_uuids 1.0.3
- pgmq 1.5.0 (subdir)
- floatvec 1.1.1
- pg_parquet 0.2.0
- wrappers 0.4.4
- pg_later 0.3.0
- topn fix for deb.arm64
- add age 17 on debian
- powa + pg17, 5.0.1
- h3 + pg17
- ogr_fdw + pg17
- age + pg17 1.5 on debian
- pgtap + pg17 1.3.3
- repmgr
- topn + pg17
- pg_partman 5.2.4
- credcheck 3.0
- ogr_fdw 1.1.5
- ddlx 0.29
- postgis 3.5.1
- tdigest 1.4.3
- pg_repack 1.5.2
v3.2.0
亮点特性
- Pigsty 命令行工具:
pig0.2.0,可用于管理扩展插件。 - 提供五大发行版上 390 个扩展 的 ARM64 扩展支持
- Supabase 发布周最新版本更新,全发行版均可自建。
- Grafana 更新至 11.4 ,新增 infinity 数据源。
软件包变化
新增扩展
- 新增 timescaledb, timescaledb-loader timescaledb-toolkit timescaledb-tool to PIGSTY repo
- 新增 pg_timescaledb,针对 EL 进行的编译重制版本
- 新增 pgroonga,针对 EL 全系进行编译重制
- 新增 vchord 0.1.0
- 新增 pg_bestmatch.rs 0.0.1
- 新增 pglite_fusion 0.0.3
- 新增 pgpdf 0.1.0
更新扩展
- pgvectorscale 0.4.0 -> 0.5.1
- pg_parquet 0.1.0 -> 0.1.1
- pg_polyline 0.0.1
- pg_cardano 1.0.2 -> 1.0.3
- pg_vectorize 0.20.0
- pg_duckdb 0.1.0 -> 0.2.0
- pg_search 0.13.0 -> 0.13.1
- aggs_for_vecs 1.3.1 -> 1.3.2
pgoutput被标记为新的 PostgreSQL Contrib 扩展
基础设施
- 新增 promscale 0.17.0
- 新增 grafana-plugins 11.4
- 新增 grafana-infinity-plugins
- 新增 grafana-victoriametrics-ds
- 新增 grafana-victorialogs-ds
- vip-manager 2.8.0 -> 3.0.0
- vector 0.42.0 -> 0.43.0
- grafana 11.3 -> 11.4
- prometheus 3.0.0 -> 3.0.1 (软件包名从
prometheus2变更为prometheus) - nginx_exporter 1.3.0 -> 1.4.0
- mongodb_exporter 0.41.2 -> 0.43.0
- VictoriaMetrics 1.106.1 -> 1.107.0
- VictoriaLogs 1.0.0 -> 1.3.2
- pg_timetable 5.9.0 -> 5.10.0
- tigerbeetle 0.16.13 -> 0.16.17
- pg_export 0.7.0 -> 0.7.1
缺陷修复
- el8.aarch64 添加 python3-cdiff 修复 patroni 依赖错漏问题
- el9.aarch64 添加 timescaledb-tools ,修复官方仓库缺失问题
- el9.aarch64 添加 pg_filedump ,修复官方仓库缺失问题
移除扩展
- pg_mooncake 因为与
pg_duckdb冲突而被移除。 - pg_top 因为出现太多版本出现缺失,因质量问题而淘汰。
- hunspell_pt_pt 因为与 PG 官方字典文件冲突而被淘汰。
- pg_timeit 因为无法在 AARCH64 架构上使用而被淘汰。
- pgdd 因为缺乏维护,PG 17 与 pgrx 版本老旧而被标记为弃用。
- old_snapshot 与 adminpack 被标记为 PG 17 不可用。
- pgml 被设置为默认不下载不安装。
- pg_mooncake 因为与
API变化
repo_url_packages参数现在默认值为空数组,因为所有软件包现在都通过操作系统包管理器进行安装。grafana_plugin_cache参数弃用,现在 Grafana 插件通过操作系统包管理器进行安装grafana_plugin_list参数弃用,现在 Grafana 插件通过操作系统包管理器进行安装- 原名为
prod的 36 节点仿真模板现在重命名为simu。 - 原本在
node_id/vars针对每个发行版代码生成的配置,现在同样针对aarch64生成。 infra_packages中默认添加命令行管理工具pigconfigure命令同样会修改自动生成配置文件中pgsql-xxx别名的版本号。adminpack在 PG 17 中被移除,因此从 Pigsty 默认扩展中被移除。
问题修复
- 修复了
pgbouncer仪表盘选择器问题 #474 pg-pitr新增--arg value参数解析支持 by @waitingsong- 修复 Redis 日志信息 typo by @waitingsong
软件包校验和
8fdc6a60820909b0a2464b0e2b90a3a6 pigsty-v3.2.0.tgz
d2b85676235c9b9f2f8a0ad96c5b15fd pigsty-pkg-v3.2.0.el9.aarch64.tgz
649f79e1d94ec1845931c73f663ae545 pigsty-pkg-v3.2.0.el9.x86_64.tgz
c42da231067f25104b71a065b4a50e68 pigsty-pkg-v3.2.0.d12.aarch64.tgz
ebb818f98f058f932b57d093d310f5c2 pigsty-pkg-v3.2.0.d12.x86_64.tgz
24c0be1d8436f3c64627c12f82665a17 pigsty-pkg-v3.2.0.u22.aarch64.tgz
0b9be0e137661e440cd4f171226d321d pigsty-pkg-v3.2.0.u22.x86_64.tgz
v3.1.0
亮点特性
- PostgreSQL 17 现已成为默认使用的主要版本 (17.2)
- Ubuntu 24.04 系统支持
- arm 架构支持:EL9, Debian12, Ubuntu 22.04
- Supabase 一键自建,新的剧本
supabase.yml - MinIO 最佳实践改进,配置模板与 Vagrant 模板
- 提供了一系列开箱即用的配置模板与文档说明。
- 允许在
configure过程中使用-v|--version指定使用的 PG 大版本。 - 调整 PG 默认插件策略:默认安装
pg_repack,wal2json以及pgvector三个关键扩展。 - 大幅简化
repo_packages本地软件源构建逻辑,允许在repo_packages中使用软件包组别名 - 提供了 WiltonDB,IvorySQL,PolarDB 的软件源镜像,简化三者的安装。
- 默认启用数据库校验和。
- 修复 ETCD 与 MINIO 日志面板
软件升级
- PostgreSQL 17.2, 16.6, 15.10, 14.15, 13.18, 12.22
- PostgreSQL 扩展版本变动请参考:https://pgext.cloud
- Patroni 4.0.4
- MinIO 20241107 / MCLI 20241117
- Rclone 1.68.2
- Prometheus: 2.54.0 -> 3.0.0
- VictoriaMetrics 1.102.1 -> 1.106.1
- VictoriaLogs v0.28.0 -> 1.0.0
- vslogcli 1.0.0
- MySQL Exporter 0.15.1 -> 0.16.0
- Redis Exporter 1.62.0 -> 1.66.0
- MongoDB Exporter 0.41.2 -> 0.42.0
- Keepalived Exporter 1.3.3 -> 1.4.0
- DuckDB 1.1.2 -> 1.1.3
- etcd 3.5.16 -> 3.5.17
- tigerbeetle 16.8 -> 0.16.13
API变更
repo_upstream: 针对每个具体的操作系统发行版生成默认值:roles/node_id/varsrepo_packages: 允许使用package_map中定义的别名。repo_extra_packages: 新增未指定时的默认值,允许使用package_map中定义的别名。pg_checksum: 默认值修改为true,默认打开。pg_packages: 默认值修改为:postgresql, wal2json pg_repack pgvector, patroni pgbouncer pgbackrest pg_exporter pgbadger vip-managerpg_extensions: 默认值修改为空数组[]。infra_portal: 允许为home服务器指定path,替代默认的本地仓库路径nginx_home(/www)
校验和
e62f9ce9f89a58958609da7b234bf2f2 pigsty-v3.1.0.tgz
v3.0.4
特性
- 针对 PostgreSQL 17 编译了所有支持的 Pigsty 扩展插件
- 提供了全新的 OLAP 扩展支持:
pg_duckdb与pg_parquet - 简化并优化了最新版本 Supabase 自建的流程
- 新增参数
docker_image,允许在 Docker 安装后自动拉取镜像。
扩展
欢迎查阅我们最新的 PostgreSQL 扩展目录: https://pgext.cloud
| 统计项 | 总计 | PGDG | PIGSTY | MISC | MISS | PG17 | PG16 | PG15 | PG14 | PG13 | PG12 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| EL系统扩展 | 338 | 134 | 130 | 4 | 7 | 298 | 334 | 336 | 328 | 319 | 310 |
| Deb系统扩展 | 326 | 109 | 143 | 74 | 19 | 290 | 322 | 324 | 316 | 307 | 300 |
| RPM 软件包 | 313 | 122 | 129 | 4 | 6 | 275 | 309 | 311 | 303 | 294 | 285 |
| DEB 软件包 | 298 | 93 | 142 | 64 | 19 | 264 | 294 | 296 | 288 | 279 | 272 |
版本升级
新的PGSQL扩展
升级与跟进PG扩展
- pg_search 0.11.0
- pg_analytics 0.2.0
- plv8 3.2.3
- supautils 2.5.0
- icu_ext 1.9.0
- redis_fdw 17
- pg_failover_slots 1.1.0
- pg_later 0.1.3
- plprql 1.0.0
- pg_vectorize 0.18.3
- unit 7.7 -> 7.9
- log_fdw 1.4
- pg_duckdb 0.1.0
- pg_graphql 1.5.9 (+17)
- pg_jsonschema 0.3.2 (+17)
- pgvectorscale 0.4.0 (+17)
- wrappers 0.4.3 +pg17
- pg_ivm 1.9
- pg_timeseries 0.1.6
- pgmq 1.4.4
- pg_protobuf 16 17
- pg_uuidv7 1.6
- pg_readonly
- pgddl 0.28
- pg_safeupdate
- pg_stat_monitor 2.1
- pg_profile 4.7
- system_stats 3.2
- pg_auth_mon 3.0
- login_hook 1.6
- logerrors 2.1.3
- pg-orphaned
- pgnodemx 1.7
- sslutils 1.4 (deb+pg16,17)
- timestamp9 (deb)
修复不支持PG16/17的扩展
- pg_mon
- pg_uri
- agg_for_vecs
- quantile
- lower_quantile
- pg_protobuf
- acl
- pg_emailaddr
- pg_zstd
- smlar
- geohash
- pgsmcrypto (+17)
- pg_tiktoken (+17)
- pg_idkit (+17)
基础设施软件包
- Grafana 11.3
- duckdb 1.1.2
- etcd 3.5.16
- ferretdb 1.24.0
- minio 20241013133411
- mcli 2024101313411
- pushgateway 1.10
- tigerbeetle 0.16.8
- mongodb_exporter 0.41.2
- redis_exporter 1.64.1
- vector 0.41.1
- vip-manager 2.7
- sealos 5.0.1
v3.0.3
特性
- 提供对最新发布的 PostgreSQL 17 支持。
- 优化了 etcd 配置,监控,与告警规则
- (Oracle兼容的)IvorySQL 3.4 支持,与 PostgreSQL 16.4 同步
版本升级
- PostGIS 3.5
- Grafana 11.2
- duckdb 1.1
- pg_search 0.10.2
- pg_analytics 0.1.4
v3.0.2
特性
- 精简安装模式:使用
slim.yml进行最精简的 HA PGSQL 部署。 - PolarDB PG 15 的原生支持。
- 优化
monitor.pg_table_bloat与monitor.pg_index_bloat,使用安全定义包装函数规避 PolarDB 统计视图权限问题。 - 在各模块的监控注册阶段,尊重
prometheus_enabled与grafana_enabled配置选项,关闭时不再注册。 - 在
/etc/profile.d/pgsql.sh中添加PGDATABASE与PGPORT环境变量,设置为pg_primary_db(默认postgres)
变更
- 在 Pigsty PGSQL 仓库中移除 PolarDB 11 与 CloudberryDB 1.5.4 的 RPM/APT 包。
- 使用专用的仓库分发 PolarDB 15 与 CloudberryDB 1.6.0 的 RPM/APT 包。
问题修复
- 修复 Redis 的
/etc/tmp.files.d文件名错误。 - 在管理 pgbouncer 用户时,设置
PGHOST与PGPORT环境变量。 - 临时移除
pg_snakeoil扩展支持,因为 EL8 上游源clamv出现依赖缺失问题。 - 移除
pgsql角色的 Notify / Handler,以兼容更老的 Ansible 2.9 版本。
v3.0.1
特性改进
- PolarDB Oracle 兼容性模式支持(需要第三方商业闭源内核)
- 使用 Oracle 兼容的 SQL 语法改写监控视图与相关 SQL 语句
- Patroni 4 支持与适配
- 新增扩展
pg_analytics,通过 duckdb 为 PG 加装分析能力 - 添加新扩展:
odbc_fdw与jdbc_fdw,提供通用的外部数据源连接能力 - 仓库添加新内核
cloudberrydb(Greenplum 原班开发者的开源分支) - 仓库添加新工具
walminer,从WAL(replica等级)中提取原始 SQL。(高级特性需自行购买License) - 更新执行计划可视化工具 Pev2 版本至 1.12.1
- 新增Grafana插件:
volkovlabs-rss-datasource - 在PGCAT databases监控面板中添加了已安装和待安装的扩展插件
- PGSQL 主库初始化后,会重启一次以便 pg_param & pg_files 生效,因此 Supabase PG / PolarDB 集群置备后无需重启。
问题修复
- 修复了 Grafana 11.1.4 面板插件默认不加载的问题
- 修复了特定操作系统上 BlackBox Exporter Ping 探针失效的问题
- 确保 /var/run/postgresql 与 /var/run/redis 临时目录总是在重启后自动创建
- 修复了
cache.yml剧本没有正确移除老旧的 patroni 3.0.4 RPM 包问题 - 修复了个别告警规则中的描述信息错误
- 移除了 Patroni 配置文件中过时的 Bootstrap User/HBA 参数
v3.0.0
亮点特性
- 扩展大爆炸:
Pigsty v3 提供了史无前例的 333 个可用扩展插件。 包括 121 个扩展 RPM包 与 133 个 DEB包,数量已经超过了 PGDG 官方仓库提供的扩展数量总和(135 RPM/ 109 DEB)。 而且,Pigsty 还将EL系统与Debian生态的独有PG扩展插件相互移植,实现了两大发行版的插件生态大对齐。
- timescaledb periods temporal_tables emaj table_version pg_cron pg_later pg_background pg_timetable
- postgis pgrouting pointcloud pg_h3 q3c ogr_fdw geoip #pg_geohash #mobilitydb
- pgvector pgvectorscale pg_vectorize pg_similarity pg_tiktoken pgml #smlar
- pg_search pg_bigm zhparser hunspell
- hydra pg_lakehouse pg_duckdb duckdb_fdw pg_fkpart pg_partman plproxy #pg_strom citus
- pg_hint_plan age hll rum pg_graphql pg_jsonschema jsquery index_advisor hypopg imgsmlr pg_ivm pgmq pgq #rdkit
- pg_tle plv8 pllua plprql pldebugger plpgsql_check plprofiler plsh #pljava plr pgtap faker dbt2
- prefix semver pgunit md5hash asn1oid roaringbitmap pgfaceting pgsphere pg_country pg_currency pgmp numeral pg_rational pguint ip4r timestamp9 chkpass #pg_uri #pgemailaddr #acl #debversion #pg_rrule
- topn pg_gzip pg_http pg_net pg_html5_email_address pgsql_tweaks pg_extra_time pg_timeit count_distinct extra_window_functions first_last_agg tdigest aggs_for_arrays pg_arraymath pg_idkit pg_uuidv7 permuteseq pg_hashids
- sequential_uuids pg_math pg_random pg_base36 pg_base62 floatvec pg_financial pgjwt pg_hashlib shacrypt cryptint pg_ecdsa pgpcre icu_ext envvar url_encode #pg_zstd #aggs_for_vecs #quantile #lower_quantile #pgqr #pg_protobuf
- pg_repack pg_squeeze pg_dirtyread pgfincore pgdd ddlx pg_prioritize pg_checksums pg_readonly safeupdate pg_permissions pgautofailover pg_catcheck preprepare pgcozy pg_orphaned pg_crash pg_cheat_funcs pg_savior table_log pg_fio #pgpool pgagent
- pg_profile pg_show_plans pg_stat_kcache pg_stat_monitor pg_qualstats pg_store_plans pg_track_settings pg_wait_sampling system_stats pg_meta pgnodemx pg_sqlog bgw_replstatus pgmeminfo toastinfo pagevis powa pg_top #pg_statviz #pgexporter_ext #pg_mon
- passwordcheck supautils pgsodium pg_vault anonymizer pg_tde pgsmcrypto pgaudit pgauditlogtofile pg_auth_mon credcheck pgcryptokey pg_jobmon logerrors login_hook set_user pg_snakeoil pgextwlist pg_auditor noset #sslutils
- wrappers multicorn mysql_fdw tds_fdw sqlite_fdw pgbouncer_fdw mongo_fdw redis_fdw pg_redis_pubsub kafka_fdw hdfs_fdw firebird_fdw aws_s3 log_fdw #oracle_fdw #db2_fdw
- orafce pgtt session_variable pg_statement_rollback pg_dbms_metadata pg_dbms_lock pgmemcache #pg_dbms_job #wiltondb
- pglogical pgl_ddl_deploy pg_failover_slots wal2json wal2mongo decoderbufs decoder_raw mimeo pgcopydb pgloader pg_fact_loader pg_bulkload pg_comparator pgimportdoc pgexportdoc #repmgr #slony
- gis-stack rag-stack fdw-stack fts-stack etl-stack feat-stack olap-stack supa-stack stat-stack json-stack
- 可插拔内核:
Pigsty v3 允许您更换 PostgreSQL 内核,目前支持了 SQL Server 兼容的 Babelfish (线缆协议级仿真),Oracle 兼容的 IvorySQL,以及 PG 版的 RAC PolarDB;此外,现在自托管 Supabase 也在 Debian 系统中可用。 您可以让 Pigsty 中带有 HA,IaC,PITR,监控的生产级 PostgreSQL 集群仿真 MSSQL (via WiltonDB),Oracle via (IvorySQL),Oracle RAC (via PolarDB), MongoDB(via FerretDB),以及 Firebase (via Supabase)。
- 专业级服务:
我们现在提供 Pigsty Pro 专业版,在开源版的功能基础上提供增值服务。专业版提供额外的功能模块:MSSQL,Oracle,Mongo,K8S,Victoria,Kafka,TigerBeetle 等……,并提供更广泛的 PG 大版本、操作系统、芯片架构的支持。 提供针对全系操作系统精准小版本定制的离线安装包,以及 EL7,Debian 11,Ubuntu 20.04 等过保老系统的支持;此外,专业版还提供内核可插拔定制服务,并对PolarDB PG 的原生部署、监控管控支持以满足“国产化”需要。
使用以下命令快速安装体验:
curl -fsSL https://repo.pigsty.cc/get | bash
cd ~/pigsty; ./bootstrap; ./configure; ./install.yml
重大变更
本次 Pigsty 发布调整大版本号,从 2.x 升级到 3.0,带有一些重大变更:
首要支持操作系统调整为:EL 8 / EL 9 / Debian 12 / Ubuntu 22.04
- EL7 / Debian 11 / Ubuntu 20.04 等系统进入弃用阶段,不再提供支持
- 有在这些系统上运行需求的用户请考虑我们的 订阅服务
默认使用在线安装,不再提供离线软件包,从而解决操作系统小版本兼容性问题。
bootstrap过程现在不再询问是否下载离线安装包,但如果/tmp/pkg.tgz存在,仍然会自动使用离线安装包。- 有离线安装需求请自行制作离线软件包或考虑我们的 订阅服务
Pigsty 使用的上游软件仓库进行统一调整,地址变更,并对所有软件包进行 GPG 签名与校验
- 标准仓库:
https://repo.pigsty.io/{apt/yum} - 国内镜像:
https://repo.pigsty.cc/{apt/yum}
- 标准仓库:
API 参数变更与配置模板变更
- EL 系与 Debian 系配置模板现在收拢统一,有差异的参数统一放置于
roles/node_id/vars/目录进行管理。 - 配置目录变更,所有配置文件模板统一放置在
conf目录下,并分为default,dbms,demo,build四大类。
- EL 系与 Debian 系配置模板现在收拢统一,有差异的参数统一放置于
其他新特性
- PG OLAP 分析能力史诗级加强:DuckDB 1.0.0,DuckDB FDW,以及 PG Lakehouse,Hydra 移植至 Deb 系统中。
- PG 向量检索与全文检索能力加强:Vectorscale 提供 DiskANN 向量索引,Hunspell 分词字典支持,pg_search 0.8.6。
- 帮助 ParadeDB 解决了软件包构建问题,现在我们在 Debian/Ubuntu 上也能提供这一扩展。
- Supabase 所需的扩展在 Debian/Ubuntu 上全部可用,Supabase 现在可在全OS上自托管。
- 提供了场景化预置扩展堆栈的能力,如果您不知道安装哪些扩展,我们准备了针对特定应用场景的扩展推荐包(Stack)。
- 针对所有 PostgreSQL 生态的扩展,制作了元数据表格、文档、索引、名称映射,针对 EL与Deb 进行对齐,确保扩展可用性。
- 为了解决 DockerHub 被 Ban 的问题,我们加强了
proxy_env参数的功能并简化其配置方式。 - 建设了一个专用的新软件仓库,提供了 12-17 版本的全部扩展插件,其中,PG16的扩展仓库会在 Pigsty 默认的版本中实装。
- 现有软件仓库升级改造,使用标准的签名与校验机制,确保软件包的完整性与安全性。APT 仓库采用新的标准布局通过
reprepro构建。 - 提供了 1,2,3,4,43 节点的沙箱环境:
meta,dual,trio,full,prod,以及针对 7 大 OS Distro 的快捷配置模板。 - PG Exporter 新增了 PostgreSQL 17 与 pgBouncer 1.23 新监控指标收集器的定义,与使用这些指标的 Grafana Panel
- 监控面板修缮,修复了各种问题,为 PGSQL Pgbouncer 与 PGSQL Patroni 监控面板添加了日志仪表盘。
- 使用全新的
cache.ymlAnsible 剧本,替换了原有制作离线软件包的bin/cache与bin/release-pkg脚本。
API变更
- 新参数选项:
pg_mode现在支持的模式有pgsql,citus,gpsql,mssql,ivory,polar,用于指定 PostgreSQL 集群的模式pgsql: 标准 PostgreSQL 高可用集群citus: Citus 水平分布式 PostgreSQL 原生高可用集群gpsql: 用于 Greenplum 与 GP 兼容数据库的监控(专业版)mssql: 安装 WiltonDB / Babelfish,提供 Microsoft SQL Server 兼容性模式的标准 PostgreSQL 高可用集群,线缆协议级支持,扩展不可用ivory: 安装 IvorySQL 提供的 Oracle 兼容性 PostgreSQL 高可用集群,Oracle语法/数据类型/函数/存储过程兼容,扩展不可用 (专业版)polar: 安装 PolarDB for PostgreSQL (PG RAC)开源版本,提供国产化数据库能力支持,扩展不可用。(专业版)
- 新参数:
pg_parameters,用于在实例级别指定postgresql.auto.conf中的参数,覆盖集群配置,实现不同实例成员的个性化配置。 - 新参数:
pg_files,用于将额外的文件拷贝到PGDATA数据目录,针对需要License文件的商业版PostgreSQL分叉内核设计。 - 新参数:
repo_extra_packages,用于额外指定需要下载的软件包,与repo_packages共同使用,便于指定OS版本独有的扩展列表。 - 参数重命名:
patroni_citus_db重命名为pg_primary_db,用于指定集群中的主要数据库(在 Citus 模式中使用) - 参数强化:
proxy_env中的代理服务器配置会写入 Docker Daemon,解决科学上网问题,configure -x选项会自动在配置中写入当前环境中的代理服务器配置。 - 参数强化:
infra_portal参数现在支持指定path选项,对外暴露本机上的目录,提供web服务。 - 参数强化:
repo_url_packages中的repo.pigsty.io会在区域为中国时自动替换为repo.pigsty.cc,解决科学上网问题,此外,现在可以指定下载后的文件名称。 - 参数强化:
pg_databases.extensions中的extension字段现在可以支持字典与扩展名字符串两种模式,字典模式提供version支持,允许安装特定版本的扩展。 - 参数强化:
repo_upstream参数如果没有显式覆盖定义,将从rpm.yml或deb.yml中定义的repo_upstream_default提取对应系统的默认值。 - 参数强化:
repo_packages参数如果没有显式覆盖定义,将从rpm.yml或deb.yml中定义的repo_packages_default提取对应系统的默认值。 - 参数强化:
infra_packages参数如果没有显式覆盖定义,将从rpm.yml或deb.yml中定义的infra_packages_default提取对应系统的默认值。 - 参数强化:
node_default_packages参数如果没有显式覆盖定义,将从rpm.yml或deb.yml中定义的node_packages_default提取对应系统的默认值。 - 参数强化:
pg_packages与pg_extensions中的扩展现在都会从rpm.yml或deb.yml中定义的pg_package_map执行一次查找与翻译。 - 参数强化:
node_packages与pg_extensions参数中指定的软件包在安装时会升级至最新版本,node_packages中现在默认值变为[openssh-server],帮助修复 OpenSSH CVE - 参数强化:
pg_dbsu_uid会自动根据操作系统类型调整为26(EL)或543(Debian),避免了手工调整。 - 设置了 pgbouncer 默认参数,
max_prepared_statements = 128启用了事物池化模式下的准备语句支持,并设置server_lifetime为 600, - 修改了 patroni 模板默认参数,统一增大
max_worker_processes+8 可用后端进程,提高max_wal_senders与max_replication_slots至 50,并增大 OLAP 模板临时文件的大小限制为主磁盘的 1/5
版本升级
截止至发布时刻,Pigsty 主要组件的版本升级如下:
- PostgreSQL 16.4, 15.8, 14.13, 13.16, 12.20
- pg_exporter : 0.7.0
- Patroni: 3.3.2
- pgBouncer: 1.23.1
- pgBackRest: 2.53.1
- duckdb : 1.0.0
- etcd : 3.5.15
- pg_timetable: 5.9.0
- ferretdb: 1.23.1
- vip-manager: 2.6.0
- minio: 20240817012454
- mcli: 20240817113350
- grafana : 11.1.4
- loki : 3.1.1
- promtail : 3.0.0
- prometheus : 2.54.0
- pushgateway : 1.9.0
- alertmanager : 0.27.0
- blackbox_exporter : 0.25.0
- nginx_exporter : 1.3.0
- node_exporter : 1.8.2
- keepalived_exporter : 0.7.0
- pgbackrest_exporter 0.18.0
- mysqld_exporter : 0.15.1
- redis_exporter : v1.62.0
- kafka_exporter : 1.8.0
- mongodb_exporter : 0.40.0
- VictoriaMetrics : 1.102.1
- VictoriaLogs : v0.28.0
- sealos: 5.0.0
- vector : 0.40.0
Pigsty 重新编译了所有 PostgreSQL 扩展插件,PostgreSQL 扩展插件的最新版本,可用的 333 个扩展插件请参考 扩展列表
新应用
Pigsty 现在提供开箱即用的 Dify 与 Odoo 两款使用 PostgreSQL 软件的 Docker Compose 模板:
- Dify: AI智能体工作流编排与 LLMOps,使用 PostgreSQL 作为元数据库,PGVector 作为向量存储。
- Odoo: 企业级开源 ERP 系统,使用 PostgreSQL 作为底层数据库。
Pigsty 专业版现在提供试点的 Kubernetes 部署支持与 Kafka KRaft 集群部署与监控支持
KUBE: 使用 cri-dockerd 或 containerd 部署由 Pigsty 托管的 Kubernetes 集群KAFKA:部署由 Kraft 协议支持的高可用 Kafka 集群
问题修复
- 修复了 Ubuntu / Debian 系统中,节点重启后可能出现的 postgresql-common 服务自动启动替代默认数据库集群的缺陷
- 通过
node_packages中的默认值[openssh-server],CVE-2024-6387 可以在 Pigsty 安装过程中被自动修复。 - 修复了 Loki 解析 Nginx 日志标签基数过大导致的内存消耗问题。
- 修复了 EL8 系统中上游 Ansible 依赖变化导致的 bootstrap 失效问题(python3.11-jmespath 升级至 python3.12-jmespath)
v2.7.0
亮点特性
新增了大量强力扩展插件,特别是一些使用 rust 与 pgrx 进行开发的强力扩展:
- pg_search v0.7.0:使用 BM25 算法对 SQL 表进行全文搜索
- pg_lakehouse v0.7.0:在对象存储(如 S3)和表格式(如 DeltaLake)上进行查询的引擎
- pg_analytics v0.6.1:加速 PostgreSQL 内部的分析查询处理
- pg_graphql v1.5.4:为 PostgreSQL 数据库提供 GraphQL 支持
- pg_jsonschema v0.3.1:提供 JSON Schema 校验的 PostgreSQL 扩展
- wrappers v0.3.1:由 Supabase 提供的 PostgreSQL 外部数据封装器集合
- pgmq v1.5.2:轻量级消息队列,类似于 AWS SQS 和 RSMQ
- pg_tier v0.0.3:支将将冷数据分级存储到 AWS S3
- pg_vectorize v0.15.0: 在 PG 中实现 RAG 向量检索的封装
- pg_later v0.1.0:现在执行 SQL,并在稍后获取结果
- pg_idkit v0.2.3:生成多种流行类型的标识符(UUID)
- plprql v0.1.0:在 PostgreSQL 中使用 PRQL 查询语言
- pgsmcrypto v0.1.0:PostgreSQL 的国密 SM 算法扩展
- pg_tiktoken v0.0.1:计算 OpenAI 使用的 Token 数量
- pgdd v0.5.2:通过纯 SQL 接口,访问数据目录的元数据
当然,也有一些使用原生 C 和 C++ 开发的强力扩展:
- parquet_s3_fdw 1.1.0:从 S3 存取 Parquet 格式文件,作为湖仓之用
- plv8 3.2.2:使用 V8 引擎,允许在 PostgreSQL 中使用 Javascript 语言编写存储过程
- md5hash 1.0.1:用于存储原生MD5哈希数据类型,而非文本。
- pg_tde 1.0 alpha:PostgreSQL 的实验性加密存储引擎。
- pg_dirtyread 2.6:从 PostgreSQL 表中读取未清理的死元组,用于脏读
- 新的 deb PGDG 扩展:
pg_roaringbitmap,pgfaceting,mobilitydb,pgsql-http,pg_hint_plan,pg_statviz,pg_rrule - 新的 rpm PGDG 扩展:
pg_profile,pg_show_plans, 使用 PGDG 的pgsql_http,pgsql_gzip,pg_net,pg_bigm替代 Pigsty 维护的 RPM。
新特性
- 允许 Pigsty 在特定 Docker 虚拟机镜像中运行。
- 针对 Ubuntu 与 EL 系操作系统发行版准备了 INFRA & PGSQL 模块的 arm64 软件包
- 新安装脚本,可从 cloudflare 下载软件,可以指定版本,提供更完善的提示信息。
- 新增的 PGSQL PITR 监控面板,用于在 PITR 过程中提供更好的可观测性
- 针对在 Docker 虚拟机镜像中运行 Pigsty 进行了一系列铺垫与准备。
- 新增了 防呆设计,避免在非 Pigsty 纳管的节点上运行 pgsql.yml 剧本 (AdamYLK)
- 针对每个支持的发行版大版本配置了独立的配置文件:el7, el8, el9, debian11, debian12, ubuntu20, ubuntu22
软件版本升级
- PostgreSQL 16.3
- Patroni 3.3.0
- pgBackRest 2.51
- VIP-Manager v2.5.0
- Haproxy 2.9.7
- Grafana 10.4.2
- Prometheus 2.51
- Loki & Promtail: 3.0.0 (警告:大版本非兼容性变更!)
- Alertmanager 0.27.0
- BlackBox Exporter 0.25.0
- Node Exporter 1.8.0
- pgBackrest Exporter 0.17.0
- duckdb 0.10.2
- etcd 3.5.13
- minio-20240510014138 / mcli-20240509170424
- pev2 v1.8.0 -> v1.11.0
- pgvector 0.6.1 -> 0.7.0
- pg_tle: v1.3.4 -> v1.4.0
- hydra: v1.1.1 -> v1.1.2
- duckdb_fdw: v1.1.0 重新针对 libduckdb 0.10.2 进行编译
- pg_bm25 0.5.6 -> pg_search 0.7.0
- pg_analytics: 0.5.6 -> 0.6.1
- pg_graphql: 1.5.0 -> 1.5.4
- pg_net 0.8.0 -> 0.9.1
- pg_sparse (deprecated)
Docker应用模板
- Odoo:开源 ERP 软件与插件
- Jupyter:使用容器运行 Jupyter Notebook
- PolarDB:运行“国产数据库” PolarDB,应付信创检查!
- supabase:更新至最近的 GA 版本
- bytebase:使用
latest标签替代特定版本号。 - pg_exporter:更新了 Docker 镜像的例子。
缺陷修复
- 修复了 pg_exporters 角色中的变量空白问题。
- 修复了
minio_cluster变量没有在全局配置中注释掉的问题 - 修复了 EL7 模板中的
postgis34插件名称问题,应该使用postgis33 - 修复了 EL8
python3.11-cryptography依赖名的问题,上游现在变更为python3-cryptography。 - 修复了
/pg/bin/pg-role无法在非交互式 Shell 模式下获取操作系统用户名的问题 - 修复了
/pg/bin/pg-pitr无法正确提示-X-P选项的问题
API变更
- 新参数
node_write_etc_hosts,用于控制是否向目标节点的/etc/hosts文件写入静态 DNS 解析记录 - 新增了
prometheus_sd_dir参数,用于指定 Prometheus 静态服务发现的目标文件目录 - configure 脚本新增了
-x|--proxy参数,用于将当前环境的代理信息写入配置文件 by @waitingsong in https://github.com/Vonng/pigsty/pull/405 - 不再使用 Promtail & Loki 解析 Infra 节点上的 Nginx 日志细节标签,因为这样会导致标签基数爆炸。
- 在 Prometheus 配置中使用 alertmanager API v2 替代 v1
- 在 PGSQL 模块中,使用
/pg/cert/ca.crt代替/etc/pki/ca.crt,降低对节点根证书的依赖。
新的贡献者
- @NeroSong made their first contribution in https://github.com/Vonng/pigsty/pull/373
- @waitingsong made their first contribution in https://github.com/Vonng/pigsty/pull/405
完整的变更日志: https://github.com/Vonng/pigsty/compar
离线软件包校验和
ec271a1d34b2b1360f78bfa635986c3a pigsty-pkg-v2.7.0.el8.x86_64.tgz
f3304bfd896b7e3234d81d8ff4b83577 pigsty-pkg-v2.7.0.debian12.x86_64.tgz
5b071c2a651e8d1e68fc02e7e922f2b3 pigsty-pkg-v2.7.0.ubuntu22.x86_64.tgz
v2.6.0
亮点特性
- 现已将 PostgreSQL 16 作为默认主要版本(16.2)
- 新增 ParadeDB 扩展插件:
pg_analytics,pg_bm25, andpg_sparse - 新增 DuckDB 与
duckdb_fdw插件支持 - 全球 Cloudflare CDN https://repo.pigsty.io 与中国大陆CDN https://repo.pigsty.cc
软件配置变更
- 使用
node_repo_modules替换node_repo_method参数,并移除node_repo_local_urls参数。 - 暂时关闭 Grafana 统一告警功能,避免 “Database Locked” 错误。
- 新增
node_repo_modules参数,用于指定在节点上添加的上游仓库源。 - 移除
node_local_repo_urls,其功能由node_repo_modules&repo_upstream替代。 - 移除
node_repo_method参数,其功能由node_repo_modules替代。 - 在
repo_upstream添加新的local源,并通过node_repo_modules使用,替代node_local_repo_urls的功能 - 重排
node_default_packages,infra_packages,pg_packages,pg_extensions参数默认值。 - 在
repo_upstream中替换repo_upstream.baseurl时,如果 EL8/9 PGDG小版本特定的仓库可用,使用major.minor而不是major替换 $releasever,提高小版本兼容性。
软件版本升级
- Grafana 10.3
- Prometheus 2.47
- node_exporter 1.7.0
- HAProxy 2.9.5
- Loki / Promtail 2.9.4
- minio-20240216110548 / mcli-20240217011557
- etcd 3.5.11
- Redis 7.2.4
- Bytebase 2.13.2
- DuckDB 0.10.0
- FerretDB 1.19
- Metabase:新Docker应用模板
PostgreSQL扩展插件
- PostgreSQL 小版本升级: 16.2, 15.6, 14.11, 13.14, 12.18
- PostgreSQL 16: 现在被提升为默认主版本
- pg_exporter 0.6.1:安全修复
- Patroni 3.2.2
- pgBadger 12.4
- pgBackRest 2.50
- vip-manager 2.3.0
- PostGIS 3.4.2
- TimescaleDB 2.14.1
- 向量扩展 PGVector 0.6.0:新增并行创建 HNSW 索引功能
- 新增扩展插件 duckdb_fdw v1.1 ,支持读写 DuckDB 数据 v1.1
- 新增扩展插件 pgsql-gzip ,用于支持 Gzip 压缩解压缩 v1.0.0
- 新增扩展插件 pg_sparse,高效处理稀疏向量(ParadeDB) v0.5.6
- 新增扩展插件 pg_bm25,用于支持高质量全文检索 BM25 算法的插件(ParadeDB) v0.5.6
- 新增扩展插件 pg_analytics,支持 SIMD 与列式存储的PG分析插件(ParadeDB) v0.5.6
- 升级AIML插件 pgml 至 v2.8.1,新增 PG 16 支持。
- 升级列式存储插件 hydra 版本至 v1.1.1,新增 PG 16 支持。
- 升级图扩展插件 age 至 v1.5.0,新增 PG 16 支持。
- 升级GraphQL插件 pg_graphql 版本至 v1.5.0 ,支持 Supabase。
330e9bc16a2f65d57264965bf98174ff pigsty-v2.6.0.tgz
81abcd0ced798e1198740ab13317c29a pigsty-pkg-v2.6.0.debian11.x86_64.tgz
7304f4458c9abd3a14245eaf72f4eeb4 pigsty-pkg-v2.6.0.debian12.x86_64.tgz
f914fbb12f90dffc4e29f183753736bb pigsty-pkg-v2.6.0.el7.x86_64.tgz
fc23d122d0743d1c1cb871ca686449c0 pigsty-pkg-v2.6.0.el8.x86_64.tgz
9d258dbcecefd232f3a18bcce512b75e pigsty-pkg-v2.6.0.el9.x86_64.tgz
901ee668621682f99799de8932fb716c pigsty-pkg-v2.6.0.ubuntu20.x86_64.tgz
39872cf774c1fe22697c428be2fc2c22 pigsty-pkg-v2.6.0.ubuntu22.x86_64.tgz
v2.5.1
跟进 PostgreSQL v16.1, v15.5, 14.10, 13.13, 12.17, 11.22 小版本例行更新。
现在 PostgreSQL 16 的所有重要扩展已经就位(新增 pg_repack 与 timescaledb 支持)
- 软件更新:
- PostgreSQL to v16.1, v15.5, 14.10, 13.13, 12.17, 11.22
- Patroni v3.2.0
- PgBackrest v2.49
- Citus 12.1
- TimescaleDB 2.13
- Grafana v10.2.0
- FerretDB 1.15
- SealOS 4.3.7
- Bytebase 2.11.1
- 移除 PGCAT 监控面板中查询对
monitor模式前缀(允许用户将pg_stat_statements扩展装到别的地方) - 新的配置模板
wool.yml,为阿里云免费99 ECS 单机针对设计。 - 为 EL9 新增
python3-jmespath软件包,解决 Ansible 依赖更新后 bootstrap 缺少 jmespath 的问题
31ee48df1007151009c060e0edbd74de pigsty-pkg-v2.5.1.el7.x86_64.tgz
a40f1b864ae8a19d9431bcd8e74fa116 pigsty-pkg-v2.5.1.el8.x86_64.tgz
c976cd4431fc70367124fda4e2eac0a7 pigsty-pkg-v2.5.1.el9.x86_64.tgz
7fc1b5bdd3afa267a5fc1d7cb1f3c9a7 pigsty-pkg-v2.5.1.debian11.x86_64.tgz
add0731dc7ed37f134d3cb5b6646624e pigsty-pkg-v2.5.1.debian12.x86_64.tgz
99048d09fa75ccb8db8e22e2a3b41f28 pigsty-pkg-v2.5.1.ubuntu20.x86_64.tgz
431668425f8ce19388d38e5bfa3a948c pigsty-pkg-v2.5.1.ubuntu22.x86_64.tgz
v2.5.0
curl https://get.pigsty.cc/latest | bash
亮点特性
使用CDN
repo.pigsty.cc软件源,提供 rpm/deb 软件包下载。Anolis 操作系统支持( 兼容 EL 8.8 )。
使用 PostgreSQL 16 替代 PostgreSQL 14 作为备选主要支持版本
新增了 PGSQL Exporter / PGSQL Patroni 监控面板,重做 PGSQL Query 面板
扩展更新:
- PostGIS 版本至 3.4( EL8/EL9 ),EL7 仍使用 PostGIS 3.3
- 移除
pg_embedding,因为开发者不再对其进行维护,建议使用pgvector替换。 - 新扩展(EL):点云插件
pointcloud支持,Ubuntu原生带有此扩展。 - 新扩展(EL):
imgsmlr,pg_similarity,pg_bigm用于搜索。 - 重新编译
pg_filedump为 PG 大版本无关的软件包。。 - 新收纳
hydra列存储扩展,不再默认安装citus扩展。
软件更新:
- Grafana 更新至 v10.1.5
- Prometheus 更新至 v2.47
- Promtail/Loki 更新至 v2.9.1
- Node Exporter 更新至 v1.6.1
- Bytebase 更新至 v2.10.0
- patroni 更新至 v3.1.2
- pgbouncer 更新至 v1.21.0
- pg_exporter 更新至 v0.6.0
- pgbackrest 更新至 v2.48.0
- pgbadger 更新至 v12.2
- pg_graphql 更新至 v1.4.0
- pg_net 更新至 v0.7.3
- ferretdb 更新至 v0.12.1
- sealos 更新至 4.3.5
- Supabase 支持更新至
20231013070755
Ubuntu 支持说明
Pigsty 支持了 Ubuntu 22.04 (jammy) 与 20.04 (focal) 两个 LTS 版本,并提供相应的离线软件安装包。
相比 EL 系操作系统,一些参数的默认值需要显式指定调整,详情请参考 ubuntu.yml
repo_upstream:按照 Ubuntu/Debian 的包名进行了调整repo_packages:按照 Ubuntu/Debian 的包名进行了调整node_repo_local_urls:默认值为['deb [trusted=yes] http://${admin_ip}/pigsty ./']node_default_packages:zlib->zlib1g,readline->libreadline-devvim-minimal->vim-tiny,bind-utils->dnsutils,perf->linux-tools-generic,- 新增软件包
acl,确保 Ansible 权限设置正常工作
infra_packages:所有含_的包要替换为-版本,此外postgresql-client-16用于替换postgresql16pg_packages:Ubuntu 下惯用-替代_,不需要手工安装patroni-etcd包。pg_extensions:扩展名称与EL系不太一样,Ubuntu下缺少passwordcheck_cracklib扩展。pg_dbsu_uid: Ubuntu 下 Deb 包不显式指定uid,需要手动指定,Pigsty 默认分配为543
API变更
默认值变化:
repo_modules现在的默认值为infra,node,pgsql,redis,minio,启用所有上游源repo_upstream发生变化,现在添加了 Pigsty Infra/MinIO/Redis/PGSQL 模块化软件源repo_packages发生变化,移除未使用的karma,mtail,dellhw_exporter,移除了 PG14 主要扩展,新增了 PG16 主要扩展,添加了 virtualenv 包。node_default_packages发生变化,默认安装python3-pip组件。pg_libs:timescaledb从 shared_preload_libraries 中移除,现在默认不自动启用。pg_extensions发生变化,不再默认安装 Citus 扩展,默认安装passwordcheck_cracklib扩展,EL8,9 PostGIS 默认版本升级至 3.4- pg_repack_${pg_version}* wal2json_${pg_version}* passwordcheck_cracklib_${pg_version}* - postgis34_${pg_version}* timescaledb-2-postgresql-${pg_version}* pgvector_${pg_version}*Patroni 所有模板默认移除
wal_keep_size参数,避免触发 Patroni 3.1.1 的错误,其功能由min_wal_size覆盖。
87e0be2edc35b18709d7722976e305b0 pigsty-pkg-v2.5.0.el7.x86_64.tgz
e71304d6f53ea6c0f8e2231f238e8204 pigsty-pkg-v2.5.0.el8.x86_64.tgz
39728496c134e4352436d69b02226ee8 pigsty-pkg-v2.5.0.el9.x86_64.tgz
e3f548a6c7961af6107ffeee3eabc9a7 pigsty-pkg-v2.5.0.debian11.x86_64.tgz
1e469cc86a19702e48d7c1a37e2f14f9 pigsty-pkg-v2.5.0.debian12.x86_64.tgz
cc3af3b7c12f98969d3c6962f7c4bd8f pigsty-pkg-v2.5.0.ubuntu20.x86_64.tgz
c5b2b1a4867eee624e57aed58ac65a80 pigsty-pkg-v2.5.0.ubuntu22.x86_64.tgz
v2.4.1
- Supabase 支持:开源的 Firebase 替代,现可使用 Pigsty 本地托管的 PostgreSQL 实例作为数据存储。
- PostgresML支持:使用SQL完成经典机器学习算法,训练、微调、调用大语言模型(hugging face)。
- FerretDB v1.10 支持,在 PostgreSQL 上提供 MongoDB API与协议兼容能力。
- GraphQL扩展:
pg_graphql:从现有模式中反射出 GraphQL 模式,提供库内 GraphQL 查询能力。 - JWT支持扩展:
pgjwt允许您使用 SQL 验证签发 JWT (JSON Web Tokens)。 - 密钥存储扩展:
vault可以在提供一个安全存储加密密钥的保险柜。 - 数据恢复扩展:
pg_filedump:可用于快速从PostgreSQL二进制文件中恢复数据 - 图数据库扩展:Apache
age,为 PostgreSQL 添加 OpenCypher 查询支持,类似 Neo4J - 中文分词扩展:
zhparser,为中文全文检索提供分词能力,类似 ElasticSearch。 - 高效位图扩展:
pg_roaringbitmap,在 PostgreSQL 中提供 roaring bitmap 的支持,高效计数聚合统计。 - 向量嵌入替代:
pg_embedding,提供了不同于 pgvector 的另一种 HNSW 替代实现。 - 可信语言扩展:
pg_tle,由 AWS 出品的,允许您打包分发管理由可信存储过程语言编写的函数。 - HTTP客户端扩展:
pgsql-http:使用 SQL 接口,curl API,发起 HTTP 请求,与各类系统交互。 - 异步HTTP扩展:
pg_net允许您使用 SQL 发起非阻塞的 HTTP/HTTPS 请求。 - 列式存储引擎:
hydra针对分析场景打造的向量化列存储引擎,原地替代 Citus 列存插件。 - 其他PGDG扩展:新收录8个由PGDG维护的扩展插件,Pigsty支持的插件总数达到 150+ 。
- PostgreSQL 16 内核支持,监控云端 RDS / PolarDB for PostgreSQL。
亮点特性
- Supabase 支持:开源的 Firebase 替代,现可使用 Pigsty 托管的 PostgreSQL 实例存储数据。
- PostgresML支持:在 PostgreSQL 运行各类模型(hugging face),向量操作,经典机器学习算法。
- GraphQL支持扩展:
pg_graphql:从现有模式中反射出 GraphQL 模式,提供库内 GraphQL 查询能力。 - 异步HTTP客户端扩展:
pg_net允许您使用 SQL 发起非阻塞的 HTTP/HTTPS 请求 - JWT支持扩展:
pgjwt允许您使用 SQL 验证签发 JWT (JSON Web Tokens) - 密钥存储扩展:
vault可以在保险柜里存储加密密钥 - 将FerretDB 版本升级至 v1.10
- 新增组件:
pg_filedump:可用于快速从PostgreSQL二进制文件中恢复数据 - 减少 EL9 离线软件包的大小,移除非必须依赖项
proj-data* - 修复了 Patroni 3.1.1 的错误
efabe7632d8994f3fb58f9838b8f9d7d pigsty-pkg-v2.5.0.el7.x86_64.tgz # 1.1G
ea78957e8c8434b120d1c8c43d769b56 pigsty-pkg-v2.5.0.el8.x86_64.tgz # 1.4G
4ef280a7d28872814e34521978b851bb pigsty-pkg-v2.5.0.el9.x86_64.tgz # 1.3G
v2.4.0
使用 bash -c "$(curl -fsSL https://get.pigsty.cc/latest)" 快速上手。
最新特性
- PostgreSQL 16 正式发布,Pigsty提供支持。
- 可以监控云数据库,RDS for PostgreSQL,以及 PolarDB,提供全新的 PGRDS 监控面板
- 正式提供商业支持与咨询服务。并发布首个 LTS 版本,为订阅客户提供最长5年的支持。
- 新扩展插件: Apache AGE, openCypher graph query engine on PostgreSQL
- 新扩展插件: zhparser, full text search for Chinese language
- 新扩展插件: pg_roaringbitmap, roaring bitmap for PostgreSQL
- 新扩展插件: pg_embedding, hnsw alternative to pgvector
- 新扩展插件: pg_tle, admin / manage stored procedure extensions
- 新扩展插件: pgsql-http, issue http request with SQL interface
- 新增插件: pg_auth_mon pg_checksums pg_failover_slots pg_readonly postgresql-unit pg_store_plans pg_uuidv7 set_user
- Redis改进:支持 Redis 哨兵监控,配置主从集群的自动高可用。
API变化
- 新增参数,
REDIS.redis_sentinel_monitor,用于指定 Sentinel 集群监控的主库列表
问题修复
- 修复 Grafana 10.1 注册数据源时缺少
uid的问题
MD5 (pigsty-pkg-v2.4.0.el7.x86_64.tgz) = 257443e3c171439914cbfad8e9f72b17
MD5 (pigsty-pkg-v2.4.0.el8.x86_64.tgz) = 41ad8007ffbfe7d5e8ba5c4b51ff2adc
MD5 (pigsty-pkg-v2.4.0.el9.x86_64.tgz) = 9a950aed77a6df90b0265a6fa6029250
v2.3.1
使用 bash -c "$(curl -fsSL https://get.pigsty.cc/latest)" 快速开始。
最新特性
pgvector更新至 0.5,添加 hnsw 算法支持。- 支持 PostgreSQL 16 RC1 (el8/el9)
- 默认包中添加了 SealOS 用于快速部署Kubernetes集群。
问题修复
- 修复了
infra.repo.repo_pkg任务:当repo_packages中包名包含*时,下载可能会受到/www/pigsty现有内容的影响。 - 将
vip_dns_suffix的默认值由.vip调整为空字符串,即集群本身的名称将默认作为节点集群的 L2 VIP modprobe watchdogandchown watchdogifpatroni_watchdog_modeisrequired- 当
pg_dbsu_sudo=limitandpatroni_watchdog_mode=required时,授予数据库 dbsu 以下命令的 sudo 执行权限/usr/bin/sudo /sbin/modprobe softdog:在启动 Patroni 服务时确保 softdog 内核模块启用/usr/bin/sudo /bin/chown {{ pg_dbsu }} /dev/watchdog: 在启动 Patroni 服务时,确保 watchdog 属主正确
文档更新
- 向英文文档中添加了更新内容。
- 添加了简体中文版本的内置文档,修复了 pigsty.cc 文档站的中文文档。
软件更新
- PostgreSQL 16 RC1 for EL8/EL9
- PGVector 0.5.0,支持 hnsw 索引
- TimescaleDB 2.11.2
- grafana 10.1.0
- loki & promtail 2.8.4
- redis-stack 7.2 on el7/8
- mcli-20230829225506 / minio-20230829230735
- ferretdb 1.9
- sealos 4.3.3
- pgbadger 1.12.2
ce69791eb622fa87c543096cdf11f970 pigsty-pkg-v2.3.1.el7.x86_64.tgz
495aba9d6d18ce1ebed6271e6c96b63a pigsty-pkg-v2.3.1.el8.x86_64.tgz
38b45582cbc337ff363144980d0d7b64 pigsty-pkg-v2.3.1.el9.x86_64.tgz
v2.3.0
相关文章:《Pigsty v2.3 发布:应用生态丰富》
发布注记:https://github.com/Vonng/pigsty/releases/tag/v2.3.0
使用 bash -c "$(curl -fsSL https://get.pigsty.cc/latest)" 快速开始。
亮点特性
- INFRA: 添加了对 NODE/PGSQL VIP 的监控支持
- PGSQL: 通过小版本升级修复了 PostgreSQL CVE-2023-39417: 15.4, 14.9, 13.12, 12.16,以及 Patroni v3.1.0
- NODE: 允许用户使用
keepalived为一个节点集群绑定 L2 VIP - REPO: Pigsty 专用 yum 源优化精简,全站默认使用 HTTPS:
get.pigsty.cc与demo.pigsty.cc - APP: 升级
app/bytebase版本至 v2.6.0,app/ferretdb版本至 v1.8;添加新的应用模板:nocodb,开源的 Airtable。 - REDIS: 升级版本至 v7.2,并重制了 Redis 监控面板。
- MONGO: 添加基于 FerretDB 1.8 实现的基本支持。
- MYSQL: 添加了 Prometheus / Grafana / CA 中的代码存根,便于后续纳管。
API变化
新增一个新的参数组 NODE.NODE_VIP:包含 8 个新参数
NODE.VIP.vip_enabled:在此节点集群上启用 vip 吗?NODE.VIP.vip_address:ipv4 格式的节点 vip 地址,如果启用了 vip,则必需NODE.VIP.vip_vrid:必需,整数,1-255 在相同 VLAN 中应该是唯一的NODE.VIP.vip_role:master/backup,默认为备份,用作初始角色NODE.VIP.vip_preempt:可选,true/false,默认为 false,启用 vip 抢占NODE.VIP.vip_interface:节点 vip 网络接口监听,eth0 默认NODE.VIP.vip_dns_suffix:节点 vip dns 名称后缀,默认为空字符串NODE.VIP.vip_exporter_port:keepalived 导出器监听端口,默认为 9650
MD5 (pigsty-pkg-v2.3.0.el7.x86_64.tgz) = 81db95f1c591008725175d280ad23615
MD5 (pigsty-pkg-v2.3.0.el8.x86_64.tgz) = 6f4d169b36f6ec4aa33bfd5901c9abbe
MD5 (pigsty-pkg-v2.3.0.el9.x86_64.tgz) = 4bc9ae920e7de6dd8988ca7ee681459d
v2.2.0
相关文章:《Pigsty v2.2 发布 —— 监控系统大升级》
发布注记:https://github.com/Vonng/pigsty/releases/tag/v2.2.0
快速开始: bash -c "$(curl -fsSL https://get.pigsty.cc/latest)"
亮点特性
- 监控面板重做: https://demo.pigsty.cc
- Vagrant沙箱重做: 支持 libvirt 与新的配置模板
- Pigsty EL Yum 仓库: 统一收纳零碎 RPM,简化安装构建流程。
- 操作系统兼容性: 新增信创操作系统 UOS-v20-1050e 支持
- 新的配置模板:42 节点的生产仿真配置
- 统一使用官方 PGDG citus 软件包(el7)
软件升级
- PostgreSQL 16 beta2
- Citus 12 / PostGIS 3.3.3 / TimescaleDB 2.11.1 / PGVector 0.44
- patroni 3.0.4 / pgbackrest 2.47 / pgbouncer 1.20
- grafana 10.0.3 / loki/promtail/logcli 2.8.3
- etcd 3.5.9 / haproxy v2.8.1 / redis v7.0.12
- minio 20230711212934 / mcli 20230711233044
Bug修复
- 修复了 Docker 组权限的问题 29434bd
- 将
infra操作系统用户组作为额外的组,而不是首要用户组。 - 修复了 Redis Sentinel Systemd 服务的自动启用状态 5c96feb
- 放宽了
bootstrap&configure的检查,特别是当/etc/redhat-release不存在的时候。 - 升级到 Grafana 10,修复了 Grafana 9.x CVE-2023-1410
- 在 CMDB
pglog模式中添加了 PG 14 - 16 的 command tags 与 错误代码。
API变化
新增1个变量
INFRA.NGINX.nginx_exporter_enabled: 现在用户可以通过设置这个参数来禁用 nginx_exporter 。
默认值变化:
repo_modules:node,pgsql,infra: redis 现在由 pigsty-el 仓库提供,不再需要redis模块。repo_upstream:- 新增
pigsty-el: 与具体EL版本无关的RPM: 例如 grafana, minio, pg_exporter, 等等…… - 新增
pigsty-misc: 与具体EL版本有关的RPM: 例如 redis, prometheus 全家桶,等等…… - 移除
citus: 现在 PGDG 中有完整的 EL7 - EL9 citus 12 支持 - 移除
remi: redis 现在由 pigsty-el 仓库提供,不再需要redis模块。
- 新增
repo_packages:- ansible python3 python3-pip python3-requests python3-jmespath python3.11-jmespath dnf-utils modulemd-tools # el7: python36-requests python36-idna yum-utils
- grafana loki logcli promtail prometheus2 alertmanager karma pushgateway node_exporter blackbox_exporter nginx_exporter redis_exporter
- redis etcd minio mcli haproxy vip-manager pg_exporter nginx createrepo_c sshpass chrony dnsmasq docker-ce docker-compose-plugin flamegraph
- lz4 unzip bzip2 zlib yum pv jq git ncdu make patch bash lsof wget uuid tuned perf nvme-cli numactl grubby sysstat iotop htop rsync tcpdump
- netcat socat ftp lrzsz net-tools ipvsadm bind-utils telnet audit ca-certificates openssl openssh-clients readline vim-minimal
- postgresql13* wal2json_13* pg_repack_13* passwordcheck_cracklib_13* postgresql12* wal2json_12* pg_repack_12* passwordcheck_cracklib_12* timescaledb-tools
- postgresql15 postgresql15* citus_15* pglogical_15* wal2json_15* pg_repack_15* pgvector_15* timescaledb-2-postgresql-15* postgis33_15* passwordcheck_cracklib_15* pg_cron_15*
- postgresql14 postgresql14* citus_14* pglogical_14* wal2json_14* pg_repack_14* pgvector_14* timescaledb-2-postgresql-14* postgis33_14* passwordcheck_cracklib_14* pg_cron_14*
- postgresql16* wal2json_16* pgvector_16* pg_squeeze_16* postgis34_16* passwordcheck_cracklib_16* pg_cron_16*
- patroni patroni-etcd pgbouncer pgbadger pgbackrest pgloader pg_activity pg_partman_15 pg_permissions_15 pgaudit17_15 pgexportdoc_15 pgimportdoc_15 pg_statement_rollback_15*
- orafce_15* mysqlcompat_15 mongo_fdw_15* tds_fdw_15* mysql_fdw_15 hdfs_fdw_15 sqlite_fdw_15 pgbouncer_fdw_15 multicorn2_15* powa_15* pg_stat_kcache_15* pg_stat_monitor_15* pg_qualstats_15 pg_track_settings_15 pg_wait_sampling_15 system_stats_15
- plprofiler_15* plproxy_15 plsh_15* pldebugger_15 plpgsql_check_15* pgtt_15 pgq_15* pgsql_tweaks_15 count_distinct_15 hypopg_15 timestamp9_15* semver_15* prefix_15* rum_15 geoip_15 periods_15 ip4r_15 tdigest_15 hll_15 pgmp_15 extra_window_functions_15 topn_15
- pg_background_15 e-maj_15 pg_catcheck_15 pg_prioritize_15 pgcopydb_15 pg_filedump_15 pgcryptokey_15 logerrors_15 pg_top_15 pg_comparator_15 pg_ivm_15* pgsodium_15* pgfincore_15* ddlx_15 credcheck_15 safeupdate_15 pg_squeeze_15* pg_fkpart_15 pg_jobmon_15
repo_url_packages:node_default_packages:- lz4,unzip,bzip2,zlib,yum,pv,jq,git,ncdu,make,patch,bash,lsof,wget,uuid,tuned,nvme-cli,numactl,grubby,sysstat,iotop,htop,rsync,tcpdump
- netcat,socat,ftp,lrzsz,net-tools,ipvsadm,bind-utils,telnet,audit,ca-certificates,openssl,readline,vim-minimal,node_exporter,etcd,haproxy,python3,python3-pip
infra_packages- grafana,loki,logcli,promtail,prometheus2,alertmanager,karma,pushgateway
- node_exporter,blackbox_exporter,nginx_exporter,redis_exporter,pg_exporter
- nginx,dnsmasq,ansible,postgresql15,redis,mcli,python3-requests
PGSERVICEin.pigsty被移除了,取而代之的是PGDATABASE=postgres,这用户只需 IP 地址就可以从管理节点访问特定实例。
目录结构变化:
bin/dnsandbin/ssh现在被移动到vagrant/目录中。
MD5 (pigsty-pkg-v2.2.0.el7.x86_64.tgz) = 5fb6a449a234e36c0d895a35c76add3c
MD5 (pigsty-pkg-v2.2.0.el8.x86_64.tgz) = c7211730998d3b32671234e91f529fd0
MD5 (pigsty-pkg-v2.2.0.el9.x86_64.tgz) = 385432fe86ee0f8cbccbbc9454472fdd
v2.1.0
相关文章:Pigsty v2.1 发布:向量扩展 / PG12-16 支持
发布注记:https://github.com/Vonng/pigsty/releases/tag/v2.1.0
Highlight
- PostgreSQL 16 beta 支持, 以及 12 ~ 15 的支持.
- 为 PG 12 - 15 新增了 PGVector 扩展支持,用于存储 AI 嵌入。
- 为 Grafana 添加了额外6个默认的扩展面板/数据源插件。
- 添加
bin/profile脚本用于执行远程 Profiling ,生成火焰图。 - 添加
bin/validate用于校验pigsty.yml配置文件合法性。 - 添加
bin/repo-add用于快速向节点添加软件源定义。 - PostgreSQL 16 可观测性:添加了
pg_stat_io支持与相关监控面板
软件升级
- PostgreSQL 15.3 , 14.8, 13.11, 12.15, 11.20, and 16 beta1
- pgBackRest 2.46 / pgbouncer 1.19
- Redis 7.0.11
- Grafana v9.5.3
- Loki / Promtail / Logcli 2.8.2
- Prometheus 2.44
- TimescaleDB 2.11.0
- minio-20230518000536 / mcli-20230518165900
- Bytebase v2.2.0
改进增强
- 当添加本地用户的公钥时,所有的
id*.pub都会被添加到远程机器上(例如椭圆曲线算法生成的密钥文件)
v2.0.2
https://github.com/Vonng/pigsty/releases/tag/v2.0.2
亮点
使用开箱即用的 pgvector 存储 AI Embedding、索引、检索向量。
- 新扩展
pgvector - MinIO CVE-2023-28432 问题修复
变更
- 新扩展插件
pgvector用于存储 AI 嵌入,并执行向量相似度搜索。 - 修复 MinIO CVE-2023-28432 ,使用 20230324 新提供的 policy API.
- 为 DNSMASQ systemd 服务添加动态重载命令
- 更新 PEV 版本至 v1.8
- 更新 grafana 版本至 v9.4.7
- 更新 MinIO 与 MCLI 版本至 20230324
- 更新 bytebase 版本至 v1.15.0
- 更新监控面板并修复死链接
- 更新了阿里云 Terraform 模板,默认使用 RockyLinux 9
- 使用 Grafana v9.4 的 Provisioning API
- 为众多管理任务添加了 asciinema 视频
- 修复了 EL8 PostgreSQL 的破损依赖:移除 anonymizer_15 faker_15 pgloader
MD5 (pigsty-pkg-v2.0.2.el7.x86_64.tgz) = d46440a115d741386d29d6de646acfe2
MD5 (pigsty-pkg-v2.0.2.el8.x86_64.tgz) = 5fa268b5545ac96b40c444210157e1e1
MD5 (pigsty-pkg-v2.0.2.el9.x86_64.tgz) = c8b113d57c769ee86a22579fc98e8345
v2.0.1
https://github.com/Vonng/pigsty/releases/tag/v2.0.1
安全性改进,与对 v2.0.0 的 BUG 修复。
改进
- 更换猪头 logo 以符合 PostgreSQL 商标政策。
- 将 grafana 版本升级至 v9.4,界面更佳且修复了 bug。
- 将 patroni 版本升级至 v3.0.1,其中包含了一些 bug 修复。
- 修改:将 grafana systemd 服务文件回滚到 rpm 默认的版本。
- 使用缓慢的
copy代替rsync来复制 grafana 仪表板,更加可靠。 - 增强:bootstrap 执行后会添加回默认 repo 文件。
- 添加 asciinema 视频,用于各种管理任务。
- 安全增强模式:限制监控用户权限。
- 新的配置模板:
dual.yml,用于双节点部署。 - 在
crit.yml模板中启用log_connections和log_disconnections。 - 在
crit.yml模板中的pg_libs中启用$lib/passwordcheck。 - 明确授予
pg_monitor角色监视视图权限。 - 从
dbuser_monitor中移除默认的dbrole_readonly以限制监控用户的权限 - 现在 patroni 监听在
{{ inventory_hostname }}而不是0.0.0.0 - 现在你可以使用
pg_listen控制 postgres/pgbouncer 监听的地址 - 现在你可以在
pg_listen中使用${ip},${lo},${vip}占位符 - 将 Aliyun terraform 镜像从 centos 7.9 提升到 rocky Linux 9
- 将 bytebase 版本升级到 v1.14.0
BUG修复
- 为 alertmanager 添加缺失的 advertise 地址。
- 解决使用
bin/pgsql-user创建数据库用户时,pg_mode变量缺失问题。 - 在
redis.yml中为 Redis 集群加入任务添加-a password选项。 - 在
infra-rm.yml.remove infra data任务中补充缺失的默认值。 - 修复 prometheus 监控对象定义文件的属主为
prometheus用户。 - 使用 管理员用户 而不是 root 去删除 DCS 中的元数据。
- 修复了由 grafana 9.4 bug 导致的问题:Meta数据源缺失。
注意事项
EL8 pgdg 上游官方源处于依赖破损状态,请小心使用。涉及到的软件包: postgis33_15, pgloader, postgresql_anonymizer_15*, postgresql_faker_15
如何升级?
cd ~/pigsty; tar -zcf /tmp/files.tgz files; rm -rf ~/pigsty # backup files dir and remove
cd ~; bash -c "$(curl -fsSL https://get.pigsty.cc/latest)" # get latest pigsty source
cd ~/pigsty; rm -rf files; tar -xf /tmp/files.tgz -C ~/pigsty # restore files dir
Checksums
MD5 (pigsty-pkg-v2.0.1.el7.x86_64.tgz) = 5cfbe98fd9706b9e0f15c1065971b3f6
MD5 (pigsty-pkg-v2.0.1.el8.x86_64.tgz) = c34aa460925ae7548866bf51b8b8759c
MD5 (pigsty-pkg-v2.0.1.el9.x86_64.tgz) = 055057cebd93c473a67fb63bcde22d33
特别感谢 @cocoonkid 提供的反馈。
v2.0.0
相关文章:
Pigsty v2.0.0 正式发布!
从v2.0.0开始,PIGSTY 现在是 “PostgreSQL In Great STYle"的首字母缩写,即"全盛状态的PostgreSQL”。
curl -fsSL https://get.pigsty.cc/latest | bash
Download directly from GitHub Release
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Vonng/pigsty/master/bin/get)"
# or download tarball directly with curl (EL9)
curl -L https://github.com/Vonng/pigsty/releases/download/v2.0.0/pigsty-v2.0.0.tgz -o ~/pigsty.tgz
curl -L https://github.com/Vonng/pigsty/releases/download/v2.0.0/pigsty-pkg-v2.0.0.el9.x86_64.tgz -o /tmp/pkg.tgz
# EL7: https://github.com/Vonng/pigsty/releases/download/v2.0.0/pigsty-pkg-v2.0.0.el7.x86_64.tgz
# EL8: https://github.com/Vonng/pigsty/releases/download/v2.0.0/pigsty-pkg-v2.0.0.el8.x86_64.tgz
亮点
- 完美整合 PostgreSQL 15, PostGIS 3.3, Citus 11.2, TimescaleDB 2.10,分布式地理时序超融合数据库。
- OS兼容性大幅增强:支持 EL7,8,9,以及 RHEL, CentOS, Rocky, OracleLinux, AlmaLinux等兼容发行版。
- 安全性改进:自签名CA,全局网络流量SSL加密,密码scram-sha-256认证,备份采用AES加密,重制的HBA规则系统。
- Patroni升级至3.0,提供原生的高可用 Citus 分布式集群支持,默认启用FailSafe模式,无惧DCS故障致全局主库瘫痪。
- 提供基于 pgBackRest 的开箱即用的时间点恢复 PITR 支持,默认支持本地文件系统与专用MinIO/S3集群备份。
- 新模块
ETCD,可独立部署,简易扩缩容,自带监控高可用,彻底取代 Consul 作为高可用 PG 的 DCS。 - 新模块
MINIO,可独立部署,支持多盘多节点部署,用作S3本地替代,亦用于集中式 PostgreSQL 备份仓库。 - 大幅精简配置文件参数,无需默认值即可使用;模板自动根据机器规格调整主机与PG参数,HBA/服务的定义更简洁泛用。
- 受 Grafana 与 MinIO 影响,软件协议由 Apache License 2.0 变更为 AGPL 3.0
兼容性
- 支持 EL7, EL8, EL9 三个大版本,并提供三个版本对应的离线软件包,默认开发测试环境由EL7升级至EL9。
- 支持更多EL兼容Linux发行版:RHEL, CentOS, RockyLinux, AlmaLinux, OracleLinux等…
- 源码包与离线软件包的命名规则发生改变,现在版本号,操作系统版本号,架构都会体现在包名中。
PGSQL: PostgreSQL 15.2, PostGIS 3.3, Citus 11.2, TimescaleDB 2.10 现可同时使用,协同工作。PGSQL: Patroni 升级至 3.0 版本,作为 PGSQL 的高可用组件。- 默认使用 ETCD 作为 DCS,取代 Consul,减少一个 Consul Agent 失效点。
- 因为 vip-manager 升级至 2.1 并使用 ETCDv3 API,彻底弃用 ETCDv2 API,Patroni同理
- 提供原生的高可用 Citus 分布式集群支持。使用完全开源所有功能的 Citus 11.2。
- 默认启用FailSafe模式,无惧DCS故障致全局主库瘫痪。
PGSQL: 引入 pgBackrest v2.44 提供开箱即用的 PostgreSQL 时间点恢复 PITR 功能- 默认使用主库上的备份目录创建备份仓库,滚动保留两天的恢复窗口。
- 默认备选备份仓库为专用 MinIO/S3 集群,滚动保留两周的恢复窗口,本地使用需要启用 MinIO 模块。
ETCD现在作为一个独立部署的模块,带有完整的扩容/缩容方案与监控。MINIO现在成为一个独立部署的模块,支持多盘多节点部署,用作S3本地替代,亦可用作集中式备份仓库。NODE模块现在包含haproxy,docker,node_exporter,promtail功能组件chronyd现在取代ntpd成为所有节点默认的 NTP 服务。- HAPROXY 现从属于
NODE的一部分,而不再是PGSQL专属,可以 NodePort 的方式对外暴露服务。 - 现在
PGSQL模块可以使用专用的集中式 HAPROXY 集群统一对外提供服务。
INFRA模块现在包含dnsmasq,nginx,prometheus,grafana,loki等组件- Infra 模块中的 DNSMASQ 服务器默认启用,并添加为所有节点的默认 DNS 服务器之一。
- 添加了
blackbox_exporter用于主机 PING 探测,pushgateway用于批处理任务指标。 loki与promtail现在使用 Grafana 默认的软件包,使用官方的 Grafana Echarts 面板插件- 提供针对 PostgreSQL 15 的新增可观测性位点的监控支持,添加 Patroni 监控
- 软件版本升级
- PostgreSQL 15.2 / PostGIS 3.3 / TimescaleDB 2.10 / Citus 11.2
- Patroni 3.0 / Pgbouncer 1.18 / pgBackRest 2.44 / vip-manager 2.1
- HAProxy 2.7 / Etcd 3.5 / MinIO 20230131022419 / mcli 20230128202938
- Prometheus 2.42 / Grafana 9.3 / Loki & Promtail 2.7 / Node Exporter 1.5
安全性
- 启用了一个完整的本地自签名CA:
pigsty-ca,用于签发内网组件所使用的证书。 - 创建用户/修改密码的操作将不再会在日志文件中留下痕迹。
- Nginx 默认启用 SSL 支持(如需HTTPS,您需要在系统中信任
pigsty-ca,或使用Chromethisisunsafe) - ETCD 全面启用 SSL 加密客户端与服务端对等通信
- PostgreSQL 添加并默认启用了 SSL 支持,管理链接默认都使用SSL访问。
- Pgbouncer 添加了 SSL 支持,出于性能考虑默认不启用。
- Patroni 添加了 SSL 支持,并默认限制了管理 API 只能从本机与管理节点使用密码认证方可访问。
- PostgreSQL 的默认密码认证方式由
md5改为scram-sha-256。 - Pgbouncer添加了认证查询支持,可以动态管理连接池用户。
- pgBackRest 使用远端集中备份存储仓库时,默认使用
AES-256-CBC加密备份数据。 - 提供高安全等级配置模板:强制使用全局 SSL,并要求使用管理员证书登陆。
- 所有默认HBA规则现在全部在配置文件中显式定义。
可维护性
- 现有的配置模板可根据机器规格(CPU/内存/存储)自动调整优化。
- 现在可以动态配置 Postgres/Pgbouncer/Patroni/pgBackRest 的日志目录:默认为:
/pg/log/<type>/ - 原有的 IP 地址占位符
10.10.10.10被替换为一个专用变量:${admin_ip},可在多处引用,便于切换备用管理节点。 - 您可以指定
region来使用不同地区的上游镜像源,以加快软件包的下载速度。 - 现在允许用户定义更细粒度的上游源地址,您可以根据不同的EL版本、架构,以及地区,使用不同的上游源。
- 提供了阿里云与AWS中国地区的 Terraform 模板,可用于一键拉起所需的 EC2 虚拟机。
- 提供了多种不同规格的 Vagrant 沙箱模板:
meta,full,el7/8/9,minio,build,citus - 添加了新的专用剧本:
pgsql-monitor.yml用于监控现有的 Postgres 实例或 RDS。 - 添加了新的专用剧本:
pgsql-migration.yml,使用逻辑复制无缝迁移现有实例至 Pigsty管理的集群。 - 添加了一系列专用 Shell 实用命令,封装常见运维操作,方便用户使用。
- 优化了所有 Ansible Role 的实现,使其更加简洁、易读、易维护,无需默认参数即可使用。
- 允许在业务数据库/用户的层次上定义额外的 Pgbouncer 参数。
API变更
Pigsty v2.0 进行了大量变更,新增64个参数,移除13个参数,重命名17个参数。
新增的参数
INFRA.META.admin_ip: 主元节点 IP 地址INFRA.META.region: 上游镜像区域:default|china|europeINFRA.META.os_version: 企业版 Linux 发行版本:7,8,9INFRA.CA.ca_cn: CA 通用名称,默认为 pigsty-caINFRA.CA.cert_validity: 证书有效期,默认为 20 年INFRA.REPO.repo_enabled: 在 infra 节点上构建本地 yum 仓库吗?INFRA.REPO.repo_upstream: 上游 yum 仓库定义列表INFRA.REPO.repo_home: 本地 yum 仓库的主目录,通常与 nginx_home ‘/www’ 相同INFRA.NGINX.nginx_ssl_port: https 监听端口INFRA.NGINX.nginx_ssl_enabled: 启用 nginx https 吗?INFRA.PROMTETHEUS.alertmanager_endpoint: altermanager 端点(ip|domain):端口格式NODE.NODE_TUNE.node_hugepage_ratio: 内存 hugepage 比率,默认禁用,值为 0NODE.HAPROXY.haproxy_service: 要公开的 haproxy 服务列表PGSQL.PG_ID.pg_mode: pgsql 集群模式:pgsql,citus,gpsqlPGSQL.PG_BUSINESS.pg_dbsu_password: dbsu 密码,默认为空字符串表示没有 dbsu 密码PGSQL.PG_INSTALL.pg_log_dir: postgres 日志目录,默认为/pg/data/logPGSQL.PG_BOOTSTRAP.pg_storage_type: SSD|HDD,默认为 SSDPGSQL.PG_BOOTSTRAP.patroni_log_dir: patroni 日志目录,默认为/pg/logPGSQL.PG_BOOTSTRAP.patroni_ssl_enabled: 使用 SSL 保护 patroni RestAPI 通信?PGSQL.PG_BOOTSTRAP.patroni_username: patroni rest api 用户名PGSQL.PG_BOOTSTRAP.patroni_password: patroni rest api 密码(重要:请更改此密码)PGSQL.PG_BOOTSTRAP.patroni_citus_db: 由 patroni 管理的 citus 数据库,默认为 postgresPGSQL.PG_BOOTSTRAP.pg_max_conn: postgres 最大连接数,auto将使用推荐值PGSQL.PG_BOOTSTRAP.pg_shmem_ratio: postgres 共享内存比率,默认为 0.25,范围 0.1~0.4PGSQL.PG_BOOTSTRAP.pg_rto: 恢复时间目标,故障转移的 ttl,默认为 30sPGSQL.PG_BOOTSTRAP.pg_rpo: 恢复点目标,默认最多丢失 1MB 数据PGSQL.PG_BOOTSTRAP.pg_pwd_enc: 密码加密算法:md5|scram-sha-256PGSQL.PG_BOOTSTRAP.pgbouncer_log_dir: pgbouncer 日志目录,默认为/var/log/pgbouncerPGSQL.PG_BOOTSTRAP.pgbouncer_auth_query: 如果启用,查询 pg_authid 表以检索 biz 用户,而不是填充用户列表PGSQL.PG_BOOTSTRAP.pgbouncer_sslmode: pgbouncer 客户端的 SSL:disable|allow|prefer|require|verify-ca|verify-fullPGSQL.PG_BOOTSTRAP.pg_service_provider: 专用的 haproxy 节点组名称,或者默认为本地节点的空字符串PGSQL.PG_BOOTSTRAP.pg_default_service_dest: 如果 svc.dest=‘default’,则为默认服务目标PGSQL.PG_BACKUP.pgbackrest_enabled: 启用 pgbackrest 吗?PGSQL.PG_BACKUP.pgbackrest_clean: 初始化期间删除 pgbackrest 数据吗?PGSQL.PG_BACKUP.pgbackrest_log_dir: pgbackrest 日志目录,默认为/pg/logPGSQL.PG_BACKUP.pgbackrest_method: pgbackrest 备份仓库方法,local 或 minioPGSQL.PG_BACKUP.pgbackrest_repo: pgbackrest 备份仓库配置PGSQL.PG_DNS.pg_dns_suffix: pgsql dns 后缀,默认为空字符串PGSQL.PG_DNS.pg_dns_target: auto, primary, vip, none 或 ad hoc ipETCD.etcd_seq: etcd 实例标识符,必需ETCD.etcd_cluster: etcd 集群和组名称,默认为 etcdETCD.etcd_safeguard: 防止清除正在运行的 etcd 实例吗?ETCD.etcd_clean: 在初始化期间清除现有的 etcd 吗?ETCD.etcd_data: etcd 数据目录,默认为 /data/etcdETCD.etcd_port: etcd 客户端端口,默认为 2379ETCD.etcd_peer_port: etcd 对等端口,默认为 2380ETCD.etcd_init: etcd 初始集群状态,新建或已存在ETCD.etcd_election_timeout: etcd 选举超时,默认为 1000msETCD.etcd_heartbeat_interval: etcd 心跳间隔,默认为 100msMINIO.minio_seq: minio 实例标识符,必须参数MINIO.minio_cluster: minio 集群名称,默认为 minioMINIO.minio_clean: 初始化时清理 minio 吗?默认为 falseMINIO.minio_user: minio 操作系统用户,默认为minioMINIO.minio_node: minio 节点名模式MINIO.minio_data: minio 数据目录,使用 {x…y} 来指定多个驱动器MINIO.minio_domain: minio 外部域名,默认为sss.pigstyMINIO.minio_port: minio 服务端口,默认为 9000MINIO.minio_admin_port: minio 控制台端口,默认为 9001MINIO.minio_access_key: 根访问密钥,默认为minioadminMINIO.minio_secret_key: 根秘密密钥,默认为minioadminMINIO.minio_extra_vars: minio 服务器的额外环境变量MINIO.minio_alias: 本地 minio 部署的别名MINIO.minio_buckets: 待创建的 minio 存储桶列表MINIO.minio_users: 待创建的 minio 用户列表
移除的参数
INFRA.CA.ca_homedir: CA 主目录,现在固定为/etc/pki/INFRA.CA.ca_cert: CA 证书文件名,现在固定为ca.keyINFRA.CA.ca_key: CA 密钥文件名,现在固定为ca.keyINFRA.REPO.repo_upstreams: 已被repo_upstream替代PGSQL.PG_INSTALL.pgdg_repo: 现在由节点 playbooks 负责PGSQL.PG_INSTALL.pg_add_repo: 现在由节点 playbooks 负责PGSQL.PG_IDENTITY.pg_backup: 未使用且与部分名称冲突PGSQL.PG_IDENTITY.pg_preflight_skip: 不再使用,由pg_id替代DCS.dcs_name: 由于使用 etcd 而被移除DCS.dcs_servers: 被 ad hoc 组etcd替代DCS.dcs_registry: 由于使用 etcd 而被移除DCS.dcs_safeguard: 被etcd_safeguard替代DCS.dcs_clean: 被etcd_clean替代
重命名的参数
nginx_upstream->infra_portalrepo_address->repo_endpointpg_hostname->node_id_from_pgpg_sindex->pg_grouppg_services->pg_default_servicespg_services_extra->pg_servicespg_hba_rules_extra->pg_hba_rulespg_hba_rules->pg_default_hba_rulespgbouncer_hba_rules_extra->pgb_hba_rulespgbouncer_hba_rules->pgb_default_hba_rulesvip_mode->pg_vip_enabledvip_address->pg_vip_addressvip_interface->pg_vip_interfacenode_packages_default->node_default_packagesnode_packages_meta->infra_packagesnode_packages_meta_pip->infra_packages_pipnode_data_dir->node_data
Checksums
MD5 (pigsty-pkg-v2.0.0-rc1.el7.x86_64.tgz) = af4b5db9dc38c860de609956a8f1f0d3
MD5 (pigsty-pkg-v2.0.0-rc1.el8.x86_64.tgz) = 5b7152e142df3e3cbc06de30bd70e433
MD5 (pigsty-pkg-v2.0.0-rc1.el9.x86_64.tgz) = 1362e2a5680fc1a3a014cc4f304100bd
特别感谢意大利用户 @alemacci 在 SSL加密,备份,多操作系统发行版适配与自适应参数模版上的贡献!
v1.5.1
亮点
重要:修复了PG14.0-14.3中 CREATE INDEX|REINDEX CONCURRENTLY 可能导致索引数据损坏的问题。
Pigsty v1.5.1 升级默认PostgreSQL版本至 14.4 强烈建议尽快更新。
软件升级
- postgres 升级至 to 14.4
- haproxy 升级至 to 2.6.0
- grafana 升级至 to 9.0.0
- prometheus 升级至 2.36.0
- patroni 升级至 2.1.4
问题修复
- 修复了
pgsql-migration.yml中的TYPO - 移除了HAProxy配置文件中的PID配置项
- 移除了默认软件包中的 i686 软件包
- 默认启用所有Systemd Redis Service
- 默认启用所有Systemd Patroni Service
API变更
grafana_database与grafana_pgurl被标记为过时API,将从后续版本移除
New Apps
- wiki.js : 使用Postgres搭建本地维基百科
- FerretDB : 使用Postgres提供MongoDB API
v1.5.0
亮点概述
- 完善的Docker支持:在管理节点上默认启用并提供诸多开箱即用的软件模板:bytebase, pgadmin, pgweb, postgrest, minio等。
- 基础设施自我监控:Nginx, ETCD, Consul, Prometheus, Grafana, Loki 自我监控
- CMDB升级:兼容性改善,支持Redis集群/Greenplum集群元数据,配置文件可视化。
- 服务发现改进:可以使用Consul自动发现所有待监控对象,并纳入Prometheus中。
- 更好的冷备份支持:默认定时备份任务,添加
pg_probackup备份工具,一键创建延时从库。 - ETCD现在可以用作PostgreSQL/Patroni的DCS服务,作为Consul的备选项。
- Redis剧本/角色改善:现在允许对单个Redis实例,而非整个Redis节点进行初始化与移除。
详细变更列表
监控面板
- CMDB Overview:可视化Pigsty CMDB Inventory。
- DCS Overview:查阅Consul与ETCD集群的监控指标。
- Nginx Overview:查阅Pigsty Web访问指标与访问日志。
- Grafana Overview:Grafana自我监控
- Prometheus Overview:Prometheus自我监控
- INFRA Dashboard进行重制,反映基础设施整体状态
监控架构
- 现在允许使用 Consul 进行服务发现(当所有服务注册至Consul时)
- 现在所有的Infra组件会启用自我监控,并通过
infra_register角色注册至Prometheus与Consul中。 - 指标收集器 pg_exporter 更新至 v0.5.0,添加新功能,
scale与default,允许为指标指定一个倍乘因子,以及指定默认值。 pg_bgwriter,pg_wal,pg_query,pg_db,pgbouncer_stat关于时间的指标,单位由默认的毫秒或微秒统一缩放至秒。pg_table中的相关计数器指标,现在配置有默认值0,替代原有的NaN。pg_class指标收集器默认移除,相关指标添加至pg_table与pg_index收集器中。pg_table_size指标收集器现在默认启用,默认设置有300秒的缓存时间。
部署方案
- 新增可选软件包
docker.tgz,带有常用应用镜像:Pgadmin, Pgweb, Postgrest, ByteBase, Kong, Minio等。 - 新增角色ETCD,可以在DCS Servers指定的节点上自动部署ETCD服务,并自动纳入监控。
- 允许通过
pg_dcs_type指定PG高可用使用的DCS服务,Consul(默认),ETCD(备选) - 允许通过
node_crontab参数,为节点配置定时任务,例如数据库备份、VACUUM,统计收集等。 - 新增了
pg_checksum选项,启用时,数据库集群将启用数据校验和(此前只有crit模板默认启用) - 新增了
pg_delay选项,当实例为Standby Cluster Leader时,此参数可以用于配置一个延迟从库 - 新增了软件包
pg_probackup,默认角色replicator现在默认赋予了备份相关函数所需的权限。 - Redis部署现在拆分为两个部分:Redis节点与Redis实例,通过
redis_port参数可以精确控制一个具体实例。 - Loki 与 Promtail 现在使用
frpm制作的 RPM软件包进行安装。 - DCS3配置模板现在使用一个3节点的
pg-meta集群,与一个单节点的延迟从库。
软件升级
- 升级 PostgreSQL 至 14.3
- 升级 Redis 至 6.2.7
- 升级 PG Exporter 至 0.5.0
- 升级 Consul 至 1.12.0
- 升级 vip-manager 至 v1.0.2
- 升级 Grafana 至 v8.5.2
- 升级 Loki & Promtail 至 v2.5.0,使用frpm打包。
问题修复
- 修复了Loki 与 Promtail 默认配置文件名的问题
- 修复了Loki 与 Promtail 环境变量无法正确展开的问题
- 对英文文档进行了一次完整的翻译与修缮,文档依赖的JS资源现在直接从本地获取,无需互联网访问。
API变化
新参数
node_data_dir: 主要的数据挂载路径,如果不存在会被创建。node_crontab_overwrite: 覆盖/etc/crontab而非追加内容。node_crontab: 要被追加或覆盖的 node crontab 内容。nameserver_enabled: 在这个基础设施节节点上启用 nameserver 吗?prometheus_enabled: 在这个基础设施节节点上启用 prometheus 吗?grafana_enabled: 在这个基础设施节节点上启用 grafana 吗?loki_enabled: 在这个基础设施节节点上启用 loki 吗?docker_enable: 在这个基础设施节点上启用 docker 吗?consul_enable: 启用 consul 服务器/代理吗?etcd_enable: 启用 etcd 服务器/客户端吗?pg_checksum: 启用 pg 集群数据校验和吗?pg_delay: 备份集群主库复制重放时的应用延迟。
参数重制
现在 *_clean 是布尔类型的参数,用于在初始化期间清除现有实例。
*_safeguard 也是布尔类型的参数,用于在执行任何剧本时,避免清除正在运行的实例。
pg_exists_action->pg_cleanpg_disable_purge->pg_safeguarddcs_exists_action->dcs_cleandcs_disable_purge->dcs_safeguard
参数重命名
node_ntp_config->node_ntp_enablednode_admin_setup->node_admin_enablednode_admin_pks->node_admin_pk_listnode_dns_hosts->node_etc_hosts_defaultnode_dns_hosts_extra->node_etc_hostsnode_dns_server->node_dns_methodnode_local_repo_url->node_repo_local_urlsnode_packages->node_packages_defaultnode_extra_packages->node_packagesnode_packages_meta->node_packages_metanode_meta_pip_install->node_packages_meta_pipnode_sysctl_params->node_tune_paramsapp_list->nginx_indexesgrafana_plugin->grafana_plugin_methodgrafana_cache->grafana_plugin_cachegrafana_plugins->grafana_plugin_listgrafana_git_plugin_git->grafana_plugin_githaproxy_admin_auth_enabled->haproxy_auth_enabledpg_shared_libraries->pg_libsdcs_type->pg_dcs_type
v1.4.1
日常错误修复 / Docker 支持 / 英文文档
现在,默认在元节点上启用 docker。您可以使用它启动海量的各类软件
现在提供英文文档。
Bug 修复
- 修复 promtail & loki 配置变量问题
- 修复 grafana 旧版警报。
- 默认禁用 nameserver
- 为 patroni 快捷方式重命名 pg-alias.sh
- 为所有仪表板禁用 exemplars 查询
- 修复 loki 数据目录问题 https://github.com/Vonng/pigsty/issues/100
- 将 autovacuum_freeze_max_age 从 100000000 更改为 1000000000
v1.4.0
架构
- 将系统解耦为4大类别:
INFRA、NODES、PGSQL、REDIS,这使得pigsty更加清晰、更易于扩展。 - 单节点部署 =
INFRA+NODES+PGSQL - 部署pgsql集群 =
NODES+PGSQL - 部署redis集群 =
NODES+REDIS - 部署其他数据库 =
NODES+ xxx(例如MONGO、KAFKA…待定)
可访问性
- 为中国大陆提供CDN。
- 使用
bash -c "$(curl -fsSL http://get.pigsty.cc/latest)"获取最新源代码。 - 使用新的
download脚本下载并提取包。
监控增强
- 将监控系统分为5大类别:
INFRA、NODES、REDIS、PGSQL、APP - 默认启用日志记录
- 现在默认启用
loki和promtail,带有预构建的 loki-rpm。
- 现在默认启用
- 模型和标签
- 为所有仪表板添加了一个隐藏的
dsprometheus数据源变量,因此您只需选择一个新的数据源而不是修改Grafana数据源和仪表板。 - 为所有指标添加了一个
ip标签,并将其用作数据库指标和节点指标之间的连接键。
- 为所有仪表板添加了一个隐藏的
- INFRA监控
- Infra主仪表板:INFRA概览
- 添加日志仪表板:日志实例
- PGLOG分析和PGLOG会话现在被视为一个示例Pigsty APP。
- NODES监控应用
- 如果您完全不关心数据库,现在可以单独使用Pigsty作为主机监控软件!
- 包括4个核心仪表板:节点概览 & 节点集群 & 节点实例 & 节点警报
- 为节点引入新的身份变量:
node_cluster和nodename - 变量
pg_hostname现在意味着将主机名设置为与postgres实例名相同,以保持向后兼容性 - 变量
nodename_overwrite控制是否用nodename覆盖节点的主机名 - 变量
nodename_exchange将nodename写入彼此的/etc/hosts - 所有节点指标引用都经过修订,通过
ip连接 - 节点监控目标在
/etc/prometheus/targets/nodes下单独管理
- PGSQL监控增强
- 完全新的PGSQL集群,简化并专注于集群中的重要内容。
- 新仪表板PGSQL数据库是集群级对象监控。例如整个集群而不是单个实例的表和查询。
- PGSQL警报仪表板现在只关注pgsql警报。
- PGSQL Shard已添加到PGSQL中。
- Redis监控增强
- 为所有redis仪表板添加节点监控。
MatrixDB支持
- 通过
pigsty-matrix.ymlplaybook可以部署MatrixDB(Greenplum 7) - MatrixDB监控仪表板:PGSQL MatrixDB
- 添加示例配置:
pigsty-mxdb.yml
监控增强
- 将监控系统分为5大类别:
INFRA、NODES、REDIS、PGSQL、APP - 默认启用日志记录
- 现在默认启用
loki和promtail,带有预构建的 loki-rpm。
- 现在默认启用
- 模型和标签
- 为所有仪表板添加了一个隐藏的
dsprometheus数据源变量,因此您只需选择一个新的数据源而不是修改Grafana数据源和仪表板。 - 为所有指标添加了一个
ip标签,并将其用作数据库指标和节点指标之间的连接键。
- 为所有仪表板添加了一个隐藏的
- INFRA监控
- Infra主仪表板:INFRA概览
- 添加日志仪表板:日志实例
- PGLOG分析和PGLOG会话现在被视为一个示例Pigsty APP。
- NODES监控应用
- 如果您完全不关心数据库,现在可以单独使用Pigsty作为主机监控软件!
- 包括4个核心仪表板:节点概览 & 节点集群 & 节点实例 & 节点警报
- 为节点引入新的身份变量:
node_cluster和nodename - 变量
pg_hostname现在意味着将主机名设置为与postgres实例名相同,以保持向后兼容性 - 变量
nodename_overwrite控制是否用nodename覆盖节点的主机名 - 变量
nodename_exchange将nodename写入彼此的/etc/hosts - 所有节点指标引用都经过修订,通过
ip连接 - 节点监控目标在
/etc/prometheus/targets/nodes下单独管理
- PGSQL监控增强
- 完全新的PGSQL集群,简化并专注于集群中的重要内容。
- 新仪表板PGSQL数据库是集群级对象监控。例如整个集群而不是单个实例的表和查询。
- PGSQL警报仪表板现在只关注pgsql警报。
- PGSQL Shard已添加到PGSQL中。
- Redis监控增强
- 为所有redis仪表板添加节点监控。
MatrixDB支持
- 通过
pigsty-matrix.ymlplaybook可以部署MatrixDB(Greenplum 7) - MatrixDB监控仪表板:PGSQL MatrixDB
- 添加示例配置:
pigsty-mxdb.yml
置备改进
现在 pigsty 的工作流如下:
infra.yml ---> 在单一的元节点上安装 pigsty
| 然后将更多节点加入 pigsty 的管理下
|
nodes.yml ---> 为 pigsty 准备节点(节点设置、dcs、node_exporter、promtail)
| 然后选择一个 playbook 在这些节点上部署数据库集群
|
^--> pgsql.yml 在已准备好的节点上安装 postgres
^--> redis.yml 在已准备好的节点上安装 redis
infra-demo.yml =
infra.yml -l meta +
nodes.yml -l pg-test +
pgsql.yml -l pg-test +
infra-loki.yml + infra-jupyter.yml + infra-pgweb.yml
nodes.yml:用于设置和准备 pigsty 的节点,- 在节点上设置 node、node_exporter、consul agent
node-remove.yml用于节点注销pgsql.yml:现在只在已准备好的节点上工作pgsql-remove现在只负责 postgres 本身(dcs 和节点监控由node.yml负责)- 添加一系列新选项以在 greenplum/matrixdb 中重用
postgres角色 redis.yml:现在在已准备好的节点上工作- 而
redis-remove.yml现在从节点上移除 redis。 pgsql-matrix.yml现在在已准备好的节点上安装 matrixdb(Greenplum 7)。
软件升级
- PostgreSQL 14.2
- PostGIS 3.2
- TimescaleDB 2.6
- Patroni 2.1.3 (Prometheus 指标 + 故障转移插槽)
- HAProxy 2.5.5 (修复统计错误,更多指标)
- PG 导出器 0.4.1 (超时参数等)
- Grafana 8.4.4
- Prometheus 2.33.4
- Greenplum 6.19.4 / MatrixDB 4.4.0
- Loki 现在作为 rpm 包提供,而不是 zip 存档。
错误修复
- 删除 patroni 的 consul 依赖,这使其更容易迁移到新的 consul 集群
- 修复 prometheus bin/new 脚本的默认数据目录路径:从
/export/prometheus更改为/data/prometheus - 在 vip-manager systemd 服务中添加重新启动秒数
- 修复错别字和任务
API 变更
新增变量
node_cluster:节点集群的身份变量nodename_overwrite:如果设置,则 nodename 将设置为节点的主机名nodename_exchange:交换 play 主机之间的节点主机名(在/etc/hosts中)node_dns_hosts_extra:可以通过单个实例/集群轻松覆盖的额外静态 dns 记录patroni_enabled:如果禁用,postgres & patroni 的引导过程不会在postgres角色期间执行pgbouncer_enabled:如果禁用,pgbouncer 在postgres角色期间不会启动pg_exporter_params:生成监控目标 url 时为 pg_exporter 提供的额外 url 参数。pg_provision:布尔值变量,表示是否执行postgres角色的资源配置部分(模板,数据库,用户)no_cmdb:用于infra.yml和infra-demo.yml播放书,不会在元节点上创建 cmdb。
MD5 (app.tgz) = f887313767982b31a2b094e5589a75ea
MD5 (matrix.tgz) = 3d063437c482d94bd7e35df1a08bbc84
MD5 (pigsty.tgz) = e143b88ebea1474f9ebaffddc6072c49
MD5 (pkg.tgz) = 73e8f5ce995b1f1760cb63c1904fb91b
v1.3.1
监控
- PGSQL & PGCAT 仪表盘改进
- 优化 pgcat 实例 & pgcat 数据库的布局
- 在 pgsql 实例仪表盘中添加关键指标面板,与 pgsql 集群保持一致
- 在 pgcat 数据库中添加表/索引膨胀面板,移除 pgcat 膨胀仪表盘
- 在 pgcat 数据库仪表盘中添加索引信息
- 修复在 grafana 8.3 中的损坏面板
- 在 nginx 主页中添加 redis 索引
部署
- 新的
infra-demo.yml剧本用于一次性引导 - 使用
infra-jupyter.yml剧本部署可选的 jupyter lab 服务器 - 使用
infra-pgweb.yml剧本部署可选的 pgweb 服务器 - 在 meta 节点上新的
pg别名,可以从 admin 用户启动 postgres 集群(除了 postgres) - 根据
timescaledb-tune的建议调整所有 patroni 配置模板中的max_locks_per_transactions - 在配置模板中添加
citus.node_conninfo: 'sslmode=prefer'以便在没有 SSL 的情况下使用 citus - 在 pgdg14 包列表中添加所有扩展(除了 pgrouting)
- 将 node_exporter 升级到 v1.3.1
- 将 PostgREST v9.0.0 添加到包列表。从 postgres 模式生成 API。
错误修复
- Grafana 的安全漏洞(升级到 v8.3.1 问题)
- 修复
pg_instance&pg_service在register角色中从剧本的中间开始时的问题 - 修复在没有
pg_cluster变量存在的主机上 nginx 主页渲染问题 - 在升级到 grafana 8.3.1 时修复样式问题
v1.3.0
- 【功能增强】Redis 部署(集群、哨兵、主从)
- 【功能增强】Redis 监控
- Redis 总览仪表盘
- Redis 集群仪表盘
- Redis 实例仪表盘 -【功能增强】 监控:PGCAT 大修
- 新仪表盘:PGCAT 实例
- 新仪表盘:PGCAT 数据库仪表盘
- 重做仪表盘:PGCAT 表格
- 【功能增强】 监控:PGSQL 增强
- 新面板:PGSQL 集群,添加 10 个关键指标面板(默认切换)
- 新面板:PGSQL 实例,添加 10 个关键指标面板(默认切换)
- 简化 & 重新设计:PGSQL 服务
- 在 PGCAT & PGSL 仪表盘之间添加交叉引用 -【功能增强】 监控部署
- 现在 grafana 数据源在仅监控部署期间自动注册 -【功能增强】 软件升级
- 将 PostgreSQL 13 添加到默认包列表
- 默认升级到 PostgreSQL 14.1
- 添加 greenplum rpm 和依赖项
- 添加 redis rpm & 源代码包
- 将 perf 添加为默认包
v1.2.0
- 【功能增强】默认使用 PostgreSQL 14 版本
- 【功能增强】默认使用 TimescaleDB 2.5 扩展
- 现在 timescaledb 和 postgis 默认在 cmdb 中启用
- 【功能增强】 新增仅监控模式:
- 仅通过可连接的 URL,您可以使用 pigsty 监控现有的 pg 实例
- pg_exporter 将在本地的 meta 节点上部署
- 新仪表板 PGSQL Cluster Monly 用于远程集群
- 【功能增强】软件升级
- grafana 升级到 8.2.2
- pev2 升级到 v0.11.9
- promscale 升级到 0.6.2
- pgweb 升级到 0.11.9
- 新增扩展:pglogical、pg_stat_monitor、orafce
-【功能增强】自动检测机器规格并使用适当的
node_tune和pg_conf模板 -【功能增强】重做与膨胀相关的视图,现在公开更多信息 -【功能增强】删除 timescale 和 citus 的内部监控 -【功能增强】新剧本pgsql-audit.yml用于创建审计报告 -【BUG修复】现在 pgbouncer_exporter 资源所有者是 {{ pg_dbsu }} 而不是 postgres -【BUG修复】 修复在执行REINDEX TABLE CONCURRENTLY时 pg_exporter 在 pg_table pg_index 上的重复指标 -【功能增强】现在所有配置模板都减少到两个:auto 和 demo。(已删除:pub4, pg14, demo4, tiny, oltp) - 如果
vagrant是默认用户,则配置pigsty-demo,否则使用pigsty-auto。
如何从 v1.1.1 升级
在 1.2.0 中没有 API 变更。您仍然可以使用旧的 pigsty.yml 配置文件 (PG13)。
对于基础设施部分,重新执行 repo 将完成大部分工作。
至于数据库,您仍然可以使用现有的 PG13 实例。就地升级在涉及到像 PostGIS 和 Timescale 这样的扩展时非常棘手。我强烈推荐使用逻辑复制进行数据库迁移。
新的剧本 pgsql-migration.yml 将使这一过程变得容易得多。它将创建一系列的脚本,帮助您近乎零停机时间地迁移您的集群。
v1.1.1
- 【功能增强】 用
timescale版本替换 timescaledb 的apache版本 - 【功能增强】 升级 prometheus 到 2.30
- 【BUG修复】 现在 pg_exporter 配置目录的属主是
{{ pg_dbsu }},而不再是prometheus
如何从v1.1.0升级?
这个版本的主要变动是 TimescaleDB,使用 TimescaleDB License (TSL)的官方版本替代了 PGDG 仓库中的 Apache License v2 的版本。
stop/pause postgres instance with timescaledb
yum remove -y timescaledb_13
[timescale_timescaledb]
name=timescale_timescaledb
baseurl=https://packagecloud.io/timescale/timescaledb/el/7/$basearch
repo_gpgcheck=0
gpgcheck=0
enabled=1
yum install timescaledb-2-postgresql13
v1.1.0
- 【增强功能】 增加
pg_dummy_filesize以创建文件系统空间占位符 - 【增强功能】 主页大改版
- 【增强功能】 增加 Jupyter Lab 整合
- 【增强功能】 增加 pgweb 控制台整合
- 【增强功能】 增加 pgbadger 支持
- 【增强功能】 增加 pev2 支持,解释可视化工具
- 【增强功能】 增加 pglog 工具
- 【增强功能】 更新默认的 pkg.tgz 软件版本:
- PostgreSQL 升级至 v13.4(支持官方的 pg14)
- pgbouncer 升级至 v1.16(指标定义更新)
- Grafana 升级至 v8.1.4
- Prometheus 升级至 v2.2.29
- node_exporter 升级至 v1.2.2
- haproxy 升级至 v2.1.1
- consul 升级至 v1.10.2
- vip-manager 升级至 v1.0.1
API 变更
nginx_upstream现在持有不同的结构。(不兼容)- 新的配置条目:
app_list,渲染至主页的导航条目 - 新的配置条目:
docs_enabled,在默认服务器上设置本地文档 - 新的配置条目:
pev2_enabled,设置本地的 pev2 工具 - 新的配置条目:
pgbadger_enabled,创建日志概要/报告目录 - 新的配置条目:
jupyter_enabled,在元节点上启用 Jupyter Lab 服务器 - 新的配置条目:
jupyter_username,指定运行 Jupyter Lab 的用户 - 新的配置条目:
jupyter_password,指定 Jupyter Lab 的默认密码 - 新的配置条目:
pgweb_enabled,在元节点上启用 pgweb 服务器 - 新的配置条目:
pgweb_username,指定运行 pgweb 的用户 - 将内部标记
repo_exist重命名为repo_exists - 现在
repo_address的默认值为pigsty而非yum.pigsty - 现在 haproxy 的访问点为
http://pigsty而非http://h.pigsty
v1.0.1
2021-09-14
- 文档更新
- 现已支持中文文档
- 现已支持机器翻译的英文文档
- 错误修复:
pgsql-remove不会移除主实例 - 错误修复:用 pg_cluster + pg_seq 替换 pg_instance
- Start-At-Task 可能因为 pg_instance 未定义而失败
- 错误修复:从默认共享预加载库中移除 citus
- citus 会强制 max_prepared_transaction 的值为非零
- 错误修复:在
configure中进行 ssh sudo 检查:- 现在使用
ssh -t sudo -n ls进行权限检查
- 现在使用
- 笔误修复:
pg-backup脚本的笔误 - 警报调整:移除 NTP 合理性检查警报(与 ClockSkew 重复)
- 导出器调整:移除 collector.systemd 以减少开销
v1.0.0
v1 正式发布,监控系统全面改进
亮点
- 监控系统全面改进
- 在 Grafana 8.0 上新增仪表盘
- 新的度量定义,增加 PG14 支持
- 简化的标签系统:静态标签集:(job, cls, ins)
- 新的警报规则与衍生度量
- 同时监控多个数据库
- 实时日志搜索 & csvlog 分析
- 链接丰富的仪表盘,点击图形元素进行深入|汇总
- 架构变更
- 将 citus 和 timescaledb 加入默认安装部分
- 增加对 PostgreSQL 14beta2 的支持
- 简化 haproxy 管理页面索引
- 通过添加新的角色
register来解耦基础设施和 pgsql - 添加新角色
loki和promtail用于日志记录 - 为管理员节点上的管理员用户添加新角色
environ以设置环境 - 默认使用
static服务发现用于 prometheus(而不是consul) - 添加新角色
remove以优雅地移除集群和实例 - 升级 prometheus 和 grafana 的配置逻辑
- 升级到 vip-manager 1.0,node_exporter 1.2,pg_exporter 0.4,grafana 8.0
- 现在,每个实例上的每个数据库都可以自动注册为 grafana 数据源
- 将 consul 注册任务移到
register角色,更改 consul 服务标签 - 添加 cmdb.sql 作为 pg-meta 基线定义(CMDB & PGLOG)
- 应用框架
- 可扩展框架用于新功能
- 核心应用:PostgreSQL 监控系统:
pgsql - 核心应用:PostgreSQL 目录浏览器:
pgcat - 核心应用:PostgreSQL Csvlog 分析器:
pglog - 添加示例应用
covid用于可视化 covid-19 数据 - 添加示例应用
isd用于可视化 isd 数据
- 其他
- 添加 jupyterlab,为数据科学提供完整的 python 环境
- 添加
vonng-echarts-panel以恢复对 Echarts 的支持 - 添加 wrap 脚本
createpg,createdb,createuser - 添加 cmdb 动态库存脚本:
load_conf.py,inventory_cmdb,inventory_conf - 移除过时的剧本:
pgsql-monitor,pgsql-service,node-remove等….
API 变更
- 新变量:
node_meta_pip_install - 新变量:
grafana_admin_username - 新变量:
grafana_database - 新变量:
grafana_pgurl - 新变量:
pg_shared_libraries - 新变量:
pg_exporter_auto_discovery - 新变量:
pg_exporter_exclude_database - 新变量:
pg_exporter_include_database - 变量重命名:
grafana_url为grafana_endpoint
Bug 修复
- 修复默认时区 Asia/Shanghai (CST) 问题
- 修复 pgbouncer & patroni 的 nofile 限制
- 当执行标签
pgbouncer时,pgbouncer 的用户列表和数据库列表将会被生成
v0.9.0
v0.9极大简化了安装流程,进行了大量日志相关改进,开发了命令行工具(Beta),并修复了一系列问题。
新功能
一键安装模式:
/bin/bash -c "$(curl -fsSL https://pigsty.cc/install)"开发命令行工具
pigsty-cli封装常用Ansible命令,目前pigsty-cli处于Beta状态使用Loki与Promtail收集日志:
- 默认收集Postgres,Pgbouncer,Patroni日志
- 新增部署脚本
infra-loki.yml与pgsql-promtail.yml - 定义基于日志的监控指标
- 使用Grafana制作日志相关可视化面板。
监控组件可以使用二进制安装,使用
files/get_bin.sh下载监控二进制组件。飞升模式: 当集群元节点初始化完成后,可以使用
bin/upgrade升级为动态Inventory 使用pg-meta上的数据库代替YAML配置文件。
问题修复
- 集中修复日志相关问题:
- 修复了HAProxy健康检查造成PG日志中大量
connection reset by peer的问题。 - 修复了HAProxy健康检查造成Patroni日志中大量出现
Connect ResetException的问题 - 修复了Patroni日志时间戳格式,去除毫秒时间戳,附加完整时区信息。
- 为
dbuser_monitor配置1秒的log_min_duration_statement,避免监控查询出现在日志中。
- 修复了HAProxy健康检查造成PG日志中大量
- 重构Grafana角色
- 在保持API不变的前提下重构Grafana角色。
- 使用CDN下载预打包的Grafana插件,加速插件下载
- 其他问题修复
- 修复了
pgbouncer-create-user未能正确处理 md5 密码的问题。 - 完善了数据库与用户创建SQL模版中参数空置检查。
- 修复了 NODE DNS配置时如果手工中断执行,DNS配置可能出错的问题。
- 重构了Makefile快捷方式 Makefile 中的错别字
- 修复了
参数变更
node_disable_swap默认为 False,默认不会关闭SWAP。node_sysctl_params不再有默认修改的系统参数。grafana_plugin的默认值install现在意味着当插件缓存不存在时,从CDN下载。repo_url_packages现在从 Pigsty CDN 下载额外的RPM包,解决墙内无法访问的问题。proxy_env.no_proxy现在将Pigsty CDN加入到NOPROXY列表中。grafana_customize现在默认为false,启用意味着安装Pigsty Pro版UI(默认不开源所以不要启用)node_admin_pk_current,新增选项,启用后会将当前用户的~/.ssh/id_rsa.pub添加至管理员的Key中loki_clean:新增选项,安装Loki时是否清除现有数据loki_data_dir:新增选项,指明安装Loki时的数据目录promtail_enabled是否启用Promtail日志收集服务?promtail_clean是否在安装promtail时移除已有状态信息?promtail_portpromtail使用的默认端口,默认为9080promtail_status_file保存Promtail状态信息的文件位置promtail_send_url用于接收日志的loki服务endpoint
v0.8.0
v0.8 针对 服务(Service) 接入部分进行了彻底的重做。现在除了默认的primary, replica服务外,用户可以自行定义新的服务。服务的接口可以支持多种不同的实现,例如L4 DPKG VIP可作为Haproxy的替代品与Pigsty集成。同时,针对用户反馈的一些问题进行了集中处理与改进。
改动内容
v0.8是供给方案定稿版本,此后供给系统的API将保持稳定。
API变更
原有vip与haproxy角色的所有配置项,现在迁移至service角色中。
#------------------------------------------------------------------------------
# SERVICE PROVISION
#------------------------------------------------------------------------------
pg_weight: 100 # default load balance weight (instance level)
# - service - #
pg_services: # how to expose postgres service in cluster?
# primary service will route {ip|name}:5433 to primary pgbouncer (5433->6432 rw)
- name: primary # service name {{ pg_cluster }}_primary
src_ip: "*"
src_port: 5433
dst_port: pgbouncer # 5433 route to pgbouncer
check_url: /primary # primary health check, success when instance is primary
selector: "[]" # select all instance as primary service candidate
# replica service will route {ip|name}:5434 to replica pgbouncer (5434->6432 ro)
- name: replica # service name {{ pg_cluster }}_replica
src_ip: "*"
src_port: 5434
dst_port: pgbouncer
check_url: /read-only # read-only health check. (including primary)
selector: "[]" # select all instance as replica service candidate
selector_backup: "[? pg_role == `primary`]" # primary are used as backup server in replica service
# default service will route {ip|name}:5436 to primary postgres (5436->5432 primary)
- name: default # service's actual name is {{ pg_cluster }}-{{ service.name }}
src_ip: "*" # service bind ip address, * for all, vip for cluster virtual ip address
src_port: 5436 # bind port, mandatory
dst_port: postgres # target port: postgres|pgbouncer|port_number , pgbouncer(6432) by default
check_method: http # health check method: only http is available for now
check_port: patroni # health check port: patroni|pg_exporter|port_number , patroni by default
check_url: /primary # health check url path, / as default
check_code: 200 # health check http code, 200 as default
selector: "[]" # instance selector
haproxy: # haproxy specific fields
maxconn: 3000 # default front-end connection
balance: roundrobin # load balance algorithm (roundrobin by default)
default_server_options: 'inter 3s fastinter 1s downinter 5s rise 3 fall 3 on-marked-down shutdown-sessions slowstart 30s maxconn 3000 maxqueue 128 weight 100'
# offline service will route {ip|name}:5438 to offline postgres (5438->5432 offline)
- name: offline # service name {{ pg_cluster }}_replica
src_ip: "*"
src_port: 5438
dst_port: postgres
check_url: /replica # offline MUST be a replica
selector: "[? pg_role == `offline` || pg_offline_query ]" # instances with pg_role == 'offline' or instance marked with 'pg_offline_query == true'
selector_backup: "[? pg_role == `replica` && !pg_offline_query]" # replica are used as backup server in offline service
pg_services_extra: [] # extra services to be added
# - haproxy - #
haproxy_enabled: true # enable haproxy among every cluster members
haproxy_reload: true # reload haproxy after config
haproxy_policy: roundrobin # roundrobin, leastconn
haproxy_admin_auth_enabled: false # enable authentication for haproxy admin?
haproxy_admin_username: admin # default haproxy admin username
haproxy_admin_password: admin # default haproxy admin password
haproxy_exporter_port: 9101 # default admin/exporter port
haproxy_client_timeout: 3h # client side connection timeout
haproxy_server_timeout: 3h # server side connection timeout
# - vip - #
vip_mode: none # none | l2 | l4
vip_reload: true # whether reload service after config
# vip_address: 127.0.0.1 # virtual ip address ip (l2 or l4)
# vip_cidrmask: 24 # virtual ip address cidr mask (l2 only)
# vip_interface: eth0 # virtual ip network interface (l2 only)
新增选项
# - localization - #
pg_encoding: UTF8 # default to UTF8
pg_locale: C # default to C
pg_lc_collate: C # default to C
pg_lc_ctype: en_US.UTF8 # default to en_US.UTF8
pg_reload: true # reload postgres after hba changes
vip_mode: none # none | l2 | l4
vip_reload: true # whether reload service after config
移除选项
haproxy_check_port # Haproxy相关参数已经被Service定义覆盖
haproxy_primary_port
haproxy_replica_port
haproxy_backend_port
haproxy_weight
haproxy_weight_fallback
vip_enabled # vip_enabled参数被vip_mode覆盖
服务管理
pg_services 与 pg_services_extra 定义了集群中的服务,每一个服务的定义结构如下例所示:
一个服务必须指定以下内容:
名称:服务的完整名称以数据库集群名为前缀,以
service.name为后缀,通过-连接。例如在pg-test集群中name=primary的服务,其完整服务名称为pg-test-primary。端口:在Pigsty中,服务默认采用NodePort的形式对外暴露,因此暴露端口为必选项。但如果使用外部负载均衡服务接入方案,您也可以通过其他的方式区分服务。
选择器:选择器指定了服务的成员,采用JMESPath的形式,从所有集群实例成员中筛选变量。默认的
[]选择器会选取所有的集群成员。此外
selector_backup会选择或标记用于backup的实例列表(当集群中所有其他成员失效时方才接管服务)
# default service will route {ip|name}:5436 to primary postgres (5436->5432 primary)
- name: default # service's actual name is {{ pg_cluster }}-{{ service.name }}
src_ip: "*" # service bind ip address, * for all, vip for cluster virtual ip address
src_port: 5436 # bind port, mandatory
dst_port: postgres # target port: postgres|pgbouncer|port_number , pgbouncer(6432) by default
check_method: http # health check method: only http is available for now
check_port: patroni # health check port: patroni|pg_exporter|port_number , patroni by default
check_url: /primary # health check url path, / as default
check_code: 200 # health check http code, 200 as default
selector: "[]" # instance selector
haproxy: # haproxy specific fields
maxconn: 3000 # default front-end connection
balance: roundrobin # load balance algorithm (roundrobin by default)
default_server_options: 'inter 3s fastinter 1s downinter 5s rise 3 fall 3 on-marked-down shutdown-sessions slowstart 30s maxconn 3000 maxqueue 128 weight 100'
数据库管理
数据库现在可以对locale的细分选项:lc_ctype与lc_collate分别进行指定。支持这一功能的主要原因是PG的扩展插件pg_trgm需要在lc_ctype!=C的环境中才能正常支持中文。
旧接口定义
pg_databases:
- name: meta # name is the only required field for a database
owner: postgres # optional, database owner
template: template1 # optional, template1 by default
encoding: UTF8 # optional, UTF8 by default
locale: C # optional, C by default
allowconn: true # optional, true by default, false disable connect at all
revokeconn: false # optional, false by default, true revoke connect from public # (only default user and owner have connect privilege on database)
tablespace: pg_default # optional, 'pg_default' is the default tablespace
connlimit: -1 # optional, connection limit, -1 or none disable limit (default)
extensions: # optional, extension name and where to create
- {name: postgis, schema: public}
parameters: # optional, extra parameters with ALTER DATABASE
enable_partitionwise_join: true
pgbouncer: true # optional, add this database to pgbouncer list? true by default
comment: pigsty meta database # optional, comment string for database
新的接口定义
pg_databases:
- name: meta # name is the only required field for a database
# owner: postgres # optional, database owner
# template: template1 # optional, template1 by default
# encoding: UTF8 # optional, UTF8 by default , must same as template database, leave blank to set to db default
# locale: C # optional, C by default , must same as template database, leave blank to set to db default
# lc_collate: C # optional, C by default , must same as template database, leave blank to set to db default
# lc_ctype: C # optional, C by default , must same as template database, leave blank to set to db default
allowconn: true # optional, true by default, false disable connect at all
revokeconn: false # optional, false by default, true revoke connect from public # (only default user and owner have connect privilege on database)
# tablespace: pg_default # optional, 'pg_default' is the default tablespace
connlimit: -1 # optional, connection limit, -1 or none disable limit (default)
extensions: # optional, extension name and where to create
- {name: postgis, schema: public}
parameters: # optional, extra parameters with ALTER DATABASE
enable_partitionwise_join: true
pgbouncer: true # optional, add this database to pgbouncer list? true by default
comment: pigsty meta database # optional, comment string for database
v0.7.0
v0.7 针对接入已有数据库实例进行了改进,现在用户可以采用 仅监控部署(Monly Deployment) 模式使用Pigsty。同时新增了专用于管理数据库与用户、以及单独部署监控的剧本,并对数据库与用户的定义进行改进。
Features
- Monitor Only Deployment Support #25
- Split monolith static monitor target file into per-cluster conf #36
- Add create user playbook #29
- Add create database playbook #28
- Database provisioning interface enhancement #33
- User provisioning interface enhancement #34
Bug Fix
API变更
新增选项
prometheus_sd_target: batch # batch|single 监控目标定义文件采用单体还是每个实例一个
exporter_install: none # none|yum|binary 监控Exporter的安装模式
exporter_repo_url: '' # 如果设置,这里的REPO连接会加入目标的Yum源中
node_exporter_options: '--no-collector.softnet --collector.systemd --collector.ntp --collector.tcpstat --collector.processes' # Node Exporter默认的命令行选项
pg_exporter_url: '' # 可选,PG Exporter监控对象的URL
pgbouncer_exporter_url: '' # 可选,PGBOUNCER EXPORTER监控对象的URL
移除选项
exporter_binary_install: false # 功能被 exporter_install 覆盖
定义结构变更
pg_default_roles # 变化细节参考 用户管理。
pg_users # 变化细节参考 用户管理。
pg_databases # 变化细节参考 数据库管理。
重命名选项
pg_default_privilegs -> pg_default_privileges # 很明显这是一个错别字
仅监控模式
有时用户不希望使用Pigsty供给方案,只希望使用Pigsty监控系统管理现有PostgreSQL实例。
Pigsty提供了仅监控部署(monly, monitor-only模式,剥离供给方案部分,可用于监控现有PostgreSQL集群。
仅监控模式的部署流程与标准模式大体上保持一致,但省略了很多步骤
- 在元节点上完成基础设施初始化的部分与标准流程保持一致,仍然通过
./infra.yml完成。 - 不需要在数据库节点上完成 基础设施初始化。
- 不需要在数据库节点上执行数据库初始化的绝大多数任务,而是通过专用的
./pgsql-monitor.yml完成仅监控系统部署。 - 实际使用的配置项大大减少,只保留基础设施相关变量,与 监控系统相关的少量变量。
数据库管理
Database provisioning interface enhancement #33
旧接口定义
pg_databases: # create a business database 'meta'
- name: meta
schemas: [meta] # create extra schema named 'meta'
extensions: [{name: postgis}] # create extra extension postgis
parameters: # overwrite database meta's default search_path
search_path: public, monitor
新的接口定义
pg_databases:
- name: meta # name is the only required field for a database
owner: postgres # optional, database owner
template: template1 # optional, template1 by default
encoding: UTF8 # optional, UTF8 by default
locale: C # optional, C by default
allowconn: true # optional, true by default, false disable connect at all
revokeconn: false # optional, false by default, true revoke connect from public # (only default user and owner have connect privilege on database)
tablespace: pg_default # optional, 'pg_default' is the default tablespace
connlimit: -1 # optional, connection limit, -1 or none disable limit (default)
extensions: # optional, extension name and where to create
- {name: postgis, schema: public}
parameters: # optional, extra parameters with ALTER DATABASE
enable_partitionwise_join: true
pgbouncer: true # optional, add this database to pgbouncer list? true by default
comment: pigsty meta database # optional, comment string for database
接口变更
- Add new options:
template,encoding,locale,allowconn,tablespace,connlimit - Add new option
revokeconn, which revoke connect privileges from public for this database - Add
commentfield for database
数据库变更
在运行中集群中创建新数据库可以使用pgsql-createdb.yml剧本,在配置中定义完新数据库后,执行以下剧本。
./pgsql-createdb.yml -e pg_database=<your_new_database_name>
通过-e pg_datbase=告知需要创建的数据库名称,则该数据库即会被创建(或修改)。具体执行的命令参见集群主库/pg/tmp/pg-db-{{ database.name}}.sql文件。
用户管理
User provisioning interface enhancement #34
旧接口定义
pg_users:
- username: test # example production user have read-write access
password: test # example user's password
options: LOGIN # extra options
groups: [ dbrole_readwrite ] # dborole_admin|dbrole_readwrite|dbrole_readonly
comment: default test user for production usage
pgbouncer: true # add to pgbouncer
新接口定义
pg_users:
# complete example of user/role definition for production user
- name: dbuser_meta # example production user have read-write access
password: DBUser.Meta # example user's password, can be encrypted
login: true # can login, true by default (should be false for role)
superuser: false # is superuser? false by default
createdb: false # can create database? false by default
createrole: false # can create role? false by default
inherit: true # can this role use inherited privileges?
replication: false # can this role do replication? false by default
bypassrls: false # can this role bypass row level security? false by default
connlimit: -1 # connection limit, -1 disable limit
expire_at: '2030-12-31' # 'timestamp' when this role is expired
expire_in: 365 # now + n days when this role is expired (OVERWRITE expire_at)
roles: [dbrole_readwrite] # dborole_admin|dbrole_readwrite|dbrole_readonly
pgbouncer: true # add this user to pgbouncer? false by default (true for production user)
parameters: # user's default search path
search_path: public
comment: test user
接口变更
usernamefield rename tonamegroupsfield rename torolesoptionsnow split into separated configration entries:login,superuser,createdb,createrole,inherit,replication,bypassrls,connlimitexpire_atandexpire_inoptionspgbounceroption for user is nowfalseby default
用户管理
在运行中集群中创建新数据库可以使用pgsql-createuser.yml剧本,在配置中定义完新数据库后,执行以下剧本。
./pgsql-createuser.yml -e pg_user=<your_new_user_name>
通过-e pg_user=告知需要创建的数据库名称,则该数据库即会被创建(或修改)。具体执行的命令参见集群主库/pg/tmp/pg-user-{{ user.name}}.sql文件。
v0.6.0
v0.6 对数据库供给方案进行了修改与调整,根据用户的反馈添加了一系列实用功能与修正。针对监控系统的移植性进行优化,便于与其他外部数据库供给方案对接。
BUG修复
- 修复了新版本Patroni重启后会重置PG HBA的问题
- 修复了PG Overview Dashboard标题中的别字
- 修复了沙箱集群
pg-test的默认主库,原来为pg-test-2,应当为pg-test-1 - 修复了过时代码注释
功能改进
- 改造Prometheus与监控供给方式
- Haproxy供给重构与改进 #8
- 访问控制模型改进。#7
- 添加了默认角色
dbrole_offline,用于慢查询,ETL,交互式查询场景。 - 修改默认HBA规则,允许
dbrole_offline分组的用户访问pg_role == 'offline'及pg_offline_query == true的实例。
- 添加了默认角色
- 软件更新 Release v0.6
- PostgreSQL 13.2
- Prometheus 2.25
- PG Exporter 0.3.2
- Node Exporter 1.1
- Consul 1.9.3
- 更新默认PG源:PostgreSQL现在默认使用浙江大学的镜像,加速下载安装
接口变更
新增选项
service_registry: consul # 服务注册机制:none | consul | etcd | both
prometheus_options: '--storage.tsdb.retention=30d' # prometheus命令行选项
prometheus_sd_method: consul # Prometheus使用的服务发现机制:static|consul
prometheus_sd_interval: 2s # Prometheus服务发现刷新间隔
pg_offline_query: false # 设置后将允许dbrole_offline角色连接与查询该实例
node_exporter_enabled: true # 设置后将安装配置Node Exporter
pg_exporter_enabled: true # 设置后将安装配置PG Exporter
pgbouncer_exporter_enabled: true # 设置后将安装配置Pgbouncer Exporter
dcs_disable_purge: false # 双保险,强制 dcs_exists_action = abort 避免误删除DCS实例
pg_disable_purge: false # 双保险,强制 pg_exists_action = abort 避免误删除数据库实例
haproxy_weight: 100 # 配置实例的相对负载均衡权重
haproxy_weight_fallback: 1 # 配置集群主库在只读服务中的相对权重
移除选项
prometheus_metrics_path # 与 exporter_metrics_path 重复
prometheus_retention # 功能被 prometheus_options 覆盖
v0.5.0
Pigsty 现在有了官方网站啦:pigsty.cc 🎉 !
亮点特性
- Pigsty官方文档站正式上线!
- 添加了数据库模板的定制支持,用户可以通过配置文件定制所需的数据库内部对象。
- 对默认访问控制模型进行了改进
- 重构了HBA管理的逻辑,现在将由Pigsty替代Patroni直接负责生成HBA
- 将Grafana监控系统的供给方案从sqlite改为JSON文件静态Provision
- 将
pg-cluster-replication面板加入Pigsty开源免费套餐。 - 最新的经过测试的离线安装包:pkg.tgz (v0.5)
定制数据库
您是否烦恼过单实例多租户的问题?比如总有研发拿着PostgreSQL当MySQL使,明明是一个Schema就能解决的问题,非要创建一个新的数据库出来,在一个实例中创建出几十个不同的DB。 不要忧伤,不要心急。Pigsty已经提供数据库内部对象的Provision方案,您可以轻松地在配置文件中指定所需的数据库内对象,包括:
- 角色
- 用户/角色名
- 密码
- 用户属性
- 用户备注
- 用户所属的权限组
- 数据库
- 属主
- 额外的模式
- 额外的扩展插件
- 数据库级的自定义配置参数
- 数据库
- 属主
- 额外的模式
- 额外的扩展插件
- 数据库级的自定义配置参数
- 默认权限
- 默认情况下这里配置的权限会应用至所有由 超级用户 和 管理员用户创建的对象上。
- 默认扩展
- 所有新创建的业务数据库都会安装有这些默认扩展
- 默认模式
- 所有新创建的业务数据库都会创建有这些默认的模式
配置样例
# 通常是每个DB集群配置的变量
pg_users:
- username: test
password: test
comment: default test user
groups: [ dbrole_readwrite ] # dborole_admin|dbrole_readwrite|dbrole_readonly
pg_databases: # create a business database 'test'
- name: test
extensions: [{name: postgis}] # create extra extension postgis
parameters: # overwrite database meta's default search_path
search_path: public,monitor
# 通常是整个环境统一配置的全局变量
# - system roles - #
pg_replication_username: replicator # system replication user
pg_replication_password: DBUser.Replicator # system replication password
pg_monitor_username: dbuser_monitor # system monitor user
pg_monitor_password: DBUser.Monitor # system monitor password
pg_admin_username: dbuser_admin # system admin user
pg_admin_password: DBUser.Admin # system admin password
# - default roles - #
pg_default_roles:
- username: dbrole_readonly # sample user:
options: NOLOGIN # role can not login
comment: role for readonly access # comment string
- username: dbrole_readwrite # sample user: one object for each user
options: NOLOGIN
comment: role for read-write access
groups: [ dbrole_readonly ] # read-write includes read-only access
- username: dbrole_admin # sample user: one object for each user
options: NOLOGIN BYPASSRLS # admin can bypass row level security
comment: role for object creation
groups: [dbrole_readwrite,pg_monitor,pg_signal_backend]
# NOTE: replicator, monitor, admin password are overwritten by separated config entry
- username: postgres # reset dbsu password to NULL (if dbsu is not postgres)
options: SUPERUSER LOGIN
comment: system superuser
- username: replicator
options: REPLICATION LOGIN
groups: [pg_monitor, dbrole_readonly]
comment: system replicator
- username: dbuser_monitor
options: LOGIN CONNECTION LIMIT 10
comment: system monitor user
groups: [pg_monitor, dbrole_readonly]
- username: dbuser_admin
options: LOGIN BYPASSRLS
comment: system admin user
groups: [dbrole_admin]
- username: dbuser_stats
password: DBUser.Stats
options: LOGIN
comment: business read-only user for statistics
groups: [dbrole_readonly]
# object created by dbsu and admin will have their privileges properly set
pg_default_privilegs:
- GRANT USAGE ON SCHEMAS TO dbrole_readonly
- GRANT SELECT ON TABLES TO dbrole_readonly
- GRANT SELECT ON SEQUENCES TO dbrole_readonly
- GRANT EXECUTE ON FUNCTIONS TO dbrole_readonly
- GRANT INSERT, UPDATE, DELETE ON TABLES TO dbrole_readwrite
- GRANT USAGE, UPDATE ON SEQUENCES TO dbrole_readwrite
- GRANT TRUNCATE, REFERENCES, TRIGGER ON TABLES TO dbrole_admin
- GRANT CREATE ON SCHEMAS TO dbrole_admin
- GRANT USAGE ON TYPES TO dbrole_admin
# schemas
pg_default_schemas: [monitor]
# extension
pg_default_extensions:
- { name: 'pg_stat_statements', schema: 'monitor' }
- { name: 'pgstattuple', schema: 'monitor' }
- { name: 'pg_qualstats', schema: 'monitor' }
- { name: 'pg_buffercache', schema: 'monitor' }
- { name: 'pageinspect', schema: 'monitor' }
- { name: 'pg_prewarm', schema: 'monitor' }
- { name: 'pg_visibility', schema: 'monitor' }
- { name: 'pg_freespacemap', schema: 'monitor' }
- { name: 'pg_repack', schema: 'monitor' }
- name: postgres_fdw
- name: file_fdw
- name: btree_gist
- name: btree_gin
- name: pg_trgm
- name: intagg
- name: intarray
# postgres host-based authentication rules
pg_hba_rules:
- title: allow meta node password access
role: common
rules:
- host all all 10.10.10.10/32 md5
- title: allow intranet admin password access
role: common
rules:
- host all +dbrole_admin 10.0.0.0/8 md5
- host all +dbrole_admin 172.16.0.0/12 md5
- host all +dbrole_admin 192.168.0.0/16 md5
- title: allow intranet password access
role: common
rules:
- host all all 10.0.0.0/8 md5
- host all all 172.16.0.0/12 md5
- host all all 192.168.0.0/16 md5
- title: allow local read-write access (local production user via pgbouncer)
role: common
rules:
- local all +dbrole_readwrite md5
- host all +dbrole_readwrite 127.0.0.1/32 md5
- title: allow read-only user (stats, personal) password directly access
role: replica
rules:
- local all +dbrole_readonly md5
- host all +dbrole_readonly 127.0.0.1/32 md5
pg_hba_rules_extra: []
# pgbouncer host-based authentication rules
pgbouncer_hba_rules:
- title: local password access
role: common
rules:
- local all all md5
- host all all 127.0.0.1/32 md5
- title: intranet password access
role: common
rules:
- host all all 10.0.0.0/8 md5
- host all all 172.16.0.0/12 md5
- host all all 192.168.0.0/16 md5
pgbouncer_hba_rules_extra: []
数据库模板
- pg-init-template.sql 用于初始化
template1数据的脚本模板 - pg-init-business.sql 用于初始化其他业务数据库的脚本模板
权限模型
v0.5 改善了默认的权限模型,主要是针对单实例多租户的场景进行优化,并收紧权限控制。
- 撤回了普通业务用户对非所属数据库的默认
CONNECT权限 - 撤回了非管理员用户对所属数据库的默认
CREATE权限 - 撤回了所有用户在
public模式下的默认创建权限。
供给方式
原先Pigsty采用直接拷贝Grafana自带的grafana.db的方式完成监控系统的初始化。
这种方式虽然简单粗暴管用,但不适合进行精细化的版本控制管理。在v0.5中,Pigsty采用了Grafana API完成了监控系统面板供给的工作。
您所需的就是在grafana_url中填入带有用户名密码的Grafana URL。
因此,监控系统可以背方便地添加至已有的Grafana中。
v0.4.0
第二个公开测试版v0.4现已正式发行!
监控系统
Pigsty v0.4对监控系统进行了整体升级改造,精心挑选了10个面板作为标准的Pigsty开源内容。同时,针对Grafana 7.3的不兼容升级进行了大量适配改造工作。使用升级的pg_exporter v0.3.1作为默认指标导出器,调整了监控报警规则的监控面板连接。
Pigsty开源版
Pigsty开源版选定了以下10个Dashboard作为开源内容。其他Dashboard作为可选的商业支持内容提供。
- PG Overview
- PG Cluster
- PG Service
- PG Instance
- PG Database
- PG Query
- PG Table
- PG Table Catalog
- PG Table Detail
- Node
尽管进行了少量阉割,这10个监控面板所涵盖的内容仍然可以吊打所有同类软件。
软件升级
Pigsty v0.4进行了大量软件适配工作,包括:
- Upgrade to PostgreSQL 13.1, Patroni 2.0.1-4, add citus to repo.
- Upgrade to
pg_exporter 0.3.1 - Upgrade to Grafana 7.3, Ton’s of compatibility work
- Upgrade to prometheus 2.23, with new UI as default
- Upgrade to consul 1.9
其他改进
- Update prometheus alert rules
- Fix alertmanager info links
- Fix bugs and typos.
- add a simple backup script
离线安装包
- v0.4的离线安装包(CentOS 7.8)已经可以从Github下载:pkg.tgz
v0.3.0
首个Pigsty公开测试版本现在已经释出!
监控系统
Pigsty v0.3 包含以下8个监控面板作为开源内容:
- PG Overview
- PG Cluster
- PG Service
- PG Instance
- PG Database
- PG Table Overview
- PG Table Catalog
- Node
离线安装包
- v0.3 离线安装包(CentOS 7.8)已经可以从Github下载:pkg.tgz
13 - 同类对比
与 RDS 对比
Pigsty 是使用 Apache-2.0 开源的本地优先 RDS 替代,可以部署在您自己的物理机/虚拟机上,也可以部署在云服务器上。
因此,我们选择了全球份额第一的亚马逊云 AWS RDS for PostgreSQL,以及中国市场份额第一的阿里云 RDS for PostgreSQL 作为参照对象。
阿里云 RDS 与 AWS RDS 均为闭源云数据库服务,通过租赁模式,仅在公有云上对外提供,以下对比基于最新的 PostgreSQL 16 主干版本进行,对比截止日期为 2024 年 2 月份。
功能特性
| 指标 | Pigsty | Aliyun RDS | AWS RDS |
|---|---|---|---|
| 大版本支持 | 13 - 18 | 13 - 18 | 13 - 18 |
| 只读从库 | 支持任意数量只读从库 | 备实例不对用户开放 | 备实例不对用户开放 |
| 读写分离 | 支持端口区分读写流量 | 独立收费组件 | 独立收费组件 |
| 快慢分离 | 支持离线 ETL 实例 | 未见相关特性 | 未见相关特性 |
| 异地灾备 | 支持备份集群 | 支持多可用区部署 | 支持多可用区部署 |
| 延迟从库 | 支持延迟实例 | 未见相关特性 | 未见相关特性 |
| 负载均衡 | HAProxy / LVS | 独立收费组件 | 独立收费组件 |
| 连接池 | Pgbouncer | 独立收费组件:RDS | 独立收费组件:RDS Proxy |
| 高可用 | Patroni / etcd | 需高可用版提供支持 | 需高可用版提供支持 |
| 时间点恢复 | pgBackRest / MinIO | 提供备份支持 | 提供备份支持 |
| 指标监控 | VictoriaMetrics / Exporter | 免费基础版/收费进阶版 | 免费基础版/收费进阶版 |
| 日志采集 | VictoriaLogs / Vector | 基础支持 | 基础支持 |
| 可视化系统 | Grafana / Echarts | 提供基本监控 | 提供基本监控 |
| 告警聚合通知 | AlterManager | 基础支持 | 基础支持 |
重要扩展
这里列出了一些重要扩展,对比基于最新的 PostgreSQL 16 主干版本进行,截止至 2024-02-28
| 扩展名称 | Pigsty RDS / PGDG 官方仓库 | 阿里云 RDS | AWS RDS |
|---|---|---|---|
| 加装扩展 | 自由加装 | 不允许 | 不允许 |
| 地理空间 | PostGIS 3.4.2 | PostGIS 3.3.4 / Ganos 6.1 | PostGIS 3.4.1 |
| 雷达点云 | PG PointCloud 1.2.5 | Ganos PointCloud 6.1 | |
| 向量嵌入 | PGVector 0.6.1 / Svector 0.5.6 | pase 0.0.1 | PGVector 0.6 |
| 机器学习 | PostgresML 2.8.1 | ||
| 时序扩展 | TimescaleDB 2.14.2 | ||
| 水平分布式 | Citus 12.1 | ||
| 列存扩展 | Hydra 1.1.1 | ||
| 全文检索 | pg_bm25 0.5.6 | ||
| 图数据库 | Apache AGE 1.5.0 | ||
| GraphQL | PG GraphQL 1.5.0 | ||
| OLAP | pg_analytics 0.5.6 | ||
| 消息队列 | pgq 3.5.0 | ||
| DuckDB | duckdb_fdw 1.1 | ||
| 模糊分词 | zhparser 1.1 / pg_bigm 1.2 | zhparser 1.0 / pg_jieba | pg_bigm 1.2 |
| CDC抽取 | wal2json 2.5.3 | wal2json 2.5 | |
| 膨胀治理 | pg_repack 1.5.0 | pg_repack 1.4.8 | pg_repack 1.5.0 |
AWS RDS PG 可用扩展
AWS RDS for PostgreSQL 16 可用扩展(已刨除PG自带扩展)
| name | pg16 | pg15 | pg14 | pg13 | pg12 | pg11 | pg10 |
|---|---|---|---|---|---|---|---|
| amcheck | 1.3 | 1.3 | 1.3 | 1.2 | 1.2 | yes | 1 |
| auto_explain | yes | yes | yes | yes | yes | yes | yes |
| autoinc | 1 | 1 | 1 | 1 | null | null | null |
| bloom | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| bool_plperl | 1 | 1 | 1 | 1 | null | null | null |
| btree_gin | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.2 |
| btree_gist | 1.7 | 1.7 | 1.6 | 1.5 | 1.5 | 1.5 | 1.5 |
| citext | 1.6 | 1.6 | 1.6 | 1.6 | 1.6 | 1.5 | 1.4 |
| cube | 1.5 | 1.5 | 1.5 | 1.4 | 1.4 | 1.4 | 1.2 |
| dblink | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 |
| dict_int | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| dict_xsyn | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| earthdistance | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 |
| fuzzystrmatch | 1.2 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 |
| hstore | 1.8 | 1.8 | 1.8 | 1.7 | 1.6 | 1.5 | 1.4 |
| hstore_plperl | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| insert_username | 1 | 1 | 1 | 1 | null | null | null |
| intagg | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 |
| intarray | 1.5 | 1.5 | 1.5 | 1.3 | 1.2 | 1.2 | 1.2 |
| isn | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.1 |
| jsonb_plperl | 1 | 1 | 1 | 1 | 1 | null | null |
| lo | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 |
| ltree | 1.2 | 1.2 | 1.2 | 1.2 | 1.1 | 1.1 | 1.1 |
| moddatetime | 1 | 1 | 1 | 1 | null | null | null |
| old_snapshot | 1 | 1 | 1 | null | null | null | null |
| pageinspect | 1.12 | 1.11 | 1.9 | 1.8 | 1.7 | 1.7 | 1.6 |
| pg_buffercache | 1.4 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 |
| pg_freespacemap | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 |
| pg_prewarm | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.1 |
| pg_stat_statements | 1.1 | 1.1 | 1.9 | 1.8 | 1.7 | 1.6 | 1.6 |
| pg_trgm | 1.6 | 1.6 | 1.6 | 1.5 | 1.4 | 1.4 | 1.3 |
| pg_visibility | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 |
| pg_walinspect | 1.1 | 1 | null | null | null | null | null |
| pgcrypto | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 |
| pgrowlocks | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 |
| pgstattuple | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 |
| plperl | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| plpgsql | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| pltcl | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| postgres_fdw | 1.1 | 1.1 | 1.1 | 1 | 1 | 1 | 1 |
| refint | 1 | 1 | 1 | 1 | null | null | null |
| seg | 1.4 | 1.4 | 1.4 | 1.3 | 1.3 | 1.3 | 1.1 |
| sslinfo | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 |
| tablefunc | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| tcn | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| tsm_system_rows | 1 | 1 | 1 | 1 | 1 | 1 | 1.1 |
| tsm_system_time | 1 | 1 | 1 | 1 | 1 | 1 | 1.1 |
| unaccent | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 |
| uuid-ossp | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 |
Aliyun RDS PG 可用扩展
阿里云 RDS for PostgreSQL 16 可用扩展(已刨除PG自带扩展)
| name | pg16 | pg15 | pg14 | pg13 | pg12 | pg11 | pg10 | ali_desc |
|---|---|---|---|---|---|---|---|---|
| bloom | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 提供一种基于布鲁姆过滤器的索引访问方法。 |
| btree_gin | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.2 | 提供一个为多种数据类型和所有enum类型实现B树等价行为的GIN操作符类示例。 |
| btree_gist | 1.7 | 1.7 | 1.6 | 1.5 | 1.5 | 1.5 | 1.5 | 提供一个为多种数据类型和所有enum类型实现B树等价行为的GiST操作符类示例。 |
| citext | 1.6 | 1.6 | 1.6 | 1.6 | 1.6 | 1.5 | 1.4 | 提供一种大小写不敏感的字符串类型。 |
| cube | 1.5 | 1.5 | 1.5 | 1.4 | 1.4 | 1.4 | 1.2 | 提供一种数据类型来表示多维立方体。 |
| dblink | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 跨库操作表。 |
| dict_int | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 附加全文搜索词典模板的示例。 |
| earthdistance | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 提供两种不同的方法来计算地球表面的大圆距离。 |
| fuzzystrmatch | 1.2 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 判断字符串之间的相似性和距离。 |
| hstore | 1.8 | 1.8 | 1.8 | 1.7 | 1.6 | 1.5 | 1.4 | 在单一PostgreSQL值中存储键值对。 |
| intagg | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 提供一个整数聚集器和一个枚举器。 |
| intarray | 1.5 | 1.5 | 1.5 | 1.3 | 1.2 | 1.2 | 1.2 | 提供一些有用的函数和操作符来操纵不含空值的整数数组。 |
| isn | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.1 | 按照一个硬编码的前缀列表对输入进行验证,也被用来在输出时连接号码。 |
| ltree | 1.2 | 1.2 | 1.2 | 1.2 | 1.1 | 1.1 | 1.1 | 用于表示存储在一个层次树状结构中的数据的标签。 |
| pg_buffercache | 1.4 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 提供一种方法实时检查共享缓冲区。 |
| pg_freespacemap | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 检查空闲空间映射(FSM)。 |
| pg_prewarm | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.1 | 提供一种方便的方法把数据载入到操作系统缓冲区或者PostgreSQL缓冲区。 |
| pg_stat_statements | 1.1 | 1.1 | 1.9 | 1.8 | 1.7 | 1.6 | 1.6 | 提供一种方法追踪服务器执行的所有SQL语句的执行统计信息。 |
| pg_trgm | 1.6 | 1.6 | 1.6 | 1.5 | 1.4 | 1.4 | 1.3 | 提供字母数字文本相似度的函数和操作符,以及支持快速搜索相似字符串的索引操作符类。 |
| pgcrypto | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 为PostgreSQL提供了密码函数。 |
| pgrowlocks | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 提供一个函数来显示一个指定表的行锁定信息。 |
| pgstattuple | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | 提供多种函数来获得元组层的统计信息。 |
| plperl | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 提供perl过程语言。 |
| plpgsql | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 提供SQL过程语言。 |
| pltcl | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 提供tcl过程语言。 |
| postgres_fdw | 1.1 | 1.1 | 1.1 | 1 | 1 | 1 | 1 | 跨库操作表。 |
| sslinfo | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 提供当前客户端提供的 SSL 证书的有关信息。 |
| tablefunc | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 包括多个返回表的函数。 |
| tsm_system_rows | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 提供表采样方法SYSTEM_ROWS。 |
| tsm_system_time | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 提供了表采样方法SYSTEM_TIME。 |
| unaccent | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 文本搜索字典,它能从词位中移除重音(附加符号)。 |
| uuid-ossp | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 提供函数使用几种标准算法之一产生通用唯一标识符(UUID)。 |
| xml2 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 提供XPath查询和XSLT功能。 |
性能对比
| 指标 | Pigsty | Aliyun RDS | AWS RDS |
|---|---|---|---|
| 最佳性能 | PGTPC on NVME SSD 评测 sysbench oltp_rw | RDS PG 性能白皮书 sysbench oltp 场景 每核 QPS 4000 ~ 8000 | |
| 存储规格:最高档容量 | 32TB / NVME SSD | 32 TB / ESSD PL3 | 64 TB / io2 EBS Block Express |
| 存储规格:最高档IOPS | 4K随机读:最大3M,随机写 2000~350K | 4K随机读:最大 1M | 16K随机IOPS: 256K |
| 存储规格:最高档延迟 | 4K随机读:75µs,随机写 15µs | 4K随机读:200µs | 500µs / 推断为16K随机IO |
| 存储规格:最高档可靠性 | UBER < 1e-18,折合18个9 MTBF: 200万小时 5DWPD,持续三年 | 可靠性 9个9, 合 UBER 1e-9 存储与数据可靠性 | 持久性:99.999%,5个9 (0.001% 年故障率) io2 说明 |
| 存储规格:最高档成本 | 31.5 ¥/TB·月 ( 5年质保均摊 / 3.2T / 企业级 / MLC ) | 3200¥/TB·月 (原价 6400¥,包月4000¥) 3年预付整体打5折才有此价格 | 1900 ¥/TB·月 使用最大规格 65536GB / 256K IOPS 最大优惠 |
可观测性
Pigsty 提供了近 3000 类监控指标,提供了 50+ 监控面板,覆盖了数据库监控、主机监控、连接池监控、负载均衡监控等方方面面,为用户提供无与伦比的可观测性体验。

Pigsty 提供了 638 与 PostgreSQL 有关的监控指标,而 AWS RDS 只有 99 个,阿里云 RDS 更是只有个位数指标:

此外,也有一些项目提供了监控 PostgreSQL 的能力,但都相对比较简单初级:
- pgwatch: 123 类指标
- pgmonitor : 156 类指标
- datadog : 69 类指标
- pgDash
- ClusterControl
- pganalyze
- Aliyun RDS : 8 类指标
- AWS RDS : 99 类指标
- Azure RDS
可维护性
| 指标 | Pigsty | Aliyun RDS | AWS RDS |
|---|---|---|---|
| 系统易用性 | 简单 | 简单 | 简单 |
| 配置管理 | 配置文件 / CMDB 基于 Ansible Inventory | 可使用 Terraform | 可使用 Terraform |
| 变更方式 | 幂等剧本 基于 Ansible Playbook | 控制台点击操作 | 控制台点击操作 |
| 参数调优 | 自动根据节点适配 四种预置模板 OLTP, OLAP, TINY, CRIT | ||
| Infra as Code | 原生支持 | 可使用 Terraform | 可使用 Terraform |
| 可定制参数点 | Pigsty Parameters 283 个 | ||
| 服务与支持 | 提供商业订阅支持兜底 | 提供售后工单支持 | 提供售后工单支持 |
| 无互联网部署 | 可离线安装部署 | N/A | N/A |
| 数据库迁移 | 提供从现有v10+ PG实例基于逻辑复制不停机迁移至Pigsty托管实例的剧本 | 提供上云辅助迁移 Aliyun RDS 数据同步 |
成本
经验上看,软硬件资源的部分 RDS 单位成本是自建的 5 ~ 15 倍,租售比通常在一个月。详情请参考 成本分析。
| 要素 | 指标 | Pigsty | Aliyun RDS | AWS RDS |
|---|---|---|---|---|
| 成本 | 软件授权/服务费用 | 免费,硬件约 20 - 40 ¥/核·月 | 200 ~ 400 ¥/核·月 | 400 ~ 1300 ¥/核·月 |
| 服务支持费用 | 服务约 100 ¥/ 核·月 | 包含在 RDS 成本中 |
其他本地数据库管控软件
一些提供管理 PostgreSQL 能力的软件与供应商
- Aiven: 闭源商业云托管方案
- Percona: 商业咨询,简易PG发行版
- ClusterControl:商业数据库管控软件
其他 Kubernetes Operator
Pigsty 拒绝在生产环境中使用 Kubernetes 管理数据库,因此与这些方案在生态位上存在差异。
- PGO
- StackGres
- CloudNativePG
- TemboOperator
- PostgresOperator
- PerconaOperator
- Kubegres
- KubeDB
- KubeBlocks
更多信息请参阅:
13.1 - 成本对比
总体概览
| EC2 | 核·月 | RDS | 核·月 |
|---|---|---|---|
| DHH 自建核月价格(192C 384G) | 25.32 | 初级开源数据库DBA参考工资 | 15K/人·月 |
| IDC自建机房(独占物理机: 64C384G) | 19.53 | 中级开源数据库DBA参考工资 | 30K/人·月 |
| IDC自建机房(容器,超卖500%) | 7 | 高级开源数据库DBA参考工资 | 60K/人·月 |
| UCloud 弹性虚拟机(8C16G,有超卖) | 25 | ORACLE 数据库授权 | 10000 |
| 阿里云 弹性服务器 2x内存(独占无超卖) | 107 | 阿里云 RDS PG 2x内存(独占) | 260 |
| 阿里云 弹性服务器 4x内存(独占无超卖) | 138 | 阿里云 RDS PG 4x内存(独占) | 320 |
| 阿里云 弹性服务器 8x内存(独占无超卖) | 180 | 阿里云 RDS PG 8x内存(独占) | 410 |
| AWS C5D.METAL 96C 200G (按月无预付) | 100 | AWS RDS PostgreSQL db.T2 (2x) | 440 |
| AWS C5D.METAL 96C 200G (预付三年) | 80 | AWS RDS PostgreSQL db.M5 (4x) | 611 |
| AWS C7A.METAL 192C 384G (预付三年) | 104.8 | AWS RDS PostgreSQL db.R6G (8x) | 786 |
RDS成本参考
| 付费模式 | 价格 | 折合每年(万¥) |
|---|---|---|
| IDC自建(单物理机) | ¥7.5w / 5年 | 1.5 |
| IDC自建(2~3台组HA) | ¥15w / 5年 | 3.0 ~ 4.5 |
| 阿里云 RDS 按需 | ¥87.36/时 | 76.5 |
| 阿里云 RDS 月付(基准) | ¥4.2w / 月 | 50 |
| 阿里云 RDS 年付(85折) | ¥425095 / 年 | 42.5 |
| 阿里云 RDS 3年付(5折) | ¥750168 / 3年 | 25 |
| AWS 按需 | $25,817 / 月 | 217 |
| AWS 1年不预付 | $22,827 / 月 | 191.7 |
| AWS 3年全预付 | 12w$ + 17.5k$/月 | 175 |
| AWS 中国/宁夏按需 | ¥197,489 / 月 | 237 |
| AWS 中国/宁夏1年不预付 | ¥143,176 / 月 | 171 |
| AWS 中国/宁夏3年全预付 | ¥647k + 116k/月 | 160.6 |
我们可以对比一下自建与云数据库的成本差异:
| 方式 | 折合每年(万元) |
|---|---|
| IDC托管服务器 64C / 384G / 3.2TB NVME SSD 660K IOPS (2~3台) | 3.0 ~ 4.5 |
| 阿里云 RDS PG 高可用版 pg.x4m.8xlarge.2c, 64C / 256GB / 3.2TB ESSD PL3 | 25 ~ 50 |
| AWS RDS PG 高可用版 db.m5.16xlarge, 64C / 256GB / 3.2TB io1 x 80k IOPS | 160 ~ 217 |
ECS 成本参考
排除 NVMe SSD / ESSD PL3 后的纯算力价格对比
以阿里云为例,纯算力包月模式的价格是自建基准的 5 ~ 7 倍,预付五年的价格是自建的 2 倍
| 付费模式 | 单价(¥/核·月) | 相对于标准价格 | 自建溢价倍率 |
|---|---|---|---|
| 按量付费(1.5倍) | ¥ 202 | 160 % | 9.2 ~ 11.2 |
| 包月(标准价格) | ¥ 126 | 100 % | 5.7 ~ 7.0 |
| 预付一年(65折) | ¥ 83.7 | 66 % | 3.8 ~ 4.7 |
| 预付二年(55折) | ¥ 70.6 | 56 % | 3.2 ~ 3.9 |
| 预付三年(44折) | ¥ 55.1 | 44 % | 2.5 ~ 3.1 |
| 预付四年(35折) | ¥ 45 | 35 % | 2.0 ~ 2.5 |
| 预付五年(30折) | ¥ 38.5 | 30 % | 1.8 ~ 2.1 |
| DHH @ 2023 | ¥ 22.0 | ||
| 探探 IDC 自建 | ¥ 18.0 |
含 NVMe SSD / ESSD PL3 情况下的等效价格对比
包含常用规格后的 NVMe SSD 规格之后,纯算力包月模式的价格是自建基准的 11 ~ 14 倍,预付五年的价格是自建的 9 倍左右。
| 付费模式 | 单价(¥/核·月) | + 40GB ESSD PL3 | 自建溢价比例 |
|---|---|---|---|
| 按量付费(1.5倍) | ¥ 202 | ¥ 362 | 14.3 ~ 18.6 |
| 包月(标准价格) | ¥ 126 | ¥ 286 | 11.3 ~ 14.7 |
| 预付一年(65折) | ¥ 83.7 | ¥ 244 | 9.6 ~ 12.5 |
| 预付二年(55折) | ¥ 70.6 | ¥ 230 | 9.1 ~ 11.8 |
| 预付三年(44折) | ¥ 55.1 | ¥ 215 | 8.5 ~ 11.0 |
| 预付四年(35折) | ¥ 45 | ¥ 205 | 8.1 ~ 10.5 |
| 预付五年(30折) | ¥ 38.5 | ¥ 199 | 7.9 ~ 10.2 |
| DHH @ 2023 | ¥ 25.3 | ||
| 探探 IDC 自建 | ¥ 19.5 |
DHH案例:192核配12.8TB Gen4 SSD (1c:66);探探案例: 64核配3.2T Gen3 MLC SSD (1c:50)。
云上价格每核配比40GB ESSD PL3(1核:4x内存:40x磁盘)计算。
EBS成本参考
| 评估因素 | 本地 PCI-E NVME SSD | Aliyun ESSD PL3 | AWS io2 Block Express |
|---|---|---|---|
| 容量 | 32TB | 32 TB | 64 TB |
| IOPS | 4K随机读:600K ~ 1.1M 4K随机写 200K ~ 350K | 4K随机读:最大 1M | 16K随机IOPS: 256K |
| 延迟 | 4K随机读:75µs 4K随机写:15µs | 4K 随机读: 200µs | 随机IO:500µs 上下文推断为16K |
| 可靠性 | UBER < 1e-18,折合18个9 MTBF: 200万小时 5DWPD,持续三年 | 数据可靠性 9个9 存储与数据可靠性 | 持久性:99.999%,5个9 (0.001% 年故障率) io2 说明 |
| 成本 | **16 ¥/TB·**月 ( 5年均摊 / 3.2T MLC ) 5 年质保,¥3000 零售 | **3200¥/TB·**月 (原价 6400¥,包月4000¥) 3年预付整体打5折才有此价格 | **1900 ¥/TB·**月 使用最大规格 65536GB 256K IOPS 最优惠状态 |
| SLA | 5年质保 出问题直接换新 | Aliyun RDS SLA 可用性 99.99%: 月费 15% 99%: 月费 30% 95%: 月费 100% | Amazon RDS SLA 可用性 99.95%: 月费 15% 99%: 月费 25% 95%: 月费 100% |
S3成本参考
| Date | $/GB·月 | ¥/TB·5年 | HDD ¥/TB | SSD ¥/TB |
|---|---|---|---|---|
| 2006.03 | 0.150 | 63000 | 2800 | |
| 2010.11 | 0.140 | 58800 | 1680 | |
| 2012.12 | 0.095 | 39900 | 420 | 15400 |
| 2014.04 | 0.030 | 12600 | 371 | 9051 |
| 2016.12 | 0.023 | 9660 | 245 | 3766 |
| 2023.12 | 0.023 | 9660 | 105 | 280 |
| 其他参考价 | 高性能存储 | 顶配底折价 | 与采购NVMe SSD | 价格参考 |
| S3 Express | 0.160 | 67200 | DHH 12T | 1400 |
| EBS io2 | 0.125 + IOPS | 114000 | Shannon 3.2T | 900 |
下云合集
曾几何时,“上云“近乎成为技术圈的政治正确,整整一代应用开发者的视野被云遮蔽。就让我们用实打实的数据分析与亲身经历,讲清楚公有云租赁模式的价值与陷阱 —— 在这个降本增效的时代中,供您借鉴与参考 —— 请看 《云计算泥石流:合订本》
云基础资源篇
云商业模式篇
下云奥德赛篇
云故障复盘篇
RDS翻车篇
云厂商画像篇
互联网技术大师速成班 【转载】
门内的国企如何看门外的云厂商【转载】
卡在政企客户门口的阿里云【转载】
互联网故障背后的草台班子们【转载】
云厂商眼中的客户:又穷又闲又缺爱【转载】






