com.mongodb.MongoException: 不与 master 交谈并且重试已用完 [英] com.mongodb.MongoException: not talking to master and retries used up

查看:55
本文介绍了com.mongodb.MongoException: 不与 master 交谈并且重试已用完的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的搜索现在不起作用.我猜是因为我的索引没有为副本集配置:

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" 
  }
}'`

无论如何要正确声明副本集,以便elasticsearch可以找到主节点,就像PHP驱动程序所做的那样:

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)
);

以便elasticsearch可以自动故障转移到另一个成员.

so that elasticsearch can automatically fail over to another member.

推荐答案

我只是通过更新到最新版本的客户端驱动程序来解决这个问题.

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

之前的(次要)版本无法连接到最新的 mongo 服务器.

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

这篇关于com.mongodb.MongoException: 不与 master 交谈并且重试已用完的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