pgadmin 无法连接 centos7 postgresql 问题

首先 查看

1.用 ps -ef|grep postgres 查看进程是否已经启动;正常情况如下:

postgres 1445 1 0 07:54 ? 00:00:00 /usr/bin/postgres -D /var/lib/pgsql/data -p 5432
postgres 1853 1445 0 07:54 ? 00:00:00 postgres: logger process
postgres 2075 1445 0 07:54 ? 00:00:00 postgres: checkpointer process
postgres 2076 1445 0 07:54 ? 00:00:00 postgres: writer process
postgres 2077 1445 0 07:54 ? 00:00:00 postgres: wal writer process
postgres 2078 1445 0 07:54 ? 00:00:00 postgres: autovacuum launcher process
postgres 2079 1445 0 07:54 ? 00:00:00 postgres: stats collector process
root 7135 3247 0 09:08 pts/0 00:00:00 grep --color=auto postgres

2.用netstat -tpnl|grep 5432查看端口是否被监听;正常情况如下:

tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 1445/postgres
tcp6 0 0 :::5432 :::* LISTEN 1445/postgres

3.用iptables -L -n|grep 5432查看端口是否被允许;正常情况如下:

ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:5432

可以用telnet host_ip 5432进行测试是否能连接。

只要上3步都正常pqAdmin就能够连接。

 

posted on 2014-10-15 09:16  lion382  阅读(1704)  评论(0编辑  收藏  举报