最近将mongodb从单节点转换成分片集群,单日内流量也比之前增加了不少,频繁的出现异常,下面这个怎么破:
Caused by: com.mongodb.MongoInterruptedException: Interrupted acquiring a permit to retrieve an item from the pool
at com.mongodb.internal.connection.ConcurrentPool.acquirePermit(ConcurrentPool.java:186)
at com.mongodb.internal.connection.ConcurrentPool.get(ConcurrentPool.java:126)
at com.mongodb.connection.DefaultConnectionPool.getPooledConnection(DefaultConnectionPool.java:256)
at com.mongodb.connection.DefaultConnectionPool.get(DefaultConnectionPool.java:97)
at com.mongodb.connection.DefaultConnectionPool.get(DefaultConnectionPool.java:86)
at com.mongodb.connection.DefaultServer.getConnection(DefaultServer.java:77)
at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.getConnection(ClusterBinding.java:86)
at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:422)
at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:397)
at com.mongodb.operation.CountOperation.execute(CountOperation.java:232)
at com.mongodb.operation.CountOperation.execute(CountOperation.java:55)
at com.mongodb.Mongo.execute(Mongo.java:810)
at com.mongodb.Mongo$2.execute(Mongo.java:797)
at com.mongodb.DBCollection.getCount(DBCollection.java:1004)
at com.mongodb.DBCollection.count(DBCollection.java:854)
at org.springframework.data.mongodb.core.MongoTemplate$8.doInCollection(MongoTemplate.java:779)
at org.springframework.data.mongodb.core.MongoTemplate$8.doInCollection(MongoTemplate.java:777)
at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:482)
... 33 common frames omitted
Caused by: java.lang.InterruptedException: null
at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1326)
at java.util.concurrent.Semaphore.tryAcquire(Semaphore.java:409)
at com.mongodb.internal.connection.ConcurrentPool.acquirePermit(ConcurrentPool.java:180)
... 50 common frames omitted
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。