com.mongodb.MongoException: not talking to master and retries used up

依然范特西╮ 提交于 2020-01-15 15:37:11

问题


My search is not working now. I guess because my index was not configured for replica set:

curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d '{
  "type": "mongodb", 
  "mongodb": { 
    "db": "mongo", 
    "host": "local", 
    "port": "40000", 
    "collection": "users"
  }, 
  "index": { 
    "name": "api", 
    "type": "users" 
  }
}'`

Is there anyway to declare a replica set properly so that elasticsearch can find the master, the way PHP driver does:

$m = new Mongo(
  "mongodb://localhost:40000,localhost:41000", 
  array("replicaSet" => true)
);

so that elasticsearch can automatically fail over to another member.


回答1:


I solved this simply by updating to the latest version of the client driver.

The previous (minor) version had trouble connecting to the latest mongo server.



来源:https://stackoverflow.com/questions/11308750/com-mongodb-mongoexception-not-talking-to-master-and-retries-used-up

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!