Re: psql remote database access
От | Samed YILDIRIM |
---|---|
Тема | Re: psql remote database access |
Дата | |
Msg-id | 239761478786264@web23o.yandex.ru обсуждение исходный текст |
Ответ на | Re: psql remote database access (Samed YILDIRIM <samed@reddoc.net>) |
Ответы |
Re: psql remote database access
("Ron Watkins" <rwatkins@dssolutions.com>)
|
Список | pgsql-admin |
<div>Sorry, reloading of postgres is enough for pg_hba.conf changes.</div><div><br /></div><div><br /></div><div>İyi çalışmalar.</div><div>SamedYILDIRIM</div><div><br /></div><div><br /></div><div><br /></div><div>10.11.2016, 15:53, "SamedYILDIRIM" <samed@reddoc.net>:</div><blockquote type="cite"><div>Hi,</div><div> </div><div>It is written on errorlog of psql. Postgres service sees your IP as 10.0.0.254, not 10.42.42.16. Most probably there is a NAT between yourbox and Postgres service. You should add following entry to pg_hba.conf and restart Postgres.</div><div> </div><div><spanstyle="font-size:8pt;font-family:"Courier New";">host all all 10.0.0.254/32 md5</span></div><div> </div><div>Best regards.</div><div> </div><div><br /></div><div><br/></div><div>İyi çalışmalar.</div><div>Samed YILDIRIM</div><div><br /></div><div><br /></div><div><br /></div><div>10.11.2016,15:47, "Ron Watkins" <<a href="mailto:rwatkins@dssolutions.com">rwatkins@dssolutions.com</a>>:</div><blockquotetype="cite"><div lang="EN-US" link="blue"vlink="purple"><div><p>Im sure this has been addressed somewhere, but I wasn’t able to locate any answers.<p>Ihave a postgres database running on a different host and I need to access it remotely from another box.<p> <p>Boxesare CentOS 6, and I opened the firewall port 5432 on the database server host.<p>Also, on the database serverhost, I made the following entries to <span style="font-size:8pt;font-family:"Courier New";">/var/lib/pgsql/9.6/data/pg_hba.conf.</span><p><spanstyle="font-size:8pt;font-family:"Courier New";">local all all md5</span><p><span style="font-size:8pt;font-family:"Courier New";">host all all <a href="http://127.0.0.1/32">127.0.0.1/32</a> md5</span><p><spanstyle="font-size:8pt;font-family:"Courier New";">host all all <a href="http://10.42.42.16/24">10.42.42.16/24</a> md5</span><p><span style="font-size:8pt;font-family:"Courier New";"> </span><p>WhenI try to use psql to attach to the remote database, I get the following error: <p><span style="font-size:8pt;font-family:"CourierNew";">[root@host1 ~]# psql -h host2 -p 5432 -U postgres</span><p><span style="font-size:8pt;font-family:"CourierNew";">psql: FATAL: no pg_hba.conf entry for host "10.0.0.254", user "postgres",database "postgres", SSL off</span></div></div></blockquote></blockquote>
В списке pgsql-admin по дате отправления: