When try exec ambari-server start
[root@maestro-hadoop-01 tmp]# 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.
check the /var/log/ambari-server/ambari-server.log and found this:
WARN [C3P0PooledConnectionPoolManager[identityToken->1hge55j9x1mybganw6n0sl|26abb146]-HelperThread-#2] BasicResourcePool:223 - com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@25affd37 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: java.sql.SQLException: Access denied for user 'ambari'@'maestro-hadoop-01' (using password: YES)
WARN [C3P0PooledConnectionPoolManager[identityToken->1hge55j9x1mybganw6n0sl|26abb146]-HelperThread-#1] BasicResourcePool:220 - Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@5c82031b is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests. 2018-09-13 16:47:18,623 ERROR [main] AmbariServer:1111 - Failed to run the Ambari Server javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.2.v20151217-774c696): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLException: Connections could not be acquired from the underlying database! Error Code: 0
As we see the error as following:
Last acquisition attempt exception: java.sql.SQLException: Access denied for user 'ambari'@'maestro-hadoop-01'
This indicates that the Ambari Database setup is not done successfully.
Can you please check if you are using Embedded Postgres DB for Ambari Server or using some External Postgres/MySQl ..etc Database?
# grep 'jdbc' /etc/ambari-server/conf/ambari.properties
If it is Embedded Postgres then while running "# ambari-server setup" command ambari will also setup the database and will create the ambari user and will assign proper permission to it.
# mysql -u root -p CREATE USER '[AMBARI_USER]'@'%' IDENTIFIED BY '[AMBARI_PASSWORD]'; GRANT ALL PRIVILEGES ON *.* TO '[AMBARI_USER]'@'%'; CREATE USER '[AMBARI_USER]'@'localhost' IDENTIFIED BY '[AMBARI_PASSWORD]'; GRANT ALL PRIVILEGES ON *.* TO '[AMBARI_USER]'@'localhost'; CREATE USER '[AMBARI_USER]'@'[AMBARI_SERVER_FQDN]' IDENTIFIED BY '[AMBARI_PASSWORD]'; GRANT ALL PRIVILEGES ON *.* TO '[AMBARI_USER]'@'[AMBARI_SERVER_FQDN]'; FLUSH PRIVILEGES;
But if you are using some non default Databases with Ambari then you will have to manually setup the Database and give proper permission to the Ambari DB users as described in the following links:
The problem was solved, this happened. for some reason the database type was changed, from postgre to mysql and this corrupted the ambari.propierties properties file, this happened after the installation of Ranger, what was done, was to edit the file so that it is configured with the database Postgre, connectors and ports. With this, everything returned to normal. / etc / ambari-server / conf / ambari.properties This is how I am after the changes server.jdbc.database = postgres server.jdbc.database_name = ambari server.jdbc.driver = org.postgresql.Driver server.jdbc.driver.path = / usr / lib / ambari-server / postgresql-42.2.2.jar server.jdbc.hostname = localhost server.jdbc.port = 5432 server.jdbc.postgres.schema = ambari server.jdbc.rca.driver = org.postgresql.Driver
my mistake was install mysql DB over postgre in ambari-server setup before first installation