Created 07-12-2021 03:20 AM
use script :
/opt/module/cm/cm-5.16.2/share/cmf/schema/scm_prepare_database.sh
Error:
Mon Jul 12 17:30:10 CST 2021 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.
[ main] DbProvisioner ERROR Exception when creating/dropping database with user 'temp' and jdbc url 'jdbc:mysql://localhost/?useUnicode=true&characterEncoding=UTF-8'
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 287 milliseconds ago. The last packet sent successfully to the server was 277 milliseconds ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.8.0_291]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)[:1.8.0_291]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.8.0_291]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)[:1.8.0_291]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)[mysql-connector-java.jar:5.1.40]
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:989)[mysql-connector-java.jar:5.1.40]
at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:164)[mysql-connector-java.jar:5.1.40]
at com.mysql.jdbc.MysqlIO.negotiateSSLConnection(MysqlIO.java:4898)[mysql-connector-java.jar:5.1.40]
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)[mysql-connector-java.jar:5.1.40]
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226)[m
I guess the reason is mysql use ssl but jdbc url not set useSSL=false,so I disabled mysql ssl option, then it works.
Has another way to solve this problem, like modify options in db.properties?
Created 07-12-2021 07:14 AM
@flowerbirds For CM server DB you can try something like below:
com.cloudera.cmf.db.type = mysql com.cloudera.cmf.orm.hibernate.connection.url=jdbc:mysql://<db_host>/scm?useSSL=true com.cloudera.cmf.orm.hibernate.connection.username=scm com.cloudera.cmf.orm.hibernate.connection.password=cloudera
-Djavax.net.ssl.trustStore=/opt/cloudera/security/jks/truststore.jks
NOTE: Just remember in some case we set ssl=true&sslmode=require so if the normal method means com.cloudera.cmf.orm.hibernate.connection.url=jdbc:mysql://<db_host>/scm?useSSL=true failed please try the `ssl=true&sslmode=require as well and see.
Created 07-12-2021 07:14 AM
@flowerbirds For CM server DB you can try something like below:
com.cloudera.cmf.db.type = mysql com.cloudera.cmf.orm.hibernate.connection.url=jdbc:mysql://<db_host>/scm?useSSL=true com.cloudera.cmf.orm.hibernate.connection.username=scm com.cloudera.cmf.orm.hibernate.connection.password=cloudera
-Djavax.net.ssl.trustStore=/opt/cloudera/security/jks/truststore.jks
NOTE: Just remember in some case we set ssl=true&sslmode=require so if the normal method means com.cloudera.cmf.orm.hibernate.connection.url=jdbc:mysql://<db_host>/scm?useSSL=true failed please try the `ssl=true&sslmode=require as well and see.