elasticsearch常用命令
curl -X<REST Verb> <Node>:<Port>/<Index>/<Type>/<ID>
1、启动
[es@vm1 bin]$ ./elasticsearch --cluster.name myes --node.name node1
- [es@vm1 ~]$ curl http://vm1:9200/_cat/health?v
- epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks
- 1432704777 22:32:57 myes green
[es@vm1 ~]$ curl http://vm1:9200/_cat/nodes?vhost ip heap.percent ram.percent load node.role master namevm1 192.168.1.111 3 24 0.04 d * node1
[es@vm1 ~]$ curl http://vm1:9200/_cat/indices?vhealth status index pri rep docs.count docs.deleted store.size pri.store.size
[es@vm1 ~]$ curl -XPUT http://vm1:9200/customer?pretty{"acknowledged" : true}
[es@vm1 ~]$ curl -XPUT vm1:9200/customer/external/1?pretty -d '{"name":"lisg"}'{"_index" : "customer","_type" : "external","_id" : "1","_version" : 4,"created" : true}
[es@vm1 ~]$ curl -XGET vm1:9200/customer/external/1?pretty{"_index" : "customer","_type" : "external","_id" : "1","_version" : 4,"found" : true,"_source":{"name":"lisg"}}
[es@vm1 ~]$ curl -XDELETE vm1:9200/customer/external/1?pretty{"found" : true,"_index" : "customer","_type" : "external","_id" : "1","_version" : 5}
[es@vm1 ~]$ curl -XDELETE vm1:9200/customer/external?pretty{"acknowledged" : true}
[es@vm1 ~]$ curl -XDELETE vm1:9200/customer?pretty{"acknowledged" : true}
[es@vm1 ~]$ curl -XPOST vm1:9200/customer/external?pretty -d '{"name":"zhangsan"}'{"_index" : "customer","_type" : "external","_id" : "AU2UAazzBzlrcKeIwh7T","_version" : 1,"created" : true}
[es@vm1 ~]$ curl -XPOST vm1:9200/customer/external/_bulk?pretty -d '> {index:{_id:3}}> {name:"zhangsan", age:28}> {index:{_id:4}}> {name:"lisi", age:29}> {update:{_id:4}}> {doc:{name:"lisi2", age:30}}> {delete:{_id:"AU2UAazzBzlrcKeIwh7T"}}> '{"took" : 34,"errors" : false,"items" : [ {"index" : {"_index" : "customer","_type" : "external","_id" : "3","_version" : 1,"status" : 201}}, {"index" : {"_index" : "customer","_type" : "external","_id" : "4","_version" : 1,"status" : 201}}, {"update" : {"_index" : "customer","_type" : "external","_id" : "4","_version" : 2,"status" : 200}}, {"delete" : {"_index" : "customer","_type" : "external","_id" : "AU2UAazzBzlrcKeIwh7T","_version" : 2,"status" : 200,"found" : true}} ]}
[es@vm1 ~]$ curl -XPOST http://vm1:9200/customer/external/_bulk?pretty --data-binary @accounts.json[es@vm1 ~]$ curl -XGET vm1:9200/_cat/indices?vhealth status index pri rep docs.count docs.deleted store.size pri.store.sizeyellow open customer 5 1 1000 0 442.3kb 442.3kb
附件列表
elasticsearch常用命令的更多相关文章
- elasticsearch 常用命令
#查看集群状态 curl -XGET "http://localhost:9200/_cluster/health?pretty" #查看所有的快照 curl -XGET &quo ...
- 实战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 ...
随机推荐
- Python 爬虫利器 Selenium
前面几节,我们学习了用 requests 构造页面请求来爬取静态网页中的信息以及通过 requests 构造 Ajax 请求直接获取返回的 JSON 信息. 还记得前几节,我们在构造请求时会给请求加上 ...
- proxy_pass根据path路径转发时的"/"问题记录
在nginx中配置proxy_pass时,如果是按照^~匹配路径时,要注意proxy_pass后的url最后的/.当加上了/,相当于是绝对根路径,则nginx不会把location中匹配的路径部分代理 ...
- [Swift]LeetCode763. 划分字母区间 | Partition Labels
A string S of lowercase letters is given. We want to partition this string into as many parts as pos ...
- 初始Oracle
1.Oracle简介 Oracle体系结构: 先是用户进程发起一个请求到服务器进程(PGA , 一个PGA对应一个请求),然后PGA在发送给SGA.SGA有三大块分别是:共享池,数据缓冲区,日志缓 ...
- Python爬虫入门教程 26-100 知乎文章图片爬取器之二
1. 知乎文章图片爬取器之二博客背景 昨天写了知乎文章图片爬取器的一部分代码,针对知乎问题的答案json进行了数据抓取,博客中出现了部分写死的内容,今天把那部分信息调整完毕,并且将图片下载完善到代码中 ...
- 使用Genymotion遇到的坑_Genymotion无法启动_unable to start the virtual device
Genymotion 十分好用,以下是我使用Genymotion碰到的问题及解决办法.目前没有看到网上有完整的解决. 遇到如下图的问题: 这个问题很多人可能回去百度“the virtual devic ...
- IntelliJ IDEA 导入新项目
在现有的idea中close project 关闭当前项目, 然后import project
- [Python Web]部署完网站需要做的基本后续工作
简述 今天自己上线了一个简单的 Page,没有什么功能就是一个展示页. 但是,我发现部署完,上线后,还要弄不少东西.下面就是我记录.整理的一些上线网站基本都会用到的网站和配置. 加入统计代码 这个是必 ...
- 线程安全(上)--彻底搞懂volatile关键字
对于volatile这个关键字,相信很多朋友都听说过,甚至使用过,这个关键字虽然字面上理解起来比较简单,但是要用好起来却不是一件容易的事.这篇文章将从多个方面来讲解volatile,让你对它更加理解. ...
- 在SpringBoot中引入Redis
前言 之前我们只是在Spring中加入Redis用于session的存放,并没有对redis进行主动的存放,这次我们需要加入redis工具类来方便我们在实际使用过程中操作redis 已经加入我的git ...