I am setting up a single-node Hortonworks stack. I am stuck in the part where I am setting up my ambari-server, using my PostgreSQL database (not default, not embedded).
I also intend to use this same PostgreSQL instance for Hive and Oozie.
After following the instructions from here:
Here's how I named my database, user and schema:
ambari, ambari, ambari
This is how I configured my /var/lib/pgsql/data/pg_hba.conf file:
# Default local all all peer host all all 127.0.0.1/32 ident # added settings local all ambari md5 host all ambari 0.0.0.0/0 md5 host all ambari ::/0 md5 host oozie oozie <my-host-ip>/0 md5 host hive hive <my-host-ip>/0 md5
I run this, for Hive and Oozie:
$ ambari-server setup --jdbc-db=postgres --jdbc-driver=/usr/share/java/postgresql-jdbc.jar
Then for the actual Ambari setup
$ ambari-server setup Enter advanced database configuration [y/n]? y ... Enter choice (1): 4 Hostname (localhost): <my-fqdn-host-name> Port (5432): Database name (ambari): Postgres schema (ambari): Username (ambari): Enter Database Password (bigdata) : <my-ambari-password>
However, I can't start the ambari-server, as I get this from /var/log/ambari-server/ambari-server.log on a number of lines:
Internal Exception: org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "ambari"
Although I am sure that my password is correct, and I can even connect using
$ psql -h <my-fqdn-host-name> -U ambari -d ambari -W password: <my-ambari-password> $ psql -h <my-host-ip> -U ambari -d ambari -W password: <my-ambari-password>
However, I can't connect with
$ psql -h localhost -U ambari -d ambari -W password: <my-ambari-password> psql: FATAL: Ident authentication failed for user "ambari" $ psql -h 127.0.0.1 -U ambari -d ambari -W password: <my-ambari-password> psql: FATAL: Ident authentication failed for user "ambari"
And I get the same error as what I get from /var/log/ambari-server/ambari-server.log. I suspect that ambari-server setup is connecting via localhost, that's why I get the same error.
Can you tell what's wrong with my configuration with Ambari and/or Postgres?
Sorry, that is not the answer, I specified on my question that I'm not using the embedded PostgreSQL (option 1), but the advanced configuration.
I had the same problem. I tried to figure out almost a day long and then I accdentally realized my amazing mistake. I had always changed wrong "pg_hba.conf" and "postgresql.conf". Following command led me realized my mistake:
[root@myserver ~]# find / -name "pg_hba.conf" /var/lib/pgsql/data/pg_hba.conf /var/lib/pgsql/9.6/data/pg_hba.conf
There are two pg_hba.conf and postgresql.conf. I modified to pg_hba.conf:
local all all trust # IPv4 local connections: host all all 0.0.0.0/0 trust
And then /var/lib/pgsql/9.6/data/postgresql.conf:
listen_addresses = '*'
The result is amazing :)
[root@myserver~]# ambari-server start Using python /usr/bin/python Starting ambari-server Ambari Server running with administrator privileges. Organizing resource files at /var/lib/ambari-server/resources... Ambari database consistency check started... Server PID at: /var/run/ambari-server/ambari-server.pid Server out at: /var/log/ambari-server/ambari-server.out Server log at: /var/log/ambari-server/ambari-server.log Waiting for server start............................... Server started listening on 8080 DB configs consistency check: no errors and warnings were found. Ambari Server 'start' completed successfully.