Re: Help with connection issue - started today

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Help with connection issue - started today
Дата
Msg-id CAHyXU0zyH2=nWu4nD=Ye7ArUbNSZPp_MbYxXexPB+QaTVGgEjA@mail.gmail.com
обсуждение исходный текст
Ответ на Help with connection issue - started today  (Edson Richter <edsonrichter@hotmail.com>)
Ответы Re: Help with connection issue - started today  (Adrian Klaver <adrian.klaver@gmail.com>)
Список pgsql-general
On Wed, Feb 5, 2014 at 5:21 AM, Edson Richter <edsonrichter@hotmail.com> wrote:
> Dear all, I need your advise. Found a tricky situation.
>
> Without any changes in the configuration files, a **local** connection to a
> local VPN IP address could not be established with the following error:
>
> 2014-02-05 09:12:21.111 - xxxxx - org.postgresql.util.PSQLException: ERROR:
> could not establish connection
>   Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user "master",
> database "master", SSL off
>
> org.postgresql.util.PSQLException: ERROR: could not establish connection
>   Detail: FATAL:  no pg_hba.conf entry for host "10.68.73.6", user "master",
> database "master", SSL off
>
>         at
> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
>         at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
>         at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
>         at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
>         at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:403)
>         at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:331)
>         at
> org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
>         at
> org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
>         at
> org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
>         at br.com...
>
> If I run from the Local Server:
> [root@mylocalserver logs]# psql -h 10.68.73.6 -d master -U master
> Senha para usuário master:
> psql (9.2.6)
> Digite "help" para ajuda.
>
> master=> select count(*) from pessoa;
>  count
> -------
>      9
> (1 registro)
>
>
> If I run from a Remote Server:
>
> [root@myremoteserver ssh]# psql -h 10.68.73.6 -d master -U master
> Senha para usuário master:
> psql (9.2.6)
> Digite "help" para ajuda.
>
> master=> select count(*) from pessoa;
>  count
> -------
>      9
> (1 registro)
>
>
> So, seems that only JDBC is getting in trouble to connect to a local IP
> address.
> Current interfaces (and yes, the tunneling is running - otherwise the remote
> server could not connect):
>
> [root@mylocalserver logs]# ifconfig
> eth0      Link encap:Ethernet  Endereço de HW XX:XX:XX:XX:XX:XX
>           inet end.: xxx.xx.xxx.85  Bcast:xxx.xx.xxx.87 Masc:255.255.255.248
>           endereço inet6: xxxx::xxx:xxxx:xxxx:xxxx/64 Escopo:Link
>           UP BROADCASTRUNNING MULTICAST  MTU:1500  Métrica:1
>           RX packets:172557 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:293439 errors:0 dropped:0 overruns:0 carrier:0
>           colisões:0 txqueuelen:1000
>           RX bytes:24537681 (23.4 MiB)  TX bytes:227413210 (216.8 MiB)
>           IRQ:28 Memória:fb000000-fb7fffff
>
> lo        Link encap:Loopback Local
>           inet end.: 127.0.0.1  Masc:255.0.0.0
>           endereço inet6: ::1/128 Escopo:Máquina
>           UP LOOPBACKRUNNING  MTU:16436  Métrica:1
>           RX packets:138156 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:138156 errors:0 dropped:0 overruns:0 carrier:0
>           colisões:0 txqueuelen:0
>           RX bytes:31993170 (30.5 MiB)  TX bytes:31993170 (30.5 MiB)
>
> tun0      Link encap:Não Especificado  Endereço de HW
> 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
>           inet end.: 10.68.73.6  P-a-P:10.68.73.5 Masc:255.255.255.255
>           UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500 Métrica:1
>           RX packets:149106 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:274534 errors:0 dropped:199 overruns:0 carrier:0
>           colisões:0 txqueuelen:100
>           RX bytes:6291572 (6.0 MiB)  TX bytes:381732404 (364.0 MiB)

The log is telling you exactly what's happening.  "pg_hba.conf" is a
database firewall of sorts that manages whom is allowed to connect to
the database and from where.  Fixing this is a matter of adding a rule
to that file.  The file is internally well documented but you should
also read this:
http://www.postgresql.org/docs/9.3/static/auth-pg-hba-conf.html

after changing the file, you have to "reload" or restart the database.

merlin


В списке pgsql-general по дате отправления:

Предыдущее
От: alexandros_e
Дата:
Сообщение: Postgresql GROUP BY "SIMILAR" but not equal values
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Postgresql GROUP BY "SIMILAR" but not equal values