可以的,CentOS 完全可以运行 PostgreSQL 集群。
下面从几个层面说明:
PostgreSQL 官方和社区都提供 RHEL / CentOS 系列 的 RPM 包(通过 PostgreSQL YUM 仓库),支持:
安装示例(CentOS 7/8):
dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-$(rpm -E %{rhel})-x86_64/pgdg-redhat-repo-latest.noarch.rpm
dnf install -y postgresql15-server postgresql15
✅ 最常用
特点:
以下方案 在 CentOS 上非常成熟:
| 方案 | 说明 |
|---|---|
| Patroni + etcd + HAProxy | 工业级高可用 |
| repmgr | 轻量级主从管理 |
| Pgpool-II | 连接池 + 负载均衡 |
| Corosync + Pacemaker | 传统 HA |
✅ CentOS 同样支持,但运维复杂度更高
firewalld)要放行 5432✅ CentOS 能运行 PostgreSQL 集群
✅ 支持从简单主从到企业级高可用
⚠️ 注意系统生命周期,生产环境建议迁移到 RHEL 衍生版
如果你是:
可以告诉我你的场景,我可以给你一套具体方案。