<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: HDP Ambari installation throws &amp;quot;org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host...&amp;quot; when testing connections in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/HDP-Ambari-installation-throws-quot-org-postgresql-util/m-p/277978#M207758</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/54172"&gt;@rvillanueva&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After making the changes inside the Correct "pg_hba.conf" file have you restarted the Postgres Database?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# /etc/init.d/postgresql restart
(OR)
# systemctl start postgresql&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also what is your Postgres Version like (10.5&amp;nbsp; / 10.2&amp;nbsp; / 9.6) ? SupportMatrix: &lt;A href="https://supportmatrix.hortonworks.com/" target="_blank" rel="noopener"&gt;https://supportmatrix.hortonworks.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Based on the Postgres Version the "pg_hba.conf" location might be slightly different like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/var/lib/pgsql/9.6/data/pg_hba.conf
/var/lib/pgsql/data/pg_hba.conf 
..etc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So please make sure that the changes you are making in the "pg_hba.conf" is actually the correct file.&lt;/P&gt;</description>
    <pubDate>Fri, 20 Sep 2019 22:38:50 GMT</pubDate>
    <dc:creator>jsensharma</dc:creator>
    <dc:date>2019-09-20T22:38:50Z</dc:date>
    <item>
      <title>HDP Ambari installation throws "org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host..." when testing connections</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HDP-Ambari-installation-throws-quot-org-postgresql-util/m-p/277977#M207757</link>
      <description>&lt;P&gt;Attempting to install HDP 3.1.0 via Ambari 2.7.3 using an existing postgresql DB after following the docs here (&lt;A href="https://docs.cloudera.com/HDPDocuments/Ambari-2.7.3.0/bk_ambari-installation/content/configuring_postgresql_for_ranger.html" target="_blank" rel="noopener"&gt;https://docs.cloudera.com/HDPDocuments/Ambari-2.7.3.0/bk_ambari-installation/content/configuring_postgresql_for_ranger.html&lt;/A&gt;) and entering the commands below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;----------&lt;/P&gt;
&lt;P&gt;dbname=hive&lt;/P&gt;
&lt;P&gt;postgres=postgres&lt;/P&gt;
&lt;P&gt;user=hive&lt;/P&gt;
&lt;P&gt;passwd=hive&lt;/P&gt;
&lt;P&gt;echo "CREATE DATABASE $dbname;" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;echo "CREATE USER $user WITH PASSWORD '$passwd';" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;echo "GRANT ALL PRIVILEGES ON DATABASE $dbname TO $user;" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;echo "alter user $postgres superuser;" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dbname=oozie&lt;/P&gt;
&lt;P&gt;postgres=postgres&lt;/P&gt;
&lt;P&gt;user=oozie&lt;/P&gt;
&lt;P&gt;passwd=oozie&lt;/P&gt;
&lt;P&gt;echo "CREATE DATABASE $dbname;" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;echo "CREATE USER $user WITH PASSWORD '$passwd';" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;echo "GRANT ALL PRIVILEGES ON DATABASE $dbname TO $user;" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;echo "alter user $postgres superuser;" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dbname=ranger&lt;/P&gt;
&lt;P&gt;postgres=postgres&lt;/P&gt;
&lt;P&gt;user=rangeradmin&lt;/P&gt;
&lt;P&gt;passwd=ranger&lt;/P&gt;
&lt;P&gt;echo "CREATE DATABASE $dbname;" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;echo "CREATE USER $user WITH PASSWORD '$passwd';" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;echo "GRANT ALL PRIVILEGES ON DATABASE $dbname TO $user;" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;echo "alter user $user superuser;" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dbname=rangerkms&lt;/P&gt;
&lt;P&gt;postgres=postgres&lt;/P&gt;
&lt;P&gt;user=rangerkms&lt;/P&gt;
&lt;P&gt;passwd=ranger&lt;/P&gt;
&lt;P&gt;echo "CREATE DATABASE $dbname;" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;echo "CREATE USER $user WITH PASSWORD '$passwd';" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;echo "GRANT ALL PRIVILEGES ON DATABASE $dbname TO $user;" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;echo "alter user $user superuser;" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dbname=superset&lt;/P&gt;
&lt;P&gt;postgres=postgres&lt;/P&gt;
&lt;P&gt;user=superset&lt;/P&gt;
&lt;P&gt;passwd=superset&lt;/P&gt;
&lt;P&gt;echo "CREATE DATABASE $dbname;" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;echo "CREATE USER $user WITH PASSWORD '$passwd';" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;echo "GRANT ALL PRIVILEGES ON DATABASE $dbname TO $user;" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;echo "alter user $user superuser;" | sudo -u $postgres psql -U postgres&lt;/P&gt;
&lt;P&gt;----------&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This was done based on the docs here:&amp;nbsp;&lt;A href="https://docs.cloudera.com/HDPDocuments/Ambari-2.7.3.0/administering-ambari/content/amb_using_hive_with_postgresql.html" target="_blank" rel="noopener"&gt;https://docs.cloudera.com/HDPDocuments/Ambari-2.7.3.0/administering-ambari/content/amb_using_hive_with_postgresql.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, when doing the connection tests in the Ambari installation phase that checks the databases for the services to be installed, getting the error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Error injecting constructor, java.lang.RuntimeException: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "&amp;lt;some host&amp;gt;", user "&amp;lt;some service user&amp;gt;", database "&amp;lt;some service user&amp;gt;", SSL off&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for the hive DB and I assume it would be the same for the druid and superset DBs as well if Ambari had provided a "test connection" button for those.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My question is: what is the problem here? The &lt;A href="https://docs.cloudera.com/HDPDocuments/Ambari-2.7.3.0/administering-ambari/content/amb_using_hive_with_postgresql.html" target="_self"&gt;docs&lt;/A&gt; don't seem to indicate that anything more should be done (unlike with the &lt;A href="https://docs.cloudera.com/HDPDocuments/Ambari-2.7.3.0/bk_ambari-installation/content/configuring_postgresql_for_ranger.html" target="_self"&gt;docs&lt;/A&gt; for installing ranger), so what should be done?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently, my though is to do something like was done for ranger:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[root@HW001 ~]# echo "local all postgres,rangeradmin,rangerlogger,hive,oozie,ranger,rangerkms,superset,druid trust" &amp;gt;&amp;gt; /var/lib/pgsql/data/pg_hba.conf&lt;BR /&gt;[root@HW001 ~]# echo "host all postgres,rangeradmin,rangerlogger,hive,oozie,ranger,rangerkms,superset,druid 0.0.0.0/0 trust" &amp;gt;&amp;gt; /var/lib/pgsql/data/pg_hba.conf&lt;BR /&gt;[root@HW001 ~]# echo "host all postgres,rangeradmin,rangerlogger,hive,oozie,ranger,rangerkms,superset,druid ::/0 trust" &amp;gt;&amp;gt; /var/lib/pgsql/data/pg_hba.conf&lt;BR /&gt;[root@HW001 ~]# cat /var/lib/pgsql/data/pg_hba.conf&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# TYPE DATABASE USER ADDRESS METHOD&lt;/P&gt;
&lt;P&gt;# "local" is for Unix domain socket connections only&lt;BR /&gt;local all postgres peer&lt;BR /&gt;# IPv4 local connections:&lt;BR /&gt;host all postgres 127.0.0.1/32 ident&lt;BR /&gt;# IPv6 local connections:&lt;BR /&gt;host all postgres ::1/128 ident&lt;BR /&gt;# Allow replication connections from localhost, by a user with the&lt;BR /&gt;# replication privilege.&lt;BR /&gt;#local replication postgres peer&lt;BR /&gt;#host replication postgres 127.0.0.1/32 ident&lt;BR /&gt;#host replication postgres ::1/128 ident&lt;/P&gt;
&lt;P&gt;local all ambari,mapred md5&lt;BR /&gt;host all ambari,mapred 0.0.0.0/0 md5&lt;BR /&gt;host all ambari,mapred ::/0 md5&lt;BR /&gt;local all postgres,rangeradmin,rangerlogger,hive,oozie,ranger,rangerkms,superset,druid trust&lt;BR /&gt;host all postgres,rangeradmin,rangerlogger,hive,oozie,ranger,rangerkms,superset,druid 0.0.0.0/0 trust&lt;BR /&gt;host all postgres,rangeradmin,rangerlogger,hive,oozie,ranger,rangerkms,superset,druid ::/0 trust&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but not sure if there is something else I'm missing here or some other things that I should be seeing that I am not. Is this is the correct thing to do or something else?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 14:32:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HDP-Ambari-installation-throws-quot-org-postgresql-util/m-p/277977#M207757</guid>
      <dc:creator>rvillanueva</dc:creator>
      <dc:date>2022-09-16T14:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: HDP Ambari installation throws "org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host..." when testing connections</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HDP-Ambari-installation-throws-quot-org-postgresql-util/m-p/277978#M207758</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/54172"&gt;@rvillanueva&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After making the changes inside the Correct "pg_hba.conf" file have you restarted the Postgres Database?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# /etc/init.d/postgresql restart
(OR)
# systemctl start postgresql&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also what is your Postgres Version like (10.5&amp;nbsp; / 10.2&amp;nbsp; / 9.6) ? SupportMatrix: &lt;A href="https://supportmatrix.hortonworks.com/" target="_blank" rel="noopener"&gt;https://supportmatrix.hortonworks.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Based on the Postgres Version the "pg_hba.conf" location might be slightly different like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/var/lib/pgsql/9.6/data/pg_hba.conf
/var/lib/pgsql/data/pg_hba.conf 
..etc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So please make sure that the changes you are making in the "pg_hba.conf" is actually the correct file.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 22:38:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HDP-Ambari-installation-throws-quot-org-postgresql-util/m-p/277978#M207758</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2019-09-20T22:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: HDP Ambari installation throws "org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host..." when testing connections</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HDP-Ambari-installation-throws-quot-org-postgresql-util/m-p/277991#M207766</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/54172"&gt;@rvillanueva&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To add on to what&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/50614"&gt;@jsensharma&lt;/a&gt;&amp;nbsp; commented it's always a good idea to have separate databases for druid&lt;SPAN&gt;&amp;nbsp;and superset! &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In case you get some issues then you have only a component's data in jeopardy &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Sep 2019 17:53:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HDP-Ambari-installation-throws-quot-org-postgresql-util/m-p/277991#M207766</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2019-09-21T17:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: HDP Ambari installation throws "org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host..." when testing connections</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HDP-Ambari-installation-throws-quot-org-postgresql-util/m-p/278198#M207889</link>
      <description>&lt;P&gt;Had only done&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;sudo -u postgres /usr/bin/pg_ctl -D $PGDATA reload&lt;/PRE&gt;&lt;P&gt;from&amp;nbsp;&lt;A href="https://docs.cloudera.com/HDPDocuments/Ambari-2.7.3.0/bk_ambari-installation/content/configuring_postgresql_for_ranger.html" target="_blank" rel="noopener"&gt;https://docs.cloudera.com/HDPDocuments/Ambari-2.7.3.0/bk_ambari-installation/content/configuring_postgresql_for_ranger.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I think restarting the service helped (honestly, did many other things so hard to tell which did the trick). For other finding this, a hint that the service should have been restarted could have been found in the docs here:&amp;nbsp;&lt;A href="https://docs.cloudera.com/HDPDocuments/Ambari-2.7.3.0/bk_ambari-installation/content/install-postgres.html" target="_blank" rel="noopener"&gt;https://docs.cloudera.com/HDPDocuments/Ambari-2.7.3.0/bk_ambari-installation/content/install-postgres.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 00:59:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HDP-Ambari-installation-throws-quot-org-postgresql-util/m-p/278198#M207889</guid>
      <dc:creator>rvillanueva</dc:creator>
      <dc:date>2019-09-25T00:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: HDP Ambari installation throws "org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host..." when testing connections</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HDP-Ambari-installation-throws-quot-org-postgresql-util/m-p/278204#M207891</link>
      <description>&lt;P&gt;OK.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;tested and successful&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 02:50:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HDP-Ambari-installation-throws-quot-org-postgresql-util/m-p/278204#M207891</guid>
      <dc:creator>dinhhoanglong</dc:creator>
      <dc:date>2019-09-25T02:50:23Z</dc:date>
    </item>
  </channel>
</rss>

