Mongo Java驱动程序无法连接到副本集

时间:2013-12-21 09:21:01

标签: mongodb

当使用mongodb驱动程序与副本集进行连接时,它会发出连接到localhost的警告,如下所述。知道为什么吗?

Dec 21, 2013 2:47:49 PM com.mongodb.ConnectionStatus$UpdatableNode update
WARNING: Server seen down: localhost/127.0.0.1:10001 - java.io.IOException - message: couldn't connect to [localhost/127.0.0.1:10001] bc:java.net.ConnectException: Connection refused: connect
Dec 21, 2013 2:47:50 PM com.mongodb.ConnectionStatus$UpdatableNode update
WARNING: Server seen down: localhost/127.0.0.1:10003 - java.io.IOException - message: couldn't connect to [localhost/127.0.0.1:10003] bc:java.net.ConnectException: Connection refused: connect
Dec 21, 2013 2:47:52 PM com.mongodb.ConnectionStatus$UpdatableNode update
WARNING: Server seen down: localhost/127.0.0.1:10001 - java.io.IOException - message: couldn't connect to [localhost/127.0.0.1:10001] bc:java.net.ConnectException: Connection refused: connect
Dec 21, 2013 2:47:53 PM com.mongodb.ConnectionStatus$UpdatableNode update
WARNING: Server seen down: localhost/127.0.0.1:10003 - java.io.IOException - message: couldn't connect to [localhost/127.0.0.1:10003] bc:java.net.ConnectException: Connection refused: connect
Dec 21, 2013 2:47:54 PM com.mongodb.ConnectionStatus$UpdatableNode update
WARNING: Server seen down: localhost/127.0.0.1:10002 - java.io.IOException - message: couldn't connect to [localhost/127.0.0.1:10002] bc:java.net.ConnectException: Connection refused: connect
Exception in thread "main" com.mongodb.MongoException: can't find a master
    at com.mongodb.DBTCPConnector.checkMaster(DBTCPConnector.java:514)
    at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:174)
    at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:155)
    at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:249)
    at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:205)
    at com.mongodb.DBCollection.insert(DBCollection.java:57)
    at com.mongodb.DBCollection.insert(DBCollection.java:100)
    at mongo.Test.main(Test.java:33)

0 个答案:

没有答案