V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
fxxkgw
V2EX  ›  Elasticsearch

es 集群中不同节点拿到全量数据不一致

  •  1
     
  •   fxxkgw · 2019-05-17 12:16:03 +08:00 · 4248 次点击
    这是一个创建于 1799 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我的 ES 小集群由 3 台服务器组成
    {
    "cluster_name" : "elasticsearch",
    "status" : "green",
    "timed_out" : false,
    "number_of_nodes" : 3,
    "number_of_data_nodes" : 3,
    "active_primary_shards" : 50,
    "active_shards" : 100,
    "relocating_shards" : 0,
    "initializing_shards" : 0,
    "unassigned_shards" : 0,
    "delayed_unassigned_shards" : 0,
    "number_of_pending_tasks" : 0,
    "number_of_in_flight_fetch" : 0,
    "task_max_waiting_in_queue_millis" : 0,
    "active_shards_percent_as_number" : 100.0
    }

    通过 _cat/indices 查到索引的 docs.count 数量为 10W
    通过脚本
    from elasticsearch import Elasticsearch, helpers

    es = Elasticsearch()
    query = {"query": {"match_all": {}}}
    scan_resp = helpers.scan(client=es, query=query, scroll="10m", index="index", doc_type="doc", timeout="10m")
    for es_info in scan_resp:
    pass

    方法每次只能拿到 9W 多条数据,会随机漏掉几百条。
    同样的脚本,放到服务器另一台上执行,可以拿全。
    三台机器组成的集群,有两台(一台 master 一台 slave )会出现漏,一台正常( slave ),上述情况必现的...
    怎么排查这个问题呢?

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5313 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 07:51 · PVG 15:51 · LAX 00:51 · JFK 03:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.