通过flink join表关联对mysql进行读取出现下面的问题?求指点
at org.apache.flink.streaming.runtime.io.StreamOneInputProcessor.processInput(StreamOneInputProcessor.java:66) ~[flink-dist_2.11-1.13.2.jar:1.13.2]
at org.apache.flink.streaming.runtime.io.StreamTwoInputProcessor.processInput(StreamTwoInputProcessor.java:98) ~[flink-dist_2.11-1.13.2.jar:1.13.2]
at org.apache.flink.streaming.runtime.tasks.StreamTask.processInput(StreamTask.java:423) ~[flink-dist_2.11-1.13.2.jar:1.13.2]
at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:204) ~[flink-dist_2.11-1.13.2.jar:1.13.2]
at org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxLoop(StreamTask.java:681) ~[flink-dist_2.11-1.13.2.jar:1.13.2]
at org.apache.flink.streaming.runtime.tasks.StreamTask.executeInvoke(StreamTask.java:636) ~[flink-dist_2.11-1.13.2.jar:1.13.2]
at org.apache.flink.streaming.runtime.tasks.StreamTask.runWithCleanUpOnFail(StreamTask.java:647) [flink-dist_2.11-1.13.2.jar:1.13.2]
at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:620) [flink-dist_2.11-1.13.2.jar:1.13.2]
at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:779) [flink-runtime_2.11-1.13.2.jar:1.13.2]
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:566) [flink-runtime_2.11-1.13.2.jar:1.13.2]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
Caused by: java.net.SocketException: Connection timed out (Read failed)
at java.net.SocketInputStream.socketRead0(Native Method) ~[?:1.8.0_181]
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) ~[?:1.8.0_181]
at java.net.SocketInputStream.read(SocketInputStream.java:171) ~[?:1.8.0_181]
at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[?:1.8.0_181]
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465) ~[?:1.8.0_181]
at sun.security.ssl.InputRecord.read(InputRecord.java:503) ~[?:1.8.0_181]
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983) ~[?:1.8.0_181]
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:940) ~[?:1.8.0_181]
at sun.security.ssl.AppInputStream.read(AppInputStream.java:105) ~[?:1.8.0_181]
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2966) ~[flink-connector-starrocks-1.2.1_flink-1.13_2.11.jar:?]
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3427) ~[flink-connector-starrocks-1.2.1_flink-1.13_2.11.jar:?]
... 840 more
2022-10-19 18:05:25,206 ERROR org.apache.flink.connector.jdbc.table.JdbcRowDataLookupFunction [] - JDBC executeBatch error, retry times = 0
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 1,218,606 milliseconds ago. The last packet sent successfully to the server was 929,004 milliseconds ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_181]
架构分析
flinkILB--》ILB (这一层的问题)--》mysqlrouter中间件 --》mysql数据库
因为中间这一层加了ILB的中间层,导致的
解决方案
把代码中的配置文件改成了mysql单节点的,问题解决
标签:SocketException,java,1.13,flink,jar,报错,runtime,2.11 From: https://blog.51cto.com/wang/5787331