无法连接到 Postgres 服务器

Can't connect to Postgres server

我正在尝试 运行 pg_basebackup 以创建从属服务器,但我不断收到此错误:

pg_basebackup: could not connect to server: could not connect to server: No route to host
    Is the server running on host "192.168.1.164" and accepting
    TCP/IP connections on port 5432?

192.168.1.164 服务器上,postgresql.conf 文件有:

listen_addresses = '*' # originally 'localhost, 192.168.1.63'
port = 5432

并且 pg_hba.conf 文件有:

host    replication     replicator      192.168.1.63/32 md5

其中 192.168.1.63 是从属服务器。

两台机器之间的 link 很好,因为我可以使用这些 IP 从任何一台 SSH 连接到另一台。此外,service postgresql 在主服务器上 started,在从服务器上 stoped。主人有一个 Postgres 用户 replicator.

我运行两台机器都安装了 PostgreSQL 9.4.4 和 Fedora 22。

EDIT:从master的psql中,运行ning SHOW config_file;SHOW hba_file;与我一直在编辑的文件匹配,当然,编辑后服务器重新启动.

原来是防火墙问题。解决方案是这样的:

firewall-cmd --permanent --add-port=5432/tcp
firewall-cmd --add-port=5432/tcp

注意:我来自Ubuntu,没有封锁这个端口,所以我没有意识到它需要打开。