#查看集群状态
curl -XGET "http://localhost:9200/_cluster/health?pretty"
#查看所有的快照
curl -XGET "http://localhost:9200/_snapshot/仓库名/_all"
#查看快照信息
curl -XGET "http://localhost:9200/_snapshot/仓库名/snapshot_name/_status"
#删除快照
curl -XDELETE "localhost:9200/_snapshot/仓库名/snapshot_name"
#生成快照  
curl -XPUT -uelastic:xxxx "http://127.0.0.1:9200/_snapshot/仓库名/snapshot_name?wait_for_completion=true" -d '
{
"indices": "index_name",
"ignore_unavailable": "true", #在创建快照的过程中会忽略不存在的索引
"include_global_state": false #防止集群的全局状态被作为快照的一部分存储起来
}'
#恢复快照
curl -XPOST "http://127.0.0.1:9200/_snapshot/仓库名/snapshot_name/_restore?wait_for_completion=true" -d '
{
"ignore_unavailable": "true",
"include_global_state": false ,
"index_settings": { "index.number_of_replicas": 0 } #配置 replica为0,可选条件
}'
#查看快照恢复状态
curl "http://localhost:9200/_cluster/state" | jq '.restore'
#关闭索引
curl -XPOST "http://localhost:9200/index_name/_close"
#开启索引
curl -XPOST "http://localhost:9200/index_name/_open"
#删除索引
curl -XDELETE "http://127.0.0.1:9200/index_name"
#查看索引数据
curl -XGET "http://localhost:9200/index_name/_search"
#合并段
curl -XPOST "http://localhost:9200/index_name/_forcemerge?max_num_segments=1"
#配置replica个数
curl -XPUT "http://localhost:9200/index_name/_settings" -d '{
"index" : {
"number_of_replicas" : 0 }
}'
#创建仓库
curl -XPUT "http://127.0.0.1:9200/_snapshot/仓库名" -d '
{
"type": "fs",
"settings": {
"location": "/S3/elasticsearch/仓库目录路径" }
}'
#查询仓库信息
curl -XGET "http://127.0.0.1:9200/_snapshot/仓库名"

elasticsearch 常用命令的更多相关文章

  1. elasticsearch常用命令

    elasticsearch的rest访问格式: curl -X<REST Verb> <Node>:<Port>/<Index>/<Type> ...

  2. 实战ELK(2) ElasticSearch 常用命令

    1.Cluster Health 集群状态 curl 'localhost:9200/_cat/health?v' yellow代表分片副本确实,因为我们现在只有一台机器. curl 'localho ...

  3. elasticsearch 常用命令(一)

    索引 搜索 mapping 分词器 1.创建索引 http://192.168.65.131:9200/smartom_index?pretty 2.查看索引: http://192.168.65.1 ...

  4. elasticsearch 常用命令 一直红色 重启不稳定 不停的宕机

    persistent (重启后设置也会存在) or transient (整个集群重启后会消失的设置). 查看集群状态和每个indices状态.搜索到red的,没用就删除 GET /_cluster/ ...

  5. ElasticSearch——常用命令

    集群相关 --查询集群健康状态 GET _cluster/health --查询所有节点 GET _cat/nodes --查询索引及分片的分布 GET _cat/shards --查询指定索引分片的 ...

  6. elasticsearch常用命令备注

    1.检查集群健康状态 curl 'localhost:9200/_cat/health?v' 2.检查节点健康状态 curl 'localhost:9200/_cat/nodes?v' 3.新增一条索 ...

  7. elasticsearch(四) 之 elasticsearch常用的一些集群命令

    目录 elasticsearch常用的一些集群命令 查看集群健康状态 查看集群的节点列表 查看所有的索引 删除索引 查询索引的某个文档内容 更新文档 删除文档 自动创建索引 定时删除索引 elasti ...

  8. elasticsearch 索引清理脚本及常用命令

    elastic索引日志清理不及时,很容易产生磁盘紧张,官网给出curl -k -XDELETE可以清理不需要的索引日志. 清理脚本 #!/bin/bash #Author: 648403020@qq. ...

  9. Docker安装和常用命令

    Docker安装 Docker的安装可以参考 https://docs.docker.com/ 下面的 Get Docker / Docker CE / Linux, 需要关注的主要是CentOS和U ...

随机推荐

  1. 关于python字符串基本操作

    python字符串基本操作,比如字符串的替换.删除.截取.复制.连接.分割等.都是一些关于字符串的一些方法.下面来列举一些,相信对学习python还是有些帮助的. 1.去除空格--strp(): &g ...

  2. python2和python3共存时,设置默认python为python3

    sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100 sudo update-alternati ...

  3. day26:静态方法,类方法和反射

    1,包内部不要去尝试应用使用相对导入,一定不会成功的,他不支持这个机制,包内导入时一定要用绝对导入 2,复习接口类,抽象类,Python中没有接口类,有抽象类,抽象类是通过abc模块中的metacla ...

  4. Toad for Oracle 创建表空间和用户

    表空间 1.找到Tablespace,右键,单击Create Tablespace 2.输入表空间名字,例如:test_tablespace3.单击"Date Files"选项卡, ...

  5. 温习排序算法(基于C指针)

    以前学过的数据结构课,貌似已经忘得一干二净了,偶然又翻起,书中最后一章详细介绍了7种排序算法,现在对其中4种做个总结.(为啥只总结4种,当然是因为偷懒,只想总结简单又常用的!) 先贴一张排序分类图: ...

  6. box-sizing:border-boxing的使用

    <div class="box"></div> .box { margin-top: 200px; margin-left: 200px; backgrou ...

  7. Window Server配置Flask

    1.安装了Chrome 2.安装git 3.创建SSH key:ssh-keygen -t rsa -C "youremail@example.com" 4.安装notepad++ ...

  8. Python selenium巧用Javascript脚本注入解决按钮点选问题

    前段时间,笔者忙于应付公司组织的雅思考试,白天.晚上但凡有空,笔者都是埋头伏案,啃剑桥雅思(剑4~剑12)的官方模拟题或者做着与雅思考试相关的准备工作,这个过程持续了40余天.最近总算鼓起勇气走进考场 ...

  9. log4cplus在VS项目中的使用

    log4cplus是C++编写的开源的日志系统,宣称具有线程安全.灵活.以及多粒度控制的特点,通过将日志划分优先级使其可以面向程序调试.运行.测试.和维护等全生命周期.你可以选择将日志输出到屏幕.文件 ...

  10. Ubuntu 常见的问题及常见软件的安装_ubuntu16.04

    1, 在使用 rpm 删除 rpm 包的时候的: rpm -r *** 报错: error reading information on service sfdc3: No such file or ...