Support Questions

Find answers, ask questions, and share your expertise

Ambari server startup error

avatar
Contributor

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)

1 ACCEPTED SOLUTION

avatar
Expert Contributor

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)

View solution in original post

19 REPLIES 19

avatar
Expert Contributor

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)

avatar
Contributor

@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=#

avatar
Expert Contributor

@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.

avatar
Contributor

Hi,

I performed the modification as you mentioned but its still throwing the same error message.

avatar
Contributor

The interesting part - Even after changing the parameter to 'ambari' in the properties file, the error log is still throwing the error on 'AMBARIDATABASE'.

avatar

avatar imageManish Anand

what is the Ambari version? if it is 2.4.0 then kill Ambari server process and start again.

avatar
Contributor

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??

avatar

avatar imageManish Anand

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

avatar
Contributor

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 ~]#