Support Questions

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

ambari-server status

Explorer

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

 

showing like this. whats the issue with his. 

 

when i remove  (rm -f /var/run/ambari-server/ambari-server.pid) 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/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...........................................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

4 REPLIES 4

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

Explorer

How can i check DB connection. 

Explorer

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(DatabaseException.java:316)
at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:147)
at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.setOrDetectDatasource(DatabaseSessionImpl.java:207)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:760)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:265)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:731)
... 75 more
Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:692)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:146)
at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:144)
... 80 more

Super Mentor

@Manoj690 

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://dbhost.example.com:3306/ambari" "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://dbhost.example.com:5432/ambari"  "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/ambari.properties

 

.

 

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