失败:由对等方重置连接

时间:2017-09-11 11:25:10

标签: netty datastax-enterprise datastax-java-driver cassandra-3.0

我一直在使用apache cassandra 3.0.11

  • Datastax驱动程序:3.1.3
  • Netty版本:4.1.6.Final

我们在数据库方面经常出现以下错误:

INFO  [SharedPool-Worker-2] 2017-09-11 01:39:31,738 Message.java:615 - Unexpected exception during request; channel = [id: 0x22d0c179, L:/xx.xx.xx.xx:9042 ! R:/yy.yy.yy.yy:57774]
io.netty.channel.unix.Errors$NativeIoException: syscall:read(...)() failed: Connection reset by peer
        at io.netty.channel.unix.FileDescriptor.readAddress(...)(Unknown Source) ~[netty-all-4.0.44.Final.jar:4.0.44.Final]
INFO  [SharedPool-Worker-2] 2017-09-11 01:44:25,789 Message.java:615 - Unexpected exception during request; channel = [id: 0xace60b99, L:/xx.xx.xx.xx:9042 ! R:/yy.yy.yy.yy:54372]
io.netty.channel.unix.Errors$NativeIoException: syscall:read(...)() failed: Connection reset by peer
        at io.netty.channel.unix.FileDescriptor.readAddress(...)(Unknown Source) ~[netty-all-4.0.44.Final.jar:4.0.44.Final]

从应用程序方面我们得到以下错误:

08/24/17 05:30:08.321   DEBUG [CassandraAccessor:57] - executing CQL [select * from src where host_ip= 'cc.cc.cc.cc']
08/24/17 05:30:08.319   DEBUG [Qwerty:49] - Finding route for [ Source IP : yy.yy.yy.yy , Source Port : 16107 , Messaage Type : ISONMQ
08/24/17 05:30:08.322   DEBUG [CassandraAccessor:57] - executing CQL [select * from test]
08/24/17 05:30:08.321   ERROR [RequestHandler$SpeculativeExecution$1:333] - Unexpected error while querying /xx.xx.xx.xx
com.datastax.driver.core.exceptions.ConnectionException: [/xx.xx.xx.xx:9042] Pool is CLOSING
        at com.datastax.driver.core.HostConnectionPool.borrowConnection(HostConnectionPool.java:196)
        at com.datastax.driver.core.RequestHandler$SpeculativeExecution.query(RequestHandler.java:293)
        at com.datastax.driver.core.RequestHandler$SpeculativeExecution.findNextHostAndQuery(RequestHandler.java:272)
        at com.datastax.driver.core.RequestHandler.startNewExecution(RequestHandler.java:115)
        at com.datastax.driver.core.RequestHandler.sendRequest(RequestHandler.java:95)
        at com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:132)
        at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:68)
        at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:43)
        at org.springframework.cassandra.core.CqlTemplate$3.doInSession(CqlTemplate.java:286)
        at org.springframework.cassandra.core.CqlTemplate$3.doInSession(CqlTemplate.java:283)
        at org.springframework.cassandra.core.CqlTemplate.doExecute(CqlTemplate.java:276)
        at org.springframework.cassandra.core.CqlTemplate.doExecuteQueryReturnResultSet(CqlTemplate.java:283)
        at org.springframework.data.cassandra.core.CassandraTemplate.select(CassandraTemplate.java:594)
        at org.springframework.data.cassandra.core.CassandraTemplate.select(CassandraTemplate.java:376)
        at com.fs.searshc.commlink.db.cassandra.RouterData.findBySourceIp(RouterData.java:27)
        at com.fs.searshc.commlink.router.tcpip.CommLinkRouter.findRoute(CommLinkRouter.java:75)

非常感谢任何形式的帮助。

1 个答案:

答案 0 :(得分:2)

通过对等方重置连接意味着远程对等方强制关闭连接。所以你需要找出它为什么这样做。