Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 05-05-2016 09:40 AM
Hi,
I'm trying to install ambari 2.2.1. After installed ambari server, i got the error as mentioned below,
Error injecting constructor, java.lang.RuntimeException: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "ambari", database "ambari", SSL off at org.apache.ambari.server.orm.DBAccessorImpl.<init>(DBAccessorImpl.java:77) while locating org.apache.ambari.server.orm.DBAccessorImpl while locating org.apache.ambari.server.orm.DBAccessor for field at org.apache.ambari.server.orm.dao.DaoUtils.dbAccessor(DaoUtils.java:36) at org.apache.ambari.server.orm.dao.DaoUtils.class(DaoUtils.java:36) while locating org.apache.ambari.server.orm.dao.DaoUtils for field at org.apache.ambari.server.orm.dao.HostComponentStateDAO.daoUtils(HostComponentStateDAO.java:39) at org.apache.ambari.server.orm.dao.HostComponentStateDAO.class(HostComponentStateDAO.java:39) while locating org.apache.ambari.server.orm.dao.HostComponentStateDAO for field at org.apache.ambari.server.orm.models.HostComponentSummary.hostComponentStateDao(HostComponentSummary.java:52) Caused by: java.lang.RuntimeException: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "ambari", database "ambari", SSL off
How to solve this problem,
Created 05-05-2016 02:58 PM
On your Postgres server, you will need to update your pg_hba.conf file to allow access for the ambari user on the ambari database coming from 127.0.0.1.
Here is the location of our pg_hba.conf file: /data/pghadoop/pg_hba.conf
If its not there, run: find / -name pg_hba.conf
Here is Postgres documentation for configuring this file: http://www.postgresql.org/docs/9.5/static/auth-pg-hba-conf.html
This is what our pg_hba.conf file has for the ambari user:
local all ambari trust host all ambari 0.0.0.0/0 trust host all ambari ::/0 trust
Once you have made these changes, you will need to restart the Postgres server:
/etc/init.d/postgresql restart
Let me know if you have any other questions.
Created 05-05-2016 02:58 PM
On your Postgres server, you will need to update your pg_hba.conf file to allow access for the ambari user on the ambari database coming from 127.0.0.1.
Here is the location of our pg_hba.conf file: /data/pghadoop/pg_hba.conf
If its not there, run: find / -name pg_hba.conf
Here is Postgres documentation for configuring this file: http://www.postgresql.org/docs/9.5/static/auth-pg-hba-conf.html
This is what our pg_hba.conf file has for the ambari user:
local all ambari trust host all ambari 0.0.0.0/0 trust host all ambari ::/0 trust
Once you have made these changes, you will need to restart the Postgres server:
/etc/init.d/postgresql restart
Let me know if you have any other questions.
Created 07-21-2016 01:38 PM
In addition to @Jon Maestas workaround, add the IP address of the host (on which PostgreSQL server is running) to the pg_hba.conf file and make sure that the method is set to "trust".
Note: Replace <ip address> with the IP address of your host to allow connections.
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all <ip address>/24 trust
# IPv6 local connections: host all all ::1/128 md5
Now, restart postgresql service.
For more details, visit https://confluence.atlassian.com/confkb/confluence-unable-to-connect-to-postgresql-due-to-unconfigur...