Created 02-14-2017 07:55 PM
Hi,
I am getting following error message in the log file "/var/log/ambari-server/ambari-server.log" during ambari server startup.
I performed all the steps as mentioned in "https://docs.hortonworks.com/HDPDocuments/Ambari-2.2.1.1/bk_ambari_reference_guide/content/_using_ambari_with_postgresql.html".
14 Feb 2017 21:21:49,597 INFO [main] ClasspathScannerUtils:64 - Found class [class org.apache.ambari.server.audit.request.eventcreator.ViewPrivilegeEventCreator] 14 Feb 2017 21:21:51,229 ERROR [main] DBAccessorImpl:109 - Error while creating database accessor org.postgresql.util.PSQLException: FATAL: database "AMBARIDATABASE" does not exist at org.postgresql.core.v3.ConnectionFactoryImpl.readStartupMessages(ConnectionFactoryImpl.java:574) at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:177) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:64) at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:138) at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:29) at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:21) at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:31) at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24) at org.postgresql.Driver.makeConnection(Driver.java:410) at org.postgresql.Driver.connect(Driver.java:280) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:247) at org.apache.ambari.server.orm.DBAccessorImpl.<init>(DBAccessorImpl.java:89)
Created 02-14-2017 10:34 PM
Hi
It seems the postgres database with the name "AMBARIDATABASE" is not existing in your environment.
Crosscheck your ambari server config file. Usually the db name will be "ambari"
cat /etc/ambari-server/conf/ambari.properties | grep -i server.jdbc.database_name
server.jdbc.database_name=ambari
To verify the postgres database name available,
[root@conf]# su - postgres
-bash-4.1$ psql
psql (8.4.20)
Type "help" for help.
postgres=# \list
List of databases
Name | Owner | Encoding | Collation | Ctype | Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
ambari | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres
: postgres=CTc/postgres
: ambari=CTc/postgres
hive | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
: postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
: postgres=CTc/postgres
(5 rows)
Created 02-14-2017 10:34 PM
Hi
It seems the postgres database with the name "AMBARIDATABASE" is not existing in your environment.
Crosscheck your ambari server config file. Usually the db name will be "ambari"
cat /etc/ambari-server/conf/ambari.properties | grep -i server.jdbc.database_name
server.jdbc.database_name=ambari
To verify the postgres database name available,
[root@conf]# su - postgres
-bash-4.1$ psql
psql (8.4.20)
Type "help" for help.
postgres=# \list
List of databases
Name | Owner | Encoding | Collation | Ctype | Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
ambari | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres
: postgres=CTc/postgres
: ambari=CTc/postgres
hive | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
: postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
: postgres=CTc/postgres
(5 rows)
Created 02-14-2017 10:41 PM
@Rajesh
I performed the check and I do see the database name "AMBARIDATABASE".
[root@sandbox ~]# cat /etc/ambari-server/conf/ambari.properties | grep -i server.jdbc.database_name server.jdbc.database_name=AMBARIDATABASE
[root@sandbox ~]# su - postgres
-bash-4.1$ psql
psql (8.4.20)
Type "help" for help.
postgres=# \list
List of databases Name | Owner | Encoding | Collation | Ctype | Access privileges ----------------+----------+----------+-------------+-------------+-------------------------
ambari | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres : postgres=CTc/postgres : ambari=CTc/postgres
ambaridatabase | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres : postgres=CTc/postgres : ambariuser=CTc/postgres
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres : postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres : postgres=CTc/postgres
(5 rows)
postgres=#
Created 02-14-2017 10:47 PM
@Manish
The database name is case sensitive.
Can you change it to "ambaridatabase" in your /etc/ambari-server/conf/ambari.properties file and restart ambari server.
Created 02-15-2017 12:31 AM
Hi,
I performed the modification as you mentioned but its still throwing the same error message.
Created 02-15-2017 12:35 AM
The interesting part - Even after changing the parameter to 'ambari' in the properties file, the error log is still throwing the error on 'AMBARIDATABASE'.
Created 02-15-2017 12:39 AM
what is the Ambari version? if it is 2.4.0 then kill Ambari server process and start again.
Created 02-15-2017 12:43 AM
The version is 2.4.0
[root@sandbox ~]# rpm -qa|grep ambari-server ambari-server-2.4.0.0-1225.x86_64
The ambari server isn't starting up. Which process do you you want me to kill??
Created 02-15-2017 12:47 AM
There is a bug in 2.4.0 - server some times does not get restart when you do "ambari-server stop"
Run
ps -aef | grep ambari-server
it gives you PID - kill -9 PID
then start again and check
Created 02-15-2017 02:56 AM
There isn't any process running. What shall I do next?
[root@sandbox ~]# ps -aef | grep ambari-server
root 17872 17671 0 02:54 pts/0 00:00:00 grep ambari-server
[root@sandbox ~]#