【发布时间】:2013-05-17 05:40:12
【问题描述】:
我想连接两个不同系统的postgreSQL数据库。我正在使用 dblink 连接两个 postgreSQL 数据库。
但我收到连接错误提示
ERROR: could not establish connection
DETAIL: could not connect to server: No route to host (0x00002751/10065)
Is the server running on host "192.168.0.5" and accepting
TCP/IP connections on port 5432?
********** Error **********
ERROR: could not establish connection
SQL state: 08001
Detail: could not connect to server: No route to host (0x00002751/10065)
Is the server running on host "192.168.0.5" and accepting
TCP/IP connections on port 5432?
我正在尝试的是
select * from dblink('user=postgres host=192.168.0.5 password=geethu dbname=partition','select count(*) from part1') as qwe(tid int);
我已经编辑了 hba.con 文件和 postgresql.conf 文件,包括了 IP 地址并将listen_address 设置为 *
谁能帮帮我?提前致谢
【问题讨论】:
-
好吧,首先在
psql中测试它。相同的连接字符串在同一主机上的psql中是否有效?psql 'user=postgres host=192.168.0.5 password=geethu dbname=partition'。如果它在psql中有效,我会考虑 SELinux 或特定于进程的防火墙作为可能的罪魁祸首。 -
通过执行上述相同的任务,我可以连接到另一个系统......但事实是我在大约两个月后建立了连接......我怀疑我是否有任何步骤...没有防火墙问题..我只是确保它。
-
这不是很清楚。您是否在 完全相同的系统 上运行了
psql命令,您在使用 dblink 连接 from 时遇到问题的 PostgreSQL 服务器在其上运行?您是否使用sudo -u postgres psql ...在该系统上以postgres用户身份尝试过?并且您正在从建立连接的系统是否启用了 SELinux? 是否有有防火墙,无论是软件(iptables 等)还是介于两者之间的硬件防火墙/路由器? -
另外,请显示两个服务器的确切操作系统和版本以及确切的 postgresql 版本。
-
实际上我没有使用 psql 两个系统的 sql 版本都是 9.2
标签: postgresql-9.2