java.io.IOException:通过对等memcached重置连接?

时间:2017-06-15 04:53:32

标签: scala caching memcached spray

关于memcached的原因是什么?

日志:

java.io.IOException: Connection reset by peer
        at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
        at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
        at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
        at sun.nio.ch.IOUtil.read(IOUtil.java:192)
        at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
        at net.spy.memcached.MemcachedConnection.handleReads(MemcachedConnection.java:820)
        at net.spy.memcached.MemcachedConnection.handleReadsAndWrites(MemcachedConnection.java:720)
        at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:683)
        at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:436)
        at net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:1446)

memcached使服务器关闭的原因是什么。

更多日志:

2017-06-14 15:43:42.446 INFO net.spy.memcached.MemcachedConnection:  Reconnecting due to exception on {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: flush_all Delay: -1, topWop=null, toWrite=0, interested=1}
java.io.IOException: Connection reset by peer
        at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
        at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
        at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
        at sun.nio.ch.IOUtil.read(IOUtil.java:192)
        at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
        at net.spy.memcached.MemcachedConnection.handleReads(MemcachedConnection.java:820)
        at net.spy.memcached.MemcachedConnection.handleReadsAndWrites(MemcachedConnection.java:720)
        at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:683)
        at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:436)
        at net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:1446)
2017-06-14 15:43:42.447 WARN net.spy.memcached.MemcachedConnection:  Closing, and reopening {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: flush_all Delay: -1, topWop=null, toWrite=0, interested=1}, attempt 0.
2017-06-14 15:43:42.447 WARN net.spy.memcached.protocol.ascii.AsciiMemcachedNodeImpl:  Discarding partially completed op: Cmd: flush_all Delay: -1
2017-06-14 15:43:44.449 INFO net.spy.memcached.MemcachedConnection:  Reconnecting {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}
2017-06-14 15:48:08.019 INFO net.spy.memcached.MemcachedConnection:  Added {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2017-06-14 15:52:33.464 INFO net.spy.memcached.MemcachedConnection:  Added {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2017-06-14 15:55:43.846 INFO net.spy.memcached.MemcachedConnection:  Added {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2017-06-14 15:55:44.481 INFO net.spy.memcached.MemcachedConnection:  Added {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2017-06-14 15:55:50.887 INFO net.spy.memcached.MemcachedConnection:  Added {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2017-06-14 15:56:08.993 INFO net.spy.memcached.MemcachedConnection:  Added {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
java.io.IOException: Too many open files
        at sun.nio.ch.IOUtil.makePipe(Native Method)
        at sun.nio.ch.EPollSelectorImpl.<init>(EPollSelectorImpl.java:65)
        at sun.nio.ch.EPollSelectorProvider.openSelector(EPollSelectorProvider.java:36)
        at java.nio.channels.Selector.open(Selector.java:227)
        at net.spy.memcached.MemcachedConnection.<init>(MemcachedConnection.java:265)
        at net.spy.memcached.DefaultConnectionFactory.createConnection(DefaultConnectionFactory.java:209)
        at net.spy.memcached.MemcachedClient.<init>(MemcachedClient.java:209)
        at net.spy.memcached.MemcachedClient.<init>(MemcachedClient.java:169)
        at com.gta.user.dao.UserRepositoryComponentMongodbImpl$UserRepositoryImpl.updateWipUser(UserRepositoryComponentMongodbImpl.scala:95)
        at com.gta.interimaccounts.services.InterimAccountServiceComponentImpl$InterimAccountServiceImpl.updateWipUserForInterim(InterimAccountServiceComponentImpl.scala:142)
        at com.gta.interimaccounts.services.InterimAccountServiceComponentImpl$InterimAccountServiceImpl.createInterimAccount(InterimAccountServiceComponentImpl.scala:112)
        at com.gta.interimaccounts.services.InterimAccountsActor$$anonfun$receive$1.applyOrElse(InterimAccountsActor.scala:79)
        at akka.actor.Actor$class.aroundReceive(Actor.scala:467)
        at com.gta.interimaccounts.services.InterimAccountsActor.aroundReceive(InterimAccountsActor.scala:27)
        at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
        at akka.actor.ActorCell.invoke(ActorCell.scala:487)
        at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254)
        at akka.dispatch.Mailbox.run(Mailbox.scala:221)
        at akka.dispatch.Mailbox.exec(Mailbox.scala:231)
        at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
        at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
        at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
        at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
[ERROR] [06/14/2017 15:56:10.173] [gta-api-akka.actor.default-dispatcher-2424] [akka://gta-api/user/$e] Too many open files
java.io.IOException: Too many open files
        at sun.nio.ch.IOUtil.makePipe(Native Method)
        at sun.nio.ch.EPollSelectorImpl.<init>(EPollSelectorImpl.java:65)
        at sun.nio.ch.EPollSelectorProvider.openSelector(EPollSelectorProvider.java:36)
        at java.nio.channels.Selector.open(Selector.java:227)
        at net.spy.memcached.MemcachedConnection.<init>(MemcachedConnection.java:265)
        at net.spy.memcached.DefaultConnectionFactory.createConnection(DefaultConnectionFactory.java:209)
        at net.spy.memcached.MemcachedClient.<init>(MemcachedClient.java:209)
        at net.spy.memcached.MemcachedClient.<init

1 个答案:

答案 0 :(得分:0)

如果您使用的是Linux台机器,那么它似乎是系统设置的low limit。通过在终端

中键入以下内容来检查限制
ulimit -a

如果它低,你必须增加它。请关注tutorial