1.集群健康值
curl -XGET "http://xxx.xxx.xxx.xxx:9200/_cluster/health?pretty=true"

2.集群状态
curl -XGET "http://xxx.xxx.xxx.xxx9200/_cluster/state?pretty=true"

3.集群统计:
curl -XGET "http://xxx.xxx.xxx.xxx:9200/_cluster/stats?pretty=true"

4.节点状态
curl -XGET "http://xxx.xxx.xxx.xxx:9200/_cat/nodes?v"

5.索引信息
curl -XGET "http://xxx.xxx.xxx.xxx:9200/_cat/indices?v"

6.文档总量
curl -XGET "http://xxx.xxx.xxx.xxx:9200/_cat/count?v"

7.强制分片分配(非专业人员禁止执行!!!)
curl -XPOST 'xxx.xxx.xxx.xxx:9200/_cluster/reroute' -d '{"commands":[{"allocate":{"index":"newcase","shard":1,"node":"xxx.xxx.xxx.xxx","allow_primary":true}}]}'

8.分片移动(非专业人员禁止执行!!!)
首先需要禁用分片的自动均衡
cluster.routing.allocation.enable:none
cluster.routing.rebalance.enable:none
curl  -XPOST "xxx.xxx.xxx.xxx:9200/_cluster/reroute" -d '{"commands":[{"move":{"index":"dapdatas","shard":0,"from_node":"xxx.xxx.xxx.xxx","to_node":"ip"}}]}'

9.未分配分片详细原因查询
curl -XGET "xxx.xxx.xxx.xxx:9200/_cluster/allocation/explain" -d '{"index": "newcase","shard": 0,"primary": true}'

10.设置索引的刷新时间
curl -XPUT 'http://xxx.xxx.xxx.xxx:9200/mac_20171202/_settings' -d  '{"index":{"refresh_interval":"-1"}}'

curl -XPUT 'http://xxx.xxx.xxx.xxx:9200/mac_20171202/_settings' -d  '{"index.translog.flush_threshold_size":"1g"}'
curl -XPUT 'http://xxx.xxx.xxx.xxx:9200/_cluster/settings' -d  '{"transient":{"threadpool.index.queue_size":1000}}'

11.设置查询返回数据的大小
curl -XPUT 'http://xxx.xxx.xxx.xxx:9200/dapdatas/_settings' -d '{"index":{"max_result_window":100000}}'

12.归并线程限速
curl -XPUT 'http://xxx.xxx.xxx.xxx:9200/_cluster/settings' -d '{"persistent":{"indices.store.throttle.max_bytes_per_sec":"500mb"}}'

13.强制段合并
curl -XPOST 'http://ip:9200/newperson/_forcemerge?max_num_segments=1' 
curl -XPOST 'http://ip:9200/person_v8/_forcemerge?max_num_segments=1'

14、获取索引下某个type的mapping类型
 curl -XGET 'http://ip:9200/file_attachment/attachment/_mapping/'
15、获取索引下的type
 curl -XGET 'http://ip:端口/索引/_mapping?pretty=true'
 curl -XGET 'http://ip:端口/newtrajectory_20190817/GCKK/_mapping?pretty=true'

16.修改索引副本数
put index/_settings {"number_of_replicas":0}

17、索引改名
post _reindex
{"dest":{"index":"newwxp_201907"},"source":{"index":"wxp_201907"}}
{
  "dest": {
    "index": "person_bak"
  },
  "source": {
    "index": "person",
    "size": 5000,//批量抓取的size的大小
    "query": {}//查询指定条件下的字段
  }
}
slices====>线程数最后根据实际的分片数来设置
curl -H "Content-Type:application/json" -XPOST 'ip:端口/_reindex?slices=5&refresh&pretty' -d '
{
  "conflicts": "proceed",//出现错误跳过
  "source": {
    "index": "ceshi"
  },
  "dest": {
    "index": "newceshi"
  }
}'

18、添加别名
post _aliases
{"actions":[{"add":{"index":"staticdata","alias":"person"}}]}

19、查看段合并情况
http://ip:端口/_cat/segments?v
http://ip:端口/_cat/segments?v

20、查看任务并停止
查看任务:
http://ip:端口/_cat/tasks?v
停止任务:
 curl -XPOST 'http://ip:端口/_tasks/hEvu8BipS7yN1MYv26yblg:192942739/_cancel'

21.查询时增加参数。
  "profile": true, //查询时曾加该参数,用来分析查询速度慢的问题。

22、创建索引
PUT book_v5
//不分词
{
  "settings":{
    "number_of_shards": "6",
    "number_of_replicas": "1",  
     //指定分词器  
    "analysis":{   
      "analyzer":{
        "ik":{
          "tokenizer":"ik_max_word"
        }
      }
    }
  }
}
//分词!!!
{
  "settings": {
    "number_of_shards": "5",
    "number_of_replicas": "0",
    "analysis": {
      "analyzer": {
        "default": {
          "type": "ik_max_word"
        }
      }
    }
  }
}

