dataX不能连接到MySQL后台报错“No appropriate protocol (protocol is disabled or cipher suites are inappropriate”
现象
The last packet successfully received from the server was 4 milliseconds ago. The last packet sent successfully to the server was 4 milliseconds ago.
。。。。。
at java.lang.Thread.run(Thread.java:750)
Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at sun.security.ssl.HandshakeContext.
at sun.security.ssl.ClientHandshakeContext.
at sun.security.ssl.TransportContext.kickstart(TransportContext.java:220)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:433)
at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:186)
... 137 common frames omitted
15:08:52.634 admin [http-nio-9527-exec-5] ERROR c.w.d.a.e.GlobalExceptionHandler - 系统异常{0}
com.wugui.datax.admin.util.DataXException: Code:[MYSQLErrCode-02], Description:[数据库服务的IP地址或者Port错误,请检查填写的IP地址和Port或者联系DBA确认IP地址和Port是否正确。如果是同步中心用户请联系DBA确认idb上录入的IP和PORT信息和数据库的当前实际信息是一致的]. - 具体错误信息为:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 4 milliseconds ago. The last packet sent successfully to the server was 4 milliseconds ago.
at com.wugui.datax.admin.util.DataXException.asDataXException(DataXException.java:25)
at com.wugui.datax.admin.util.RdbmsException.asConnException(RdbmsException.java:29)
at com.wugui.datax.admin.tool.query.QueryToolFactory.getMySQLQueryToolInstance(QueryToolFactory.java:44)
at com.wugui.datax.admin.tool.query.QueryToolFactory.getByDbType(QueryToolFactory.java:23)
解决
jdk版本过高导致,jdk1.8高版本对ssl做了限制,
1 2 3 4 | [root@lhrdataX /]# java -version openjdk version "1.8.0_332" OpenJDK Runtime Environment (build 1.8.0_332-b09) OpenJDK 64-Bit Server VM (build 25.332-b09, mixed mode) |
解决办法:
修改文件:vi /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.332.b09-1.el7_9.x86_64/jre/lib/security/java.security
去除 jdk.tls.disabledAlgorithms 中 SSLv3, TLSv1, TLSv1.1三项协议,然后重启项目即可
1 2 3 4 5 | [root@lhrdataX /]# cat /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.332.b09-1.el7_9.x86_64/jre/lib/security/java.security | grep jdk.tls.disabledAlgorithms # jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048 jdk.tls.disabledAlgorithms= RC4, DES, MD5withRSA, \ # certificates such as jdk.tls.disabledAlgorithms or [root@lhrdataX /]# |