我正在部署两台带有两个 PostgreSQL 数据库(一个主模型和一个备用模型)的服务器。我已将主服务器上的 pg_hba.conf
设置为
host replication replicator <my standby ip addr> md5
而且我还在 postgresql.conf
listen_addresses = '*'
但是当我尝试在备用服务器上运行此命令时
pg_basebackup -h <primary server ip addr> -D /var/lib/postgresql/12/main -U replicator -P -v -R -X stream -C -S node2
它返回了这个错误信息
pg_basebackup: error: could not connect to server: Connection refused
Is the server running on host "<primary ip addr>" and accepting
TCP/IP connections on port 5432
还验证了已启用对端口 5432 的访问,因为我能够通过 SSH 从 pgadmin 连接到它。
我的服务器在 Ubuntu 20.04 上运行,安装了 Postgresql 12 版
有什么我遗漏的吗?