es运维常用基本命令记录。相关推荐

  1. 运维常用Mysql基本命令

    运维常用Mysql基本命令 基本命令 #远程连接 mysql -h hostname -u root -p #创建数据库 create database [databasename]; #列出所有数据 ...

  2. linux清除历史命令记录_Linux运维常用维护命令记录,不是长篇理论,干的实用...

    运维常用命令,希望学习Linux同学更快地熟练掌握,没有太多的理论统统是干活,以下内容来自网络,需要的同学拿去慢慢消化吧. 嵌入式开发直播课 - 走进linux底层驱动 - 创客学院直播室​www.m ...

  3. linux运维常用培训

    linux运维常用培训 2021年2月 目录 一. 系统监控 1.free命令使用 2.ulimit命令使用 3.top命令使用 4.du命令使用 5.ps命令使用 6. crontab 命令 二. ...

  4. Linux运维常用命令(转)

    为什么80%的码农都做不了架构师?>>>    1.删除0字节文件 find-type f -size 0 -exec rm -rf {} \; 2.查看进程 按内存从大到小排列 p ...

  5. 很实用的Linux 系统运维常用命令及常识(超实用)

    很实用的Linux 系统运维常用命令及常识(超实用) 作为Linux运维,需要了解Linux操作系统的基本使用和管理知识,下面脚本之家小编给大家介绍下Linux运维需要掌握的命令,想成为Linux运维 ...

  6. Linux系统运维常用命令

    Linux 系统运维常用命令 1 文件管理2 软件管理3 系统管理 4 服务管理5 网络管理6 磁盘管理 7 用户管理8 脚本相关9 服务配置 ============================ ...

  7. oracle 运营维护_Oracle数据库日常运维常用脚本

    大 中 小 Oracle数据库日常运维常用脚本 1 查看所有数据文件 select file_name from dba_data_files union select file_name from ...

  8. python运维模块_Python 运维常用模块

    基础库:sys.os(os.path.os.stat).time.logging.prarmiko.re.random Python运维常用的20个库 1.psutil是一个跨平台库(https:// ...

  9. linux运维常用服务器软件整理和介绍

    本文介绍Linux运维常用的服务器软件,中间件,运维工具等. 目录 代理服务器 nginx 运行环境 php python c++/g++ java go 数据库/中间件 redis mysql po ...

  10. 轻松熊喵喵 -- 运维常用工具

    轻松熊喵喵个人笔记 -- 运维常用工具 1.jumpserver跳板机 FIT2CLOUD飞致云旗下品牌 2.rancker k8s管理平台 3.yapi 接口管理平台 4.git 代码存储平台 5. ...

最新文章

  1. 永远不要在代码中使用「User」这个单词!
  2. 【Flask项目2】多进程下的日志文件(2)
  3. struts.xml配置文件结构
  4. Golang协程goroutine和管道channel结合案例
  5. OpenStack(五)——Neutron组件
  6. MSP430F5529 DriverLib 库函数学习笔记(十二)I2C实战
  7. 360手柄摇杆漂移修复_彻底解决你的Switch手柄摇杆问题,最省钱的完美修复。
  8. Pytorch-张量的创建与使用方法
  9. HTML学习总结(6)——表单
  10. Codingame平台“CHUCK NORRIS”的实现
  11. 基于大数据分析山东2020年高考难度和选科要求(一)
  12. HTML5系列代码:使用自定义图像来作为空距
  13. 思科认证和华为认证交换机环路的产生原因和解决方法-ielab实验室
  14. MISO和MOSI是什么意思
  15. 服务器ssd硬盘的读写速度,在不同场景下,应该如何正确选购服务器级SSD固态盘呢?...
  16. R_Studio(学生成绩)对数据缺失值md.pattern()、异常值分析(箱线图)
  17. CMake生成多个.so文件
  18. UbuntuLinux
  19. OpenMesh 报错“Use dereferencing operators - and * instead.”的解决
  20. 推荐 Mac 平台上常用的 5 款 PDF 阅读编辑软件

热门文章

  1. 使用Kettle读取Excel文件中的数据,存储在MySQL中
  2. 使用python 批量修改图片分辨率
  3. GIMP为证件照更换背景颜色
  4. Echarts正态分布曲线
  5. 【小白写代码之九九乘法表,用C/C++来实现】
  6. 华为路由器忘记密码怎么恢复
  7. Leetcode 741. Cherry Pickup DP
  8. JAVA 算法 回溯
  9. en结尾的单词_en后缀形容词——动词
  10. 电脑小米手机,小米手机和电脑无线连接方法