会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 128426个问题

D:\develop\Java\jdk1.8.0_202\bin\java.exe -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:D:\tools\IntelliJIDEA\IntelliJ IDEA 2018.3.6\lib\idea_rt.jar=7201:D:\tools\IntelliJIDEA\IntelliJ IDEA 2018.3.6\bin" -Dfile.encoding=UTF-8 -classpath "D:\tools\IntelliJIDEA\IntelliJ IDEA 2018.3.6\lib\idea_rt.jar;D:\tools\IntelliJIDEA\IntelliJ IDEA 2018.3.6\plugins\junit\lib\junit-rt.jar;D:\tools\IntelliJIDEA\IntelliJ IDEA 2018.3.6\plugins\junit\lib\junit5-rt.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\charsets.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\deploy.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\ext\access-bridge-64.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\ext\atguigu.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\ext\cldrdata.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\ext\dnsns.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\ext\jaccess.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\ext\jfxrt.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\ext\localedata.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\ext\nashorn.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\ext\sunec.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\ext\sunjce_provider.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\ext\sunmscapi.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\ext\sunpkcs11.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\ext\zipfs.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\javaws.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\jce.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\jfr.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\jfxswt.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\jsse.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\management-agent.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\plugin.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\resources.jar;D:\develop\Java\jdk1.8.0_202\jre\lib\rt.jar;E:\bjsxt-zk&dubbo\code\mongodb_demo\target\classes;C:\Users\Administrator\.m2\repository\org\mongodb\mongo-java-driver\3.8.2\mongo-java-driver-3.8.2.jar;C:\Users\Administrator\.m2\repository\junit\junit\4.12\junit-4.12.jar;C:\Users\Administrator\.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 com.bjsxt.mongodb.MongodbTest,testInsertSingleDocument

九月 30, 2021 9:11:05 下午 com.mongodb.diagnostics.logging.JULLogger log

信息: Cluster created with settings {hosts=[192.168.0.136:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=50}

九月 30, 2021 9:11:05 下午 com.mongodb.diagnostics.logging.JULLogger log

信息: Cluster description not yet available. Waiting for 30000 ms before timing out

九月 30, 2021 9:11:07 下午 com.mongodb.diagnostics.logging.JULLogger log

信息: Exception in monitor thread while connecting to server 192.168.0.136:27017

com.mongodb.MongoSocketOpenException: Exception opening socket

at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:67)

at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:126)

at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117)

at java.lang.Thread.run(Thread.java:748)

Caused by: java.net.ConnectException: Connection refused: connect

at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)

at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:589)

at com.mongodb.internal.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:64)

at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:62)

... 3 more



com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=192.168.0.136:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused: connect}}]


at com.mongodb.internal.connection.BaseCluster.getDescription(BaseCluster.java:179)

at com.mongodb.internal.connection.SingleServerCluster.getDescription(SingleServerCluster.java:41)

at com.mongodb.client.internal.MongoClientDelegate.getConnectedClusterDescription(MongoClientDelegate.java:136)

at com.mongodb.client.internal.MongoClientDelegate.createClientSession(MongoClientDelegate.java:94)

at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.getClientSession(MongoClientDelegate.java:249)

at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:190)

at com.mongodb.client.internal.MongoCollectionImpl.executeSingleWriteRequest(MongoCollectionImpl.java:960)

at com.mongodb.client.internal.MongoCollectionImpl.executeInsertOne(MongoCollectionImpl.java:494)

at com.mongodb.client.internal.MongoCollectionImpl.insertOne(MongoCollectionImpl.java:478)

at com.mongodb.client.internal.MongoCollectionImpl.insertOne(MongoCollectionImpl.java:472)

at com.bjsxt.mongodb.MongodbTest.testInsertSingleDocument(MongodbTest.java:15)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)

at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)

at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)

at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)

at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)

at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)

at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)

at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)

at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)

at org.junit.runners.ParentRunner.run(ParentRunner.java:363)

at org.junit.runner.JUnitCore.run(JUnitCore.java:137)

at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)

at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)

at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)

at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)



Process finished with exit code -1



mongodb连接不上、请问下是什么原因?

微服务/第八阶段:高性能数据处理、NoSQL、分库分表/(旧)MongoDB 3楼

百战程序员微信公众号

百战程序员微信小程序

©2014-2024 百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637