- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
项目开发中,链接mongodb的项目,偶尔报错com.mongodb.MongoSocketReadException: Prematurely reached end of stream
报错的详细信息:
2022-07-11 08:34:00.001 INFO 1 --- [ scheduling-1] o.s.d.mongodb.core.convert.QueryMapper : Could not map 'UsageRecord.processed'. Maybe a fragment in 'Boolean' is considered a simple type. Mapper continues with processed.
2022-07-11 08:34:01.410 INFO 1 --- [ scheduling-1] org.mongodb.driver.connection : Closed connection [connectionId{localValue:60, serverValue:1824}] to 10.100.111.121:27017 because there was a socket exception raised by this connection.
2022-07-11 08:34:01.411 INFO 1 --- [ scheduling-1] org.mongodb.driver.cluster : No server chosen by ReadPreferenceServerSelector{readPreference=primary} from cluster description ClusterDescription{type=REPLICA_SET, connectionMode=MULTIPLE, serverDescriptions=[ServerDescription{address=10.100.111.121:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}, ServerDescription{address=10.100.15.147:27017, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=9, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=904746, setName='rs0', canonicalAddress=10.100.15.147:27017, hosts=[10.100.15.147:27017, 10.100.73.126:27017, 10.100.111.121:27017], passives=[], arbiters=[], primary='10.100.111.121:27017', tagSet=TagSet{[Tag{name='serviceName', value='mongodb'}]}, electionId=null, setVersion=5209130, topologyVersion=TopologyVersion{processId=62cbdcb123f4ce1a82a43f54, counter=4}, lastWriteDate=Mon Jul 11 08:33:45 GMT 2022, lastUpdateTimeNanos=19883840756252}, ServerDescription{address=10.100.73.126:27017, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=9, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=897679, setName='rs0', canonicalAddress=10.100.73.126:27017, hosts=[10.100.15.147:27017, 10.100.73.126:27017, 10.100.111.121:27017], passives=[], arbiters=[], primary='10.100.111.121:27017', tagSet=TagSet{[Tag{name='serviceName', value='mongodb'}]}, electionId=null, setVersion=5209130, topologyVersion=TopologyVersion{processId=62cbdee0732609efe7dccae6, counter=4}, lastWriteDate=Mon Jul 11 08:33:45 GMT 2022, lastUpdateTimeNanos=19884448424902}]}. Waiting for 30000 ms before timing out
2022-07-11 08:34:01.412 INFO 1 --- [nio-5010-exec-2] org.mongodb.driver.connection : Closed connection [connectionId{localValue:57, serverValue:1386}] to 10.100.111.121:27017 because there was a socket exception raised by this connection.
2022-07-11 08:34:01.412 INFO 1 --- [0.111.121:27017] org.mongodb.driver.cluster : Exception in monitor thread while connecting to server 10.100.111.121:27017
com.mongodb.MongoSocketReadException: Prematurely reached end of stream
at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:112) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:131) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:647) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.InternalStreamConnection.receiveMessageWithAdditionalTimeout(InternalStreamConnection.java:512) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:355) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.InternalStreamConnection.receive(InternalStreamConnection.java:315) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.lookupServerDescription(DefaultServerMonitor.java:215) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:144) ~[mongodb-driver-core-4.2.3.jar:na]
at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
2022-07-11 08:34:01.413 INFO 1 --- [0.111.121:27017] org.mongodb.driver.cluster : Exception in monitor thread while connecting to server 10.100.111.121:27017
com.mongodb.MongoSocketOpenException: Exception opening socket
at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:70) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:143) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.lookupServerDescription(DefaultServerMonitor.java:188) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:144) ~[mongodb-driver-core-4.2.3.jar:na]
at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237) ~[na:na]
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:na]
at java.base/java.net.Socket.connect(Socket.java:609) ~[na:na]
at com.mongodb.internal.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:107) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.SocketStream.initializeSocket(SocketStream.java:79) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:65) ~[mongodb-driver-core-4.2.3.jar:na]
... 4 common frames omitted
2022-07-11 08:34:01.414 INFO 1 --- [nio-5010-exec-2] org.mongodb.driver.connection : Closed connection [connectionId{localValue:61}] to 10.100.111.121:27017 because there was a socket exception raised by this connection.
2022-07-11 08:34:01.426 ERROR 1 --- [nio-5010-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataAccessResourceFailureException: Prematurely reached end of stream; nested exception is com.mongodb.MongoSocketReadException: Prematurely reached end of stream] with root cause
com.mongodb.MongoSocketReadException: Prematurely reached end of stream
at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:112) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:131) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:647) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.InternalStreamConnection.receiveMessageWithAdditionalTimeout(InternalStreamConnection.java:512) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:355) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:279) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.UsageTrackingInternalConnection.sendAndReceive(UsageTrackingInternalConnection.java:100) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection.sendAndReceive(DefaultConnectionPool.java:490) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.CommandProtocolImpl.execute(CommandProtocolImpl.java:71) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:253) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:202) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:118) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:110) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.operation.QueryBatchCursor.getMore(QueryBatchCursor.java:268) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.internal.operation.QueryBatchCursor.hasNext(QueryBatchCursor.java:141) ~[mongodb-driver-core-4.2.3.jar:na]
at com.mongodb.client.internal.MongoBatchCursorAdapter.hasNext(MongoBatchCursorAdapter.java:54) ~[mongodb-driver-sync-4.2.3.jar:na]
at org.springframework.data.mongodb.core.MongoTemplate.executeFindMultiInternal(MongoTemplate.java:2811) ~[spring-data-mongodb-3.2.3.jar:3.2.3]
at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:2543) ~[spring-data-mongodb-3.2.3.jar:3.2.3]
at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:2525) ~[spring-data-mongodb-3.2.3.jar:3.2.3]
at org.springframework.data.mongodb.core.MongoTemplate.find(MongoTemplate.java:847) ~[spring-data-mongodb-3.2.3.jar:3.2.3]
at org.springframework.data.mongodb.core.MongoTemplate.find(MongoTemplate.java:833) ~[spring-data-mongodb-3.2.3.jar:3.2.3]
at com.fastonetech.billing.service.v1.BillV1Service.create(BillV1Service.kt:41) ~[classes/:na]
at com.fastonetech.billing.controller.BillController.getByMonth(BillController.kt:65) ~[classes/:na]
at jdk.internal.reflect.GeneratedMethodAccessor129.invoke(Unknown Source) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197) ~[spring-web-5.3.9.jar:5.3.9]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:141) ~[spring-web-5.3.9.jar:5.3.9]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106) ~[spring-webmvc-5.3.9.jar:5.3.9]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.9.jar:5.3.9]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.9.jar:5.3.9]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.9.jar:5.3.9]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1064) ~[spring-webmvc-5.3.9.jar:5.3.9]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) ~[spring-webmvc-5.3.9.jar:5.3.9]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.9.jar:5.3.9]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.3.9.jar:5.3.9]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:655) ~[tomcat-embed-core-9.0.50.jar:4.0.FR]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.9.jar:5.3.9]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) ~[tomcat-embed-core-9.0.50.jar:4.0.FR]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:228) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.50.jar:9.0.50]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.9.jar:5.3.9]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.9.jar:5.3.9]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.9.jar:5.3.9]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.9.jar:5.3.9]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.9.jar:5.3.9]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.9.jar:5.3.9]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:769) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1723) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.50.jar:9.0.50]
at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
2022-07-11 08:34:01.440 INFO 1 --- [00.15.147:27017] org.mongodb.driver.cluster : Monitor thread successfully connected to server with description ServerDescription{address=10.100.15.147:27017, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=9, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=885369, setName='rs0', canonicalAddress=10.100.15.147:27017, hosts=[10.100.15.147:27017, 10.100.73.126:27017, 10.100.111.121:27017], passives=[], arbiters=[], primary='null', tagSet=TagSet{[Tag{name='serviceName', value='mongodb'}]}, electionId=null, setVersion=5209130, topologyVersion=TopologyVersion{processId=62cbdcb123f4ce1a82a43f54, counter=4}, lastWriteDate=Mon Jul 11 08:33:58 GMT 2022, lastUpdateTimeNanos=19893848661980}
2022-07-11 08:34:02.048 INFO 1 --- [00.73.126:27017] org.mongodb.driver.cluster : Monitor thread successfully connected to server with description ServerDescription{address=10.100.73.126:27017, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=9, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=859001, setName='rs0', canonicalAddress=10.100.73.126:27017, hosts=[10.100.15.147:27017, 10.100.73.126:27017, 10.100.111.121:27017], passives=[], arbiters=[], primary='null', tagSet=TagSet{[Tag{name='serviceName', value='mongodb'}]}, electionId=null, setVersion=5209130, topologyVersion=TopologyVersion{processId=62cbdee0732609efe7dccae6, counter=4}, lastWriteDate=Mon Jul 11 08:33:58 GMT 2022, lastUpdateTimeNanos=19894456486754}
2022-07-11 08:34:09.519 INFO 1 --- [00.73.126:27017] org.mongodb.driver.cluster : Monitor thread successfully connected to server with description ServerDescription{address=10.100.73.126:27017, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=9, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=829781, setName='rs0', canonicalAddress=10.100.73.126:27017, hosts=[10.100.15.147:27017, 10.100.73.126:27017, 10.100.111.121:27017], passives=[], arbiters=[], primary='10.100.73.126:27017', tagSet=TagSet{[Tag{name='serviceName', value='mongodb'}]}, electionId=7fffffff000000000000042e, setVersion=5209130, topologyVersion=TopologyVersion{processId=62cbdee0732609efe7dccae6, counter=5}, lastWriteDate=Mon Jul 11 08:33:58 GMT 2022, lastUpdateTimeNanos=19901926859608}
2022-07-11 08:34:10.535 INFO 1 --- [00.73.126:27017] org.mongodb.driver.cluster : Monitor thread successfully connected to server with description ServerDescription{address=10.100.73.126:27017, type=REPLICA_SET_PRIMARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=9, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=829781, setName='rs0', canonicalAddress=10.100.73.126:27017, hosts=[10.100.15.147:27017, 10.100.73.126:27017, 10.100.111.121:27017], passives=[], arbiters=[], primary='10.100.73.126:27017', tagSet=TagSet{[Tag{name='serviceName', value='mongodb'}]}, electionId=7fffffff000000000000042e, setVersion=5209130, topologyVersion=TopologyVersion{processId=62cbdee0732609efe7dccae6, counter=6}, lastWriteDate=Mon Jul 11 08:34:10 GMT 2022, lastUpdateTimeNanos=19902943021680}
2022-07-11 08:34:10.535 INFO 1 --- [00.73.126:27017] org.mongodb.driver.cluster : Setting max election id to 7fffffff000000000000042e from replica set primary 10.100.73.126:27017
2022-07-11 08:34:10.535 INFO 1 --- [00.73.126:27017] org.mongodb.driver.cluster : Discovered replica set primary 10.100.73.126:27017
2022-07-11 08:34:10.552 INFO 1 --- [ scheduling-1] org.mongodb.driver.connection : Opened connection [connectionId{localValue:70, serverValue:410}] to 10.100.73.126:27017
2022-07-11 08:34:11.448 INFO 1 --- [00.15.147:27017] org.mongodb.driver.cluster : Monitor thread successfully connected to server with description ServerDescription{address=10.100.15.147:27017, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=9, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=875959, setName='rs0', canonicalAddress=10.100.15.147:27017, hosts=[10.100.15.147:27017, 10.100.73.126:27017, 10.100.111.121:27017], passives=[], arbiters=[], primary='10.100.73.126:27017', tagSet=TagSet{[Tag{name='serviceName', value='mongodb'}]}, electionId=null, setVersion=5209130, topologyVersion=TopologyVersion{processId=62cbdcb123f4ce1a82a43f54, counter=4}, lastWriteDate=Mon Jul 11 08:34:10 GMT 2022, lastUpdateTimeNanos=19903856653811}
2022-07-11 08:34:16.523 INFO 1 --- [0.111.121:27017] org.mongodb.driver.connection : Opened connection [connectionId{localValue:71, serverValue:24}] to 10.100.111.121:27017
从保存的信息看,应该是链接问题,经过查找,加了一些参数:
&maxIdleTimeMS=1500000&maxWaitTime=120000&connectTimeout=60000&socketTimeout=60000&socketKeepAlive=true&readPreference=primary&retryWrites=true
但是还是有这个错误,没法做到根除异常信息。
后来排查发现,是mongodb集群节点频繁重启,造成链接点断开造成的。查看mongodb的状态数据
mongodb的节点服务已经宕机,出现OOM的问题。
升级mongoDB的内存,随这个问题也就解决了。
我一直在为我正在编写的应用程序而苦苦挣扎,我想我开始发现我的问题是过早的优化。我的完美主义一面希望在第一次通过时就使一切变得最佳和完美,但我发现这使设计变得相当复杂。我倾向于编写尽可能多的功能以提高效
We should develop on slow boxen because it forces us to optimize early. Randall Hyde 在 The Fallacy o
编辑:回答:我需要为“einlesen()”函数创建另一个游标。 这是我第一次在 Python 中使用 SQLite3,所以请原谅我(也许)可怕的语法;)我正在尝试构建一种 DVD 数据库,它直接从亚
result_t work(resource_t& resource) { lock_t ___(resource); return work_impl(resource); } 是否
我正在构建一项新服务,当我 curl 它时,我看到一条消息 Curl_http_done:称为过早。我找不到任何关于它的含义的文档,想知道我的服务是否不符合某些 http 规范? ➜ ~ git:(
我使用 Web-flux/Reactive 和 Webclient,在 tomcat 和 spring-boot 上运行它。 一切正常。我阅读了很多关于它的信息。问题好像是每当你使用webclient
我正在尝试使用 Stream 下载 xml 文件,一切都很好,直到 xml 大小变得大于 9 MB,所以我收到此错误java.io.IOException:过早的 EOF 这是代码 BufferedI
我正在尝试使用 urllib2 和 zlib 以及来自这两个 stackoverflow 问题的技术在 python 中处理从互联网上提取的大型 gzip 文件: > Python decompres
我一直在使用 JDOM 库通过 Java Servlet 读写 XML 文件。 问题是,当我使用 AJAX 向读取和写入 XML 文件中的数据的 servlet 发送许多请求时,很多时候它无法显示错误
我正在开发一个使用 C++ 编写的大型服务器应用程序。该服务器可能需要运行数月而不重新启动。碎片在这里已经是一个可疑的问题,因为我们的内存消耗会随着时间的推移而增加。到目前为止,测量是将私有(priv
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题? Update the question所以它是on-topic对于堆栈溢出。 9年前关闭。 Improve this que
我正在尝试通过套接字将图像文件从服务器发送到客户端。 套接字以前用于将一些字符串从服务器发送到客户端(使用缓冲的输入/输出流)。 问题是无法正确接收图像文件,出现“JPEG 文件过早结束”错误。 服务
出于某种原因,我收到了 HttpRequestException,其中包含消息“响应提前结束。我正在创建大约 500 个任务,这些任务使用我的 RateLimitedHttpClient 向网站发出请
我正在尝试使用阿尔卡特 OT900A 提交表单,但出现此错误 ava.io.IOException:损坏的表单数据:提前结束在 com.oreilly.servlet.multipart.Multip
当我尝试以这种方式解析来自网络的 XML 文件时: URL url = new URL("http://www.nbp.pl/kursy/xml/a074z120416.xml"); URLConne
我的代码有问题,但我不知道哪里出了问题。 我正在为客户编写应用程序。在启动画面期间,应用程序检查 Mysql 是否正在运行以便稍后能够连接到它。如果 mysql 处于打开状态,应用程序将继续启动。如果
import java.io.*; import com.lowagie.text.DocumentException; import org.xhtmlrenderer.pdf.ITextRende
我正在使用 OpenCV 从文件夹中读取图像。出现了很多这样的消息: Corrupt JPEG data: premature end of data segment Premature end of
这是有效的,但突然间我收到了这条错误消息。 “错误信息:脚本头过早结束:cust.php" "; echo "Back to main page"; } mysql_close(); ?> 请帮忙,提
项目开发中,链接mongodb的项目,偶尔报错com.mongodb.MongoSocketReadException: Prematurely reached end of stream 报错的详细
我是一名优秀的程序员,十分优秀!