首页 > 其他分享 >es根据磁盘使用情况来决定是否分配shard

es根据磁盘使用情况来决定是否分配shard

时间:2023-05-31 12:36:22浏览次数:28  
标签:watermark shard allocation cluster routing 分片 磁盘 disk es

注意两个地方说法有出入,待实测!

es可以根据磁盘使用情况来决定是否继续分配shard。默认设置是开启的,也可以通过api关闭:cluster.routing.allocation.disk.threshold_enabled: false

在开启的情况下,有两个重要的设置:

cluster.routing.allocation.disk.watermark.low:控制磁盘最小使用率。默认85%.说明es在磁盘使用率达到85%的时候将会停止分配新的shard。也可以设置为一个绝对数值,比如500M.

cluster.routing.allocation.disk.watermark.high:控制磁盘的最大使用率。默认90%.说明在磁盘使用率达到90%的时候es将会relocate shard去其他的节点。同样也可以设置为一个绝对值。

watermark setting可以通过update-api动态修改,默认es每隔30s会收集各个节点磁盘的使用情况,可以cluster.info.update.interval来设置时间间隔。

 

参考:http://www.voidcn.com/blog/jingkyks/article/p-3255075.html

里面有很多ES参数的详细讲解!

 

 

DiskThresholdDecider是在ElasticSearch 0.90.4版本引入的功能。它允许用户基于可用磁盘空间来分配分片。它默认是关闭的。如果想启动它,则需要把cluster.routing.allocation.disk.threshold_enabled属性设置为true。这个决策者可以通过配置阈值来控制何时可以将分片分配到该节点,何时ElasticSearch应该把分片分配到其它节点。

cluster.routing.allocation.disk.watermark.low属性允许用户指定一个百分比阈值或者绝对数值来控制何时能够进行分片分配。比如默认值是0.7,表示当可用磁盘空间低于70%时,新的分片才可以分配到该节点上。

cluster.routing.allocation.disk.watermark.high属性允许用户指定一个百分比阈值或者绝对数值来控制何时需要将分片分配到其它的节点。比如默认值是0.85,表示当可用磁盘空间高于85%时,ElasticSearch会重新把该节点的分片分配到其它节点。

cluster.routing.allocation.disk.watermark.low属性和cluster.routing.allocation.disk.watermark.high属性都可以指定一个百分比阈值(比如0.7或者0.85)或者绝对数值(比如1000mb)。来控制何时需要将分片分配到其它的节点。比如默认值是0.85,此外,上述属性都可以通过elasticsearch.yml静态设置或者用ElasticSearch API动态调整。

参考:http://udn.yyuap.com/doc/mastering-elasticsearch/chapter-4/43_README.html

标签:watermark,shard,allocation,cluster,routing,分片,磁盘,disk,es
From: https://blog.51cto.com/u_11908275/6385988

相关文章

  • The 2023 Guangdong Provincial Collegiate Programming Contest
    A-算法竞赛#include<bits/stdc++.h>usingnamespacestd;#defineintlonglongvoidsolve(){intst,n,ed;cin>>st>>n;map<int,int>cnt;for(inti=1,x;i<=n;i++){cin>>x;......
  • 果然python是直接可以使用requests去请求https站点的,意味着一般的扫描工具可以直接扫
    #coding:utf-8importrequests#请求地址#url="https://www.qlchat.com"url="https://www.baidu.com"headers={'user-agent':'Mozilla/5.0(WindowsNT10.0;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chro......
  • 「题解」ABC292G Count Strictly Increasing Sequences
    没一眼看出来还是拉了。考虑区间dp,\(f_{i,l,r}\)表示\([l,r]\)前\((i-1)\)位都相同,看后面\([i,n]\)位填数使得递增的方案数是多少。这样已经可以做了,但是还不够,要追求一下最简单的写法。想想,发现每次dp是要分为多个儿子乘起来,内部还要搞个dp。但可以改成每次两个儿子......
  • wireshark分析tcp传输之文件上传速率问题
    在网络性能问题排查思路那一节里,我提到了查看系统网络瓶颈的方法以及排查丢包问题的手段。但就此分析网络问题还不够精细,有时网络资源并没有达到瓶颈,或者并没有丢包产生,但是网络传输速率就是很慢,或者有丢包产生,但无法知道丢包的详细过程,无法知道整个tcp传输过程的具体情况。如何......
  • 近万条英文智力问答题库ACCESS\EXCEL数据库
    今天弄到了一份很不错的英文版智力问答题库,属于那种我很满意的数据库,原因有:1.记录数将近1万条达到库的基础;2.分类表信息包含大小分类非常详细;3.题目内容包含六七百条含有图片的题;4.题库除了选择题外还包含判断题,具体看以下截图:题止表中的QUIZ_PK_ID字段关联分类表中的ID,另外需......
  • lucene LZ4 会将doc存储在一个chunk里进行Lz4压缩 ES的_source便如此
    默认情况下,Elasticsearch用JSON字符串来表示文档主体保存在 _source 字段中。像其他保存的字段一样,_source 字段也会在写入硬盘前压缩。The_sourceisstoredasabinaryblob(whichiscompressedbyLucenewithdeflateorLZ4)其实就是多个_source合并到一个chunk里......
  • ES正常停止步骤
    1.停止所有index服务 2.执行curl-XPUT$url/_cluster/settings?pretty-d'{"transient":{"cluster.routing.allocation.enable":"none"}}' 3.执行curl-XPOST$url/_flush/synced?pretty 4.重启ES集群 5.等待集群分片全部分配成功,执行curl-XPUT$url......
  • ES跨版本升级?——难道升级集群发生shard allocation是因为要分配replica节点???
    FullclusterrestartupgradeElasticsearchrequiresafullclusterrestartwhenupgradingacrossmajorversions.Rollingupgradesarenotsupportedacrossmajorversions.Consultthis table toverifythatafullclusterrestartisrequired.Theprocesstop......
  • Recovering unassigned shards on elasticsearch 2.x——副本shard可以设置replica为0
    Recoveringunassignedshardsonelasticsearch2.x摘自:https://z0z0.me/recovering-unassigned-shards-on-elasticsearch/Igotaccrosstheproblemwhendecidedtoaddanodetotheelasticsearchclusterandthatnodewasnotabletoreplicatetheindexesofthe......
  • 【wireshark】常用过滤规则
    Wireshark是一款流行的网络协议分析工具,使用它可以捕获网络数据包,并对其进行分析。在Wireshark中,过滤规则是非常重要的,通过过滤规则可以快速定位和过滤关注的数据包一、基础过滤规则1、按IP地址过滤ip.addr==x.x.x.x#过滤指定IP地址的数据包ip.src==x.x.x.x#过滤源IP......