Support Questions

Find answers, ask questions, and share your expertise

ambari server problem 2

avatar
Contributor

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)

1 ACCEPTED SOLUTION

avatar
Master Mentor

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



View solution in original post

7 REPLIES 7

avatar
Master Mentor

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

 

avatar
Contributor

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

avatar
Master Mentor

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



 

avatar
Contributor

yes i created correctly and i use flush command also. i am able to login mysql -u ambari -p with this command after that i  use password to get in also. i created everything. but some connection is missing i dnt know what that is. 

avatar
Master Mentor

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



avatar
Contributor

i solved that connection settings and again this problem occurs

 

Caused by: 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
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)
... 9 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)
... 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: Connections using insecure transport are prohibited while --require_secure_transport=ON.
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)

avatar
Master Mentor

@Manoj690 

This is a completely different error ... Please open a separate Topic for detailed discussion and close this Thread.     
--require_secure_transport=ON

 

Caused by: java.sql.SQLException: Connections using insecure transport are prohibited while --require_secure_transport=ON.
     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)

 

 

 

https://mysqlserverteam.com/restricting-connections-to-secure-transport/