• 请不要在回答技术问题时复制粘贴 AI 生成的内容
kisshere
V2EX  ›  程序员

单服务器的 elasticsearch, shard 和 replica 分别应该设置为多少?

  •  
  •   kisshere · Jul 1, 2019 · 3191 views
    This topic created in 2688 days ago, the information mentioned may be changed or developed.
    4 replies  •  2019-07-01 09:55:26 +08:00
    pmispig
    pmispig
    Jul 1, 2019
    1
    单服务器设了也没用吧?
    kindjeff
    kindjeff
    Jul 1, 2019
    2
    我维护公司的两个 ES,但小公司经验不多,自己的感想是:和具体情况有关。

    限制 replica 数量的有容量、数据重要性、写入性能。容量不够、数据不需要备份多份、写入性能不够的时候 replica 我就设成 1。
    限制 shard 的数量的有写入性能、读性能,阿里云的 ES 推荐每个 shard 不要超过多大容量(貌似 30G,文档有写),不然写性能会变差(尤其是几个写入高的大 index 在一个 node 上的时候)。但是如果要经常读,shard 分太多,读的时候就要去各个 node 上面去聚合,读性能会变差。

    要慢慢调试到合适的情况。
    kindjeff
    kindjeff
    Jul 1, 2019
    3
    @kindjeff #2 (尤其是几个写入高的大 index 在一个 node 上的时候)->(尤其是几个写入高的大 index 的 shard 在一个 node 上的时候)
    fgt
    fgt
    Jul 1, 2019
    4
    replica: 0 因为没有其他节点作为副本,挂了就是挂了; shard 随意,建议 3
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1753 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 15:56 · PVG 23:56 · LAX 07:56 · JFK 10:56
    ♥ Do have faith in what you're doing.