自分のマシンから Postgres を実行しているサーバーに接続できません。私はそれをすべて正しく設定したと思います。サーバーにファイアウォールはありません。
Ubuntu 12.04 LTS で Postgres 9.1.9 を実行しています
これは /etc/postgresql/9.1/main/pg_hba.conf からのものです
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
local all all peer
host all all 0.0.0.0/0 md5
host all all ::1/128 md5
listen_addresses = '*'/etc/postgresql/9.1/main/postgresql.confにあります
サービスの停止と開始を何度も繰り返しました。
netstat -tulnp:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN 19312/mongod
tcp 0 0 0.0.0.0:28017 0.0.0.0:* LISTEN 19312/mongod
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 978/sshd
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 30239/postgres
tcp6 0 0 :::22 :::* LISTEN 978/sshd
tcp6 0 0 :::5432 :::* LISTEN 30239/postgres
私のiptableは空です。
サーバーに接続しようとすると
psql -U postgres -h <MY_IP>
私は得る:
psql: could not connect to server: Operation timed out
Is the server running on host "<MY_IP>" and accepting
TCP/IP connections on port 5432?
何か助けはありますか?ありがとう
編集
ポート 5432 の tcpdump:
16:33:10.548507 7c:c3:a1:a2:d9:27 (oui Unknown) > 00:00:5e:00:01:01 (oui Unknown), ethertype IPv4 (0x0800), length 78: <MY_MAC> > <MY_SERVER>.postgresql: Flags [S], seq 95915852, win 65535, options [mss 1460,nop,wscale 4,nop,nop,TS val 1189142453 ecr 0,sackOK,eol], length 0