当我通过flink jdbcinputformatbuilder使用2个以上的连接来获取oracle数据时,它将引发连接重置异常。
java.lang.IllegalArgumentException: open() failed.IO Error: Connection reset
at org.apache.flink.api.java.io.jdbc.JDBCInputFormat.openInputFormat(JDBCInputFormat.java:151)
at org.apache.flink.runtime.operators.DataSourceTask.invoke(DataSourceTask.java:115)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:718)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLRecoverableException: IO Error: Connection reset
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:467)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at org.apache.flink.api.java.io.jdbc.JDBCInputFormat.openInputFormat(JDBCInputFormat.java:144)
... 3 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:115)
at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
at oracle.net.ns.DataPacket.send(DataPacket.java:210)
at oracle.net.ns.NetOutputStream.flush(NetOutputStream.java:230)
at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:312)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:260)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:185)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:102)
at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:124)
at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:80)
at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1137)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:290)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
at oracle.jdbc.driver.T4CTTIoauthenticate.doOSESSKEY(T4CTTIoauthenticate.java:404)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:385)
... 10 more
我在jvm参数中添加了一些configure,如下所示
-Djava.security.egd=file:/dev/../dev/urandom
重新启动flink taskmanager后,它的工作原理如下
1 68 10:43 pts/1 00:00:02 java -XX:+UseG1GC -Xms60000M -Xmx60000M -
XX:MaxDirectMemorySize=8388607T -Djava.security.egd=file:/dev/../urandom
-Dlog.file=/data/flink/log/flink-sctele-taskmanager-4-ELK2.tianyiHD.log
-Dlog4j.configuration=file:/usr/local/flink-1.4.2/conf/log4j.properties
-Dlogback.configurationFile=file:/usr/local/flink-1.4.2/conf/logback.xml
-classpath /usr/local/flink-1.4.2/lib/flink-python_2.11-
1.4.2.jar:/usr/local/flink-1.4.2/lib/flink-shaded-hadoop2-uber-
1.4.2.jar:/usr/local/flink-1.4.2/lib/log4j-1.2.17.jar:/usr/local/flink-
1.4.2/lib/slf4j-log4j12-1.7.7.jar:/usr/local/flink-1.4.2/lib/flink-
dist_2.11-1.4.2.jar::: org.apache.flink.runtime.taskmanager.TaskManager
--configDir /usr/local/flink-1.4.2/conf
但对我来说还是不行。
暂无答案!
目前还没有任何答案,快来回答吧!