用Flink MysqlCdc同步一个新数据库时,遇到了一个新异常,javax.net.ssl.SSLHandshakeException。根据异常栈信息,mysqlcdc尝试与mysql server建立连接时,连接失败了,报Communications link failure.
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 如果只看这个信息,会认为了mysql server挂了,或超时了。MysqlCdc与Mysql server停止了通讯交互。
但往一看异常栈,Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate),提示的是SSL握手异常,应该是Mysqlcdc和Mysql server使用的交互不同,或密码错误所致。用mysql client直接连接mysql server,确认是可以连接,mysql server没问题,网络没问题,密码也没问题, 那么就是协议问题了。查看mysqlcdc的文件,有提到与ssl有关的一个参数, ‘jdbc.properties.useSSL’ = ‘false’ ,看起来是mysql server开启了ssl,而mysqlcdc没有开启,通过配置关闭ssl即可。尝试了一下这个参数,顺利解决了问题。
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:828) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:448) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:241) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.zaxxer.hikari.pool.HikariPool. (HikariPool.java:115) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.zaxxer.hikari.HikariDataSource. (HikariDataSource.java:81) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.ververica.cdc.connectors.mysql.source.connection.PooledDataSourceFactory.createPooledDataSource(PooledDataSourceFactory.java:61) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.ververica.cdc.connectors.mysql.source.connection.JdbcConnectionPools.getOrCreateConnectionPool(JdbcConnectionPools.java:49) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.ververica.cdc.connectors.mysql.source.connection.JdbcConnectionFactory.connect(JdbcConnectionFactory.java:54) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:890) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:885) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at io.debezium.jdbc.JdbcConnection.connect(JdbcConnection.java:418) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.ververica.cdc.connectors.mysql.debezium.DebeziumUtils.openJdbcConnection(DebeziumUtils.java:61) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.ververica.cdc.connectors.mysql.MySqlValidator.validate(MySqlValidator.java:72) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.ververica.cdc.connectors.mysql.source.MySqlSource.createEnumerator(MySqlSource.java:170) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at org.apache.flink.runtime.source.coordinator.SourceCoordinator.start(SourceCoordinator.java:197) ~[flink-dist-1.15.4.jar:1.15.4] at org.apache.flink.runtime.operators.coordination.RecreateOnResetOperatorCoordinator$DeferrableCoordinator.resetAndStart(RecreateOnResetOperatorCoordinator.java:394) ~[flink-dist-1.15.4.jar:1.15.4] at org.apache.flink.runtime.operators.coordination.RecreateOnResetOperatorCoordinator.lambda$resetToCheckpoint$6(RecreateOnResetOperatorCoordinator.java:144) ~[flink-dist-1.15.4.jar:1.15.4] at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:774) ~[?:1.8.0_351] at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:750) ~[?:1.8.0_351] at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:488) ~[?:1.8.0_351] at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1975) ~[?:1.8.0_351] at org.apache.flink.runtime.operators.coordination.ComponentClosingUtils.lambda$closeAsyncWithTimeout$0(ComponentClosingUtils.java:77) ~[flink-dist-1.15.4.jar:1.15.4] at java.lang.Thread.run(Thread.java:750) [?:1.8.0_351] Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at sun.reflect.GeneratedConstructorAccessor50.newInstance(Unknown Source) ~[?:?] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_351] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_351] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.protocol.a.NativeProtocol.negotiateSSLConnection(NativeProtocol.java:317) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:203) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1369) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.NativeSession.connect(NativeSession.java:133) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:948) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:818) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] ... 28 more Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate) at sun.security.ssl.HandshakeContext. (HandshakeContext.java:171) ~[?:1.8.0_351] at sun.security.ssl.ClientHandshakeContext. (ClientHandshakeContext.java:106) ~[?:1.8.0_351] at sun.security.ssl.TransportContext.kickstart(TransportContext.java:238) ~[?:1.8.0_351] at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:410) ~[?:1.8.0_351] at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:389) ~[?:1.8.0_351] at com.mysql.cj.protocol.ExportControlled.performTlsHandshake(ExportControlled.java:335) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.protocol.StandardSocketFactory.performTlsHandshake(StandardSocketFactory.java:194) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.protocol.a.NativeSocketConnection.performTlsHandshake(NativeSocketConnection.java:101) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.protocol.a.NativeProtocol.negotiateSSLConnection(NativeProtocol.java:308) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:203) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1369) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.NativeSession.connect(NativeSession.java:133) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:948) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:818) ~[flink-connector-mysql-cdc-2.3-SNAPSHOT.jar:2.3-SNAPSHOT] ... 28 more 2023-05-22 18:07:23,365 ERROR com.ververica.cdc.connectors.mysql.debezium.DebeziumUtils [] - Failed to open MySQL connection com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Communications link failure
猜你喜欢
网友评论
- 搜索
- 最新文章
- 热门文章