Support Questions

Find answers, ask questions, and share your expertise
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

ambari-server status


ambari-server status
Using python /usr/bin/python
Ambari-server status
Ambari Server not running. Stale PID File at: /var/run/ambari-server/


showing like this. whats the issue with his. 


when i remove  (rm -f /var/run/ambari-server/ this and try to start ambari server it shows 


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/
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start...........................................ERROR: Exiting with exit code -1.
REASON: Ambari Server java process has stopped. Please check the logs for more information.


help me with the best solution


New Contributor

Check the ambari-server.log & also ambari-server.out to determine as what could be the issue.

There could be a chance that your ambari server might be having issues connecting it to its database and that could be stopping it from starting


How can i check DB connection. 


Its showing this error in log files


Internal Exception: java.sql.SQLException: Connections could not be acquired from the underlying database!
Error Code: 0
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(
at org.eclipse.persistence.sessions.JNDIConnector.connect(
at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.setOrDetectDatasource(
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(
... 75 more
Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
at com.mchange.v2.sql.SqlUtils.toSQLException(
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(
at org.eclipse.persistence.sessions.JNDIConnector.connect(
... 80 more

Super Mentor


The error seems to be very generic:


Connections could not be acquired from the underlying database



It will be really great if you can share some more lines from the ambari-server.log specially the "Caused By" section of the error.  Check if you can attach the log here.


There can be various reasons behind the mentioned database error like ambari might not be able to connect to DB host/port. (firewall issue)

The DB credentials might be wrong. 

DB might not be running ... 


Based on the DB type (MySQL/ Postgres/ Oracle) we can use some standalone client utility OR ambari utility to test the connectivity and DB credentials from ambari server host.

Example: If Ambari DB is MySQL


/usr/jdk64/jdk1.8.0_112/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar  org.apache.ambari.server.DBConnectionVerification "jdbc:mysql://" "ambari" "bigdata" com.mysql.jdbc.Driver


Example: If Ambari DB is Postgres


/usr/jdk64/jdk1.8.0_112/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/lib/ambari-server/postgresql-9.3-1101-jdbc4.jar  org.apache.ambari.server.DBConnectionVerification  "jdbc:postgresql://"  "ambari"  "bigdata"  org.postgresql.Driver 


You can find your ambari DB details from the following command. In the above command i am using default dummy credentials and URL you will need to find the values for DB url/credentials...etc based on your config, Driver JAR path...etc


# grep 'jdbc' /etc/ambari-server/conf/




Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.