#查看集群状态
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. js除法四舍五入

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <hea ...

  2. WinForm控件Dock属性设置会遮盖其他控件的解决

    在被遮盖住的控件上,右击弹出快捷菜单,然后选择“置于顶层”.

  3. promise 的学习

    promise 是为了解决异步操作的顺序问题而产生的 特性 promise 的实例一旦创建就会执行里面的异步操作 promise 的实例状态一旦改变就变成凝固的了, 无法再对其作出修改,  (不明白为 ...

  4. python遍历文件

    #!/usr/local/bin/python # -*- coding: UTF-8 -*- #coding:gbk import re import os rootdir = 'src' def ...

  5. 2018-2019-2 20165336 《网络对抗技术》 Exp6 信息搜集与漏洞扫描

    2018-2019-2 20165336 <网络对抗技术> Exp6 信息搜集与漏洞扫描 一.原理与实践说明 1.实践内容 本实践的目标是掌握信息搜集的最基础技能.具体有: 各种搜索技巧的 ...

  6. L1-039. 古风排版

    L1-039. 古风排版 中国的古人写文字,是从右向左竖向排版的.本题就请你编写程序,把一段文字按古风排版. 输入格式: 输入在第一行给出一个正整数N(<100),是每一列的字符数.第二行给出一 ...

  7. 如何优化 ThreadPoolExecutor

    一.想让线程池在初始化时就干活,而不是等到第一次提交任务时才创建线程,该怎么做? /** * Starts all core threads, causing them to idly wait fo ...

  8. opencart精简checkout购物流程

    最近在做一个商城项目,让外国朋友帮忙看看,他给我们一些建议了,其中他说Can You make more simple buying Button,3 step:Sign up :Shipping A ...

  9. 【转】Java遍历Map对象的四种方式

    关于java中遍历map具体哪四种方式,请看下文详解吧. 方式一 这是最常见的并且在大多数情况下也是最可取的遍历方式.在键值都需要时使用. Map<Integer, Integer> ma ...

  10. mac pro换屏指南

    https://www.ifixit.com/ 该网站提供了 换屏的详细操作步骤.