Skip to main content
Manoj690
Silver ⭐️⭐️⭐️
Aug 21, 2019 6:28 AM UTC
Solved

ambari server problem 2

in server.out file this is the error

 

Wed Aug 21 11:54:54 IST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

 

in server.log  file this is the error

 

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)
... 14 more
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1469)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:644)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:554)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:758)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:685)
... 16 more
Caused by: java.sql.SQLException: Access denied for user 'ambari'@'gaian-lap386.com' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:873)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1710)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2188)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2219)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2014)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:776)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.GeneratedConstructorAccessor42.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)

jsensharma
Platinum ⭐️⭐️
Aug 21, 2019 7:08 AM UTC

@Manoj690 

As you created a DB user 

CREATE USER 'ambari'@'gaian-lap386.com' IDENTIFIED BY 'bigdata';
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'gaian-lap386.com';
FLUSH PRIVILEGES;


Please make sure that your ambari server host name is correct. Is it "gaian-lap386.com" your AmbariServer FQDN?

Are you running AmbariServer and MYSQL Server on the same host "gaian-lap386.com" ?



7 replies

jsensharma
Platinum ⭐️⭐️
Platinum ⭐️⭐️
Aug 21, 2019 6:45 AM UTC

@Manoj690 

 


Please share the output of the following SQL query.. I do not think that you have correct privileges

# mysql -u root -p
Enter Password:

mysql> use mysql;
mysql> SELECT user, host FROM user;

+--------+---------------------+
| user | host |
+--------+---------------------+
| root | % |
| root | 127.0.0.1 |
| root | ::1 |
| ambari | % |
| ambari | localhost |
| ambari | gaian-lap386.com |
+--------+---------------------+


Do you see above kind of entry in your MySQL DB table?

 

Translate
Manoj690
Manoj690Author
Silver ⭐️⭐️⭐️
Aug 21, 2019 6:47 AM UTC

Yes

 

------------+------------------+
| user | host |
+------------------+------------------+
| ambari | % |
| ambarii | % |
| hive | % |
| manojs | % |
| ambari | gaian-lap386.com |
| ambarii | gaian-lap386.com |
| manojs | gaian-lap386.com |
| ambari | localhost |
| ambarii | localhost |
| debian-sys-maint | localhost |
| hive | localhost |
| hiveuser | localhost |
| manoj | localhost |
| manojs | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost

Translate
jsensharma
Platinum ⭐️⭐️
Platinum ⭐️⭐️
Aug 21, 2019 6:59 AM UTC

@Manoj690 

 

As we still see the error :

Caused by: java.sql.SQLException: Access denied for user 'ambari'@'gaian-lap386.com' (using password: YES)

 

Are you sure that you are using correct password for ambari user?
Also after executing the following query have you run the "FLUSH PRIVILEGES" command?  At the end?

CREATE USER 'ambari'@'%' IDENTIFIED BY 'bigdata';
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%';
CREATE USER 'ambari'@'localhost' IDENTIFIED BY 'bigdata';
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'localhost';

CREATE USER 'ambari'@'gaian-lap386.com' IDENTIFIED BY 'bigdata';
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'gaian-lap386.com';
FLUSH PRIVILEGES;


Password as 'bigdata' is just dummy here.  You will need to use your own password. 
.



 

Translate