Ignite Nodes 在一段时间后断开连接
Ignite Nodes disconnects after some time
大家好,我的集群遇到了问题。
每当点燃节点空闲时,它们就会断开连接,在那之后,如果我尝试连接,我的第一个请求就会失败。但是在第一次请求之后,所有请求都会成功,直到它们空闲一段时间。
请帮忙
SEVERE: Servlet.service() for servlet [dispatcherServlet] in context
with path [] threw exception [Request processing failed; nested exception is
org.springframework.transaction.CannotCreateTransactionException: Could not
open JDBC Connection for transaction; nested exception is
java.sql.SQLException: Failed to communicate with Ignite cluster.] with root
cause
commons-api_research.1.tmu590s6e7pi@cc-dev-platform03.netlink.com |
java.net.SocketException: Connection reset
commons-api_research.1.tmu590s6e7pi@cc-dev-platform03.netlink.com | at
java.base/java.net.SocketInputStream.read(SocketInputStream.java:186)
commons-api_research.1.tmu590s6e7pi@cc-dev-platform03.netlink.com | at
java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
commons-api_research.1.tmu590s6e7pi@cc-dev-platform03.netlink.com | at
java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:252)
commons-api_research.1.tmu590s6e7pi@cc-dev-platform03.netlink.com | at
java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:292)
commons-api_research.1.tmu590s6e7pi@cc-dev-platform03.netlink.com | at
java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:351)
commons-api_research.1.tmu590s6e7pi@cc-dev-platform03.netlink.com | at
org.apache.ignite.internal.jdbc.thin.JdbcThinTcpIo.read
您不应无限期地保留原始 JDBC 连接,而应使用适当的连接池,例如 c3p0
,支持连接回收等。
好吧,这与 DataSource 无关,但将空闲连接超时设置为最大对我有用。
TcpCommunicationSpi spi = new TcpCommunicationSpi();
spi.setUsePairedConnections(true);
spi.setIdleConnectionTimeout(999999999999999999l);
cfg.setCommunicationSpi(spi);
大家好,我的集群遇到了问题。
每当点燃节点空闲时,它们就会断开连接,在那之后,如果我尝试连接,我的第一个请求就会失败。但是在第一次请求之后,所有请求都会成功,直到它们空闲一段时间。
请帮忙
SEVERE: Servlet.service() for servlet [dispatcherServlet] in context
with path [] threw exception [Request processing failed; nested exception is
org.springframework.transaction.CannotCreateTransactionException: Could not
open JDBC Connection for transaction; nested exception is
java.sql.SQLException: Failed to communicate with Ignite cluster.] with root
cause
commons-api_research.1.tmu590s6e7pi@cc-dev-platform03.netlink.com |
java.net.SocketException: Connection reset
commons-api_research.1.tmu590s6e7pi@cc-dev-platform03.netlink.com | at
java.base/java.net.SocketInputStream.read(SocketInputStream.java:186)
commons-api_research.1.tmu590s6e7pi@cc-dev-platform03.netlink.com | at
java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
commons-api_research.1.tmu590s6e7pi@cc-dev-platform03.netlink.com | at
java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:252)
commons-api_research.1.tmu590s6e7pi@cc-dev-platform03.netlink.com | at
java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:292)
commons-api_research.1.tmu590s6e7pi@cc-dev-platform03.netlink.com | at
java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:351)
commons-api_research.1.tmu590s6e7pi@cc-dev-platform03.netlink.com | at
org.apache.ignite.internal.jdbc.thin.JdbcThinTcpIo.read
您不应无限期地保留原始 JDBC 连接,而应使用适当的连接池,例如 c3p0
,支持连接回收等。
好吧,这与 DataSource 无关,但将空闲连接超时设置为最大对我有用。
TcpCommunicationSpi spi = new TcpCommunicationSpi();
spi.setUsePairedConnections(true);
spi.setIdleConnectionTimeout(999999999999999999l);
cfg.setCommunicationSpi(spi);