elasticsearch 常用命令
#查看集群状态
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 常用命令的更多相关文章
- elasticsearch常用命令
elasticsearch的rest访问格式: curl -X<REST Verb> <Node>:<Port>/<Index>/<Type> ...
- 实战ELK(2) ElasticSearch 常用命令
1.Cluster Health 集群状态 curl 'localhost:9200/_cat/health?v' yellow代表分片副本确实,因为我们现在只有一台机器. curl 'localho ...
- elasticsearch 常用命令(一)
索引 搜索 mapping 分词器 1.创建索引 http://192.168.65.131:9200/smartom_index?pretty 2.查看索引: http://192.168.65.1 ...
- elasticsearch 常用命令 一直红色 重启不稳定 不停的宕机
persistent (重启后设置也会存在) or transient (整个集群重启后会消失的设置). 查看集群状态和每个indices状态.搜索到red的,没用就删除 GET /_cluster/ ...
- ElasticSearch——常用命令
集群相关 --查询集群健康状态 GET _cluster/health --查询所有节点 GET _cat/nodes --查询索引及分片的分布 GET _cat/shards --查询指定索引分片的 ...
- elasticsearch常用命令备注
1.检查集群健康状态 curl 'localhost:9200/_cat/health?v' 2.检查节点健康状态 curl 'localhost:9200/_cat/nodes?v' 3.新增一条索 ...
- elasticsearch(四) 之 elasticsearch常用的一些集群命令
目录 elasticsearch常用的一些集群命令 查看集群健康状态 查看集群的节点列表 查看所有的索引 删除索引 查询索引的某个文档内容 更新文档 删除文档 自动创建索引 定时删除索引 elasti ...
- elasticsearch 索引清理脚本及常用命令
elastic索引日志清理不及时,很容易产生磁盘紧张,官网给出curl -k -XDELETE可以清理不需要的索引日志. 清理脚本 #!/bin/bash #Author: 648403020@qq. ...
- Docker安装和常用命令
Docker安装 Docker的安装可以参考 https://docs.docker.com/ 下面的 Get Docker / Docker CE / Linux, 需要关注的主要是CentOS和U ...
随机推荐
- table表格设置边框线为单实线
设置table表格边框为单实线的方法有两种 第一种方法就是利用table标签cellspacing=0属性来实现,cellspacing是内边框和外边框的距离,这种方法实现的看起来是单实线,其实是内边 ...
- jmeter数据库连接配置
一.实际试过的mysql配置 1.导入一个JDBC jar包(我是直接把jar包放在了jmeter的lib目录),包:mysql-connector-java-5.1.7-bin.jar 2.设置JD ...
- BtxCMS.Net 项目
项目: 广告位:<script type="text/javascript" src="http://yg1.jmcdn.cn/file/script/A538.x ...
- C++20 要来了!
867 人赞同了该文章 C++的新标准又双叒叕要到来了,是的,C++20要来了! 图片来源:udemy.com 几周前,C++标准委会历史上规模最大的一次会议(180人参会)在美国San Diego召 ...
- Asp.net 使用线程池实例
实际开发经常会使用线程,如果每次使用都是创建线程.启动线程,然后销毁线程,从性能上来讲,非常占用系统开销,当线程达到一定量的时候会影响程序的运行和处理效率. 使用线程池:好处:线程池是一种多线程处理形 ...
- 关于SQL配置管理工具无法打开0x8004100e问题!
今天犯了个很“2”得问题,因为在远程数据库可以访问,并且也在安装程序中有看到装有SQLserver Mamngement Studio及其它程序,所以想在本地使用数据库应该可以但没想却总是报SQL配置 ...
- 《图解HTTP》读书笔记(一:网络基础TCP/IP)
好书什么时候开始读都不晚.作为一个测试人员,是一定要掌握一些网络的基础知识的.希望能够边读书边在这里记录笔记,便于加深理解以及日后查阅. 一.TCP/IP协议族 计算机与网络设备要互相通信,双方必须基 ...
- 意外的php之学习笔记
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/gc_gongchao/article/details/37312039 什么是php? ph ...
- Win2008 IIS7.5安装配置PHP7.3.2步骤,及500错误解决
安装Visual C++运行库 根据 PHP 版本选择 VC++ 版本,缺少 VC++ 运行库会报500错误. php-7.1.28-nts-Win32-VC14-x64.zip VC14: Vi ...
- git二、基本使用
1:创建仓库 git init - 当前目录下初始化仓库,根目录产生.git文件-包含元数据文件,为其他git命令提供环境 2:克隆仓库 git clone url - 拷贝一个 Git 仓库到本 ...