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 ...
随机推荐
- SDL 开发实战(四): SDL 事件处理
在前面学习SDL的例子运行时,我们发现我们的窗口只停留了几秒,但是如果设置更长时间显然也有其他的弊端. 那么有没有一种好的办法可以解决这个问题呢?例如:能不能让窗口一直显示,直到检测到用户用鼠标点击关 ...
- Python爬虫7-Cookie & Session
GitHub代码练习地址:1.手动利用cookie访问网页:https://github.com/Neo-ML/PythonPractice/blob/master/SpiderPrac10_cook ...
- [Swift]LeetCode836. 矩形重叠 | Rectangle Overlap
A rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) are the coordinates of its bot ...
- [Swift]LeetCode1029. 两地调度 | Two City Scheduling
There are 2N people a company is planning to interview. The cost of flying the i-th person to city A ...
- 学习HTML5 canvas遇到的问题
学习HTML5 canvas遇到的问题 1. 非零环绕原则(nonzZero rule) 非零环绕原则是canvas在进行填充的时候是否要进行填充的判断依据. 在判断填充的区域拉一条线出来,拉到图形的 ...
- scala读取解析json文件
import scala.util.parsing.json.JSON._ import scala.io.Source object ScalaJsonParse { def main(args: ...
- Entitiy Framework Core中使用ChangeTracker持久化实体修改历史
背景介绍 在我们的日常开发中,有时候需要记录数据库表中值的变化, 这时候我们通常会使用触发器或者使用关系型数据库中临时表(Temporal Table)或数据变更捕获(Change Data Capt ...
- asp.net core 系列 8 Razor框架路由(下)
三.页面路由操作约定 接着上篇讲asp.net core 系列 7 Razor框架路由.在上篇继续第三节 "页面路由操作约定" 的最后一小节 AddPageRoute . 3.3. ...
- es6学习笔记--模板字符串
这几天简单看了一下深入浅出es6这本书,感觉特实用,学习了一个新特性---模板字符串在项目开发中,拼接字符串是不可缺少的,动态创建dom元素以及js操作数据都要拼接字符串,在es6出来之前,我们都通常 ...
- Unity实现c#热更新方案探究(一)
转载请标明出处:http://www.cnblogs.com/zblade/ 最近研究了一下如何在unity中实现c#的热更新,对于整个DLL热更新的过程和方案有一个初步的了解,这儿就写下来,便于后续 ...