首页 > 其他分享 >ES常用维护命令

ES常用维护命令

时间:2022-09-04 15:36:59浏览次数:54  
标签:常用 settings GET allocation cluster routing PUT 维护 ES

1、查看分片分布
GET _cat/shards?v

2、设置集群节点允许分片数
GET /_cluster/settings
{
  "index.routing.allocation.total_shards_per_node":2
}

3、解除索引只读
PUT /_all/_settings
{
  "index.blocks.read_only_allow_delete": null
}

4、查看索引状态
GET _cat/indices\?v

5、查看集群健康状态
GET _cluster/health

6、查看集群运行事件
GET /_cluster/allocation/explain

7、设置索引副本数为0
 PUT /comunication-iot-2022.09.02/_settings
{
    "number_of_replicas": 0
}

8、手动迁移副本
POST /_cluster/reroute
{
    "commands" : [
        {
            "move" : {
                "index" : "micro-service-income-statistics-2022.06.19", "shard" : 0,
                "from_node" : "es_node7", "to_node" : "es_node2"
            }
        }
    ]
}

9、设置节点存储水平
PUT /_cluster/settings
{
  "persistent": {
    "cluster.routing.allocation.disk.watermark.low": "90%",
    "cluster.routing.allocation.disk.watermark.high": "95%",
    "cluster.info.update.interval": "1m",
    "cluster.routing.allocation.disk.threshold_enabled": true
  }
}

10、排除节点并迁移索引
PUT _cluster/settings
{
  "persistent" : {
    "cluster.routing.allocation.exclude._ip" : "10.5.232.248"
  },
      "transient" :{
      "cluster.routing.allocation.exclude._ip" : "10.5.232.248"
   }
}

11、取消排除的节点
PUT _cluster/settings
{
  "persistent" : {
    "cluster.routing.allocation.exclude._ip" : null
  },
      "transient" :{
      "cluster.routing.allocation.exclude._ip" : null
   }
}

标签:常用,settings,GET,allocation,cluster,routing,PUT,维护,ES
From: https://www.cnblogs.com/Dev0ps/p/16655182.html

相关文章

  • error loading sources list: ('The read operation timed out',)解决办法!!
    一、灵魂四问1.为什么叫rosdepc?rosdepc,c指的是China中国,主要用于和rosdep区分。2.rosdepc和rosdep功能一致吗?rosdep官方最新版源码直接修改的,小鱼只动了名称和源地址......
  • PostgreSQL-查询
    检索过程或从数据库中检索数据的命令称为查询。在SQL中,SELECT命令用于指定查询。SELECT命令的一般语法是:[WITHwith_queries]SELECTselect_listFROMtable_express......
  • [nginx]编译安装openresty
    前言OpenResty是一个基于Nginx和Lua的高性能Web平台,其内部集成了大量精良的Lua库、第三方模块以及大多数的依赖项。用于方便地搭建能够处理超高并发、扩展性极高的动态We......
  • Codeforces Round #818 (Div. 2) CF1717 解题报告
    CodeforcesRound#818(Div.2)CF1717解题报告ADescription求出满足\(1\lea,b\leN,\frac{\operatorname{lcm}(a,b)}{\gcd(a,b)}\le3\)的二元组\((a,b)\)的数目。......
  • Mybatis的ResultMap和ResultType的区别
    在使用mybatis进行数据库连接操作时对于SQL语句返回结果的处理通常有两种方式,一种就是resultType另一种就是resultMap,下面说下我对这两者的认识和理解resultType:当使用re......
  • 创建自定义starter及读取resources资源目录下的文件
    生成maven项目结构包含的资源目录如下pom文件中指定生成格式<packaging>jar</packaging>创建对应的自定义配置对象@ConfigurationProperties(prefix="app.huito......
  • pytest 钩子函数 (二) 用例收集钩子
    pytest_collectiont设置pytest收集用例执行的流程,这个钩子函数一般不需要重写,除非你想自己制定pytest用例收集的流程。参数session:pytest会话对象触发时机:......
  • 将 Go 类型打印为 S-Expressions
    将Go类型打印为S-ExpressionsPhotoby西格蒙德on不飞溅如果您已经使用Go一段时间,您可能知道当您使用“fmt”包渲染到控制台时,您可以从go结构中获得合理的输......
  • Could not find artifact org.pentaho:pentaho-aggdesigner-algorithm:pom:5.1.5-jhyd
    在Spark连接Hive导入相关maven依赖时<dependency><groupId>org.apache.hive</groupId><artifactId>hive-exec</artifactId><version>2.3.4</version></de......
  • [数论] Codeforces 1717E Madoka and The Best University
    题目大意求\[\sum_{a>0,b>0,c>0,a+b+c=n}\mathrm{lcm}(c,\gcd(a,b))\]\((3\leqn\leq10^5)\)题解\[ans=\sum_{a}\sum_{b}\mathrm{lcm}(n-a-b,\gcd(a,b))\\=\sum_{d......