我一直在尝试将Postgresql-server从以下A连接到B。
机器A
CentOS版本6.9(Final)+ postgres8.4,但是在这种情况下是客户端。
机器B
CentOS Linux版本7.4.1708(核心)+ postgres 9.2作为服务器。
当我使用ODBC进行连接时,它被重新使用。
-通过ODBC失败
function animateLine(timestamp) {
if (resetTime) {
// resume previous progress
startTime = performance.now() - progress;
resetTime = false;
} else {
progress = timestamp - startTime;
}
// restart if it finishes a loop
if (progress > speedFactor * 360) {
startTime = timestamp;
geojson.features[0].geometry.coordinates = [];
geojson.features[1].geometry.coordinates = []; //Line 1
} else {
let x = progress / speedFactor;
// draw a sine wave with some math.
let y = Math.sin(x * Math.PI / 90) * 40;
let y2 = Math.cos(x * Math.PI / 90) * 40; //Line 2
// append new coordinates to the lineString
geojson.features[0].geometry.coordinates.push([x, y]);
geojson.features[1].geometry.coordinates.push([x, y2]); //Line 3
// then update the map
map.getSource('line-animation').setData(geojson);
}
// Request the next frame of the animation.
animation = requestAnimationFrame(animateLine);
}
但是,我可以通过psql命令进行连接。
-通过psql命令成功。
# /usr/bin/isql -v pg_ldap
[08001][unixODBC]Could not connect to the server;
Could not connect to remote socket immedaitely
[ISQL]ERROR: Could not SQLConnect
#
我在下面使用odbc驱动器。
# psql -h 10.1.3.10 -U ldap
Password for user ldap:
psql (8.4.20, server 9.2.23)
WARNING: psql version 8.4, server version 9.2.
Some psql features might not work.
Type "help" for help.
ldap=#
/etc/odbc.ini
postgresql-odbc.x86_64 08.04.0200-1.el6
我已经成功在localhost进行ODBC连接,这意味着使用A作为服务器本身。
有人建议我如何解决此问题吗?
我为[pg_ldap]
Descrioption = ldap test in this localhost
Driver = PostgreSQL
Database = ldap
Server = 10.1.3.10
#Server = localhost
Username = ldap
Password = ******
Port = 5432
Carset = utf8
打开了Machine-B的防火墙,为port 5432
设置了postgresql.conf,并为从Machine-A接受而设置了pg_hba.conf