格式:<REST Verb>/<Index>/<Type>/<ID>

集群健康:
curl -u lases:1fw@2soc#3vpn -XGET 'localhost:9200/_cat/health?v&pretty'

节点:
curl -u lases:1fw@2soc#3vpn -XGET 'localhost:9200/_cat/nodes?v&pretty'
查看索引:
curl -u lases:1fw@2soc#3vpn -XGET 'localhost:9200/_cat/indices?v&pretty'
创建:
curl -u lases:1fw@2soc#3vpn -XPUT 'localhost:9200/customer?pretty&pretty'
搜索:
curl -u lases:1fw@2soc#3vpn -XGET 'localhost:9200/index/report/1?pretty&pretty'
删除:
curl -u lases:1fw@2soc#3vpn -XDELETE 'localhost:9200/customer?pretty&pretty'

节点磁盘使用:
curl -u lases:1fw@2soc#3vpn -XGET 'localhost:9200/_cat/allocation?v'
插件:
curl -u lases:1fw@2soc#3vpn -XGET 'localhost:9200/_cat/plugins?v&s=component&h=name,component,version,description'

bulk api:
插入:curl -XPOST 'localhost:9200/customer/external/_bulk?pretty&pretty' -d'
{"index":{"_id":"1"}}
{"name": "John Doe" }
{"index":{"_id":"2"}}
{"name": "Jane Doe" }
更新+删除:curl -XPOST 'localhost:9200/customer/external/_bulk?pretty&pretty' -d'
{"update":{"_id":"1"}}
{"doc": { "name": "John Doe becomes Jane Doe" } }
{"delete":{"_id":"2"}}

导入:
curl -XPOST 'localhost:9200/bank/account/_bulk?pretty&refresh' --data-binary "@accounts.json"

搜索:
curl -XGET 'localhost:9200/bank/_search?pretty' -d'
{
"query": { "match_all": {} },
"sort": [
{ "account_number": "asc" }
],
"from": 10,
"size": 1
"_source": ["account_number", "balance"]
}'

bool查询:
{
"query": {
"bool": {
"must": [ //should,must_not
{ "match": { "address": "mill" } },
{ "match": { "address": "lane" } }
],
"filter": {
"range": {
"balance": {
"gte": 20000,
"lte": 30000
}
}
}
}
}
}

聚合:
{
"size": 0,
"aggs": {
"group_by_state": {
"terms": {
"field": "state.keyword"
}
}
}
}

跨集群搜索:
curl -X POST "localhost:9200/cluster_one:skyeye-las_event-2018.09.11/sim/_search?pretty" -H 'Content-Type: application/json' -d'
{
"query": {
"match_all": {}
}
}

跨集群参数配置:

curl -k -u lases:1fw@2soc#3vpn -XPUT "https://localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d'
{
"persistent": {
"search": {
"remote": {
"cluster_one": {
"seeds": [
"10.95.36.30:9300"
]
}
}
}
}
}'

插件安装:

sh elasticsearch-plugin install -b file:///home/es/search-guard-5-5.6.10-19.2.zip

sgadmin.sh -cn es -h 127.0.0.1 -cd /home/es/root/plugins/search-guard-5/sgconfig -ks /home/es/root/plugins/search-guard-5/sgconfig/es-keystore.jks -kspass 1fw@2soc#3vpn -ts /home/es/root/plugins/search-guard-5/sgconfig/truststore.jks -tspass 1fw@2soc#3vpn -nhnv

sh sgadmin.sh -cn es -h 127.0.0.1 --accept-red-cluster -cd /home/es/root/plugins/search-guard-5/sgconfig -ks /home/es/root/plugins/search-guard-5/sgconfig/es-keystore.jks -kspass 1fw@2soc#3vpn -ts /home/es/root/plugins/search-guard-5/sgconfig/truststore.jks -tspass 1fw@2soc#3vpn -nhnv

ES常用操作备忘的更多相关文章

  1. Axure常用操作备忘

    目录 前言 技巧 边框重合 复制对象文本居中 复制粘贴样式 文本自适应 给图形添加连接点 导出图片无空白 前言 下面列出Axure画图过程中曾经遇到过的问题,备忘一下,避免别人也走弯路,法布施一下~ ...

  2. docker常用操作备忘

    一.docker安装 参考资料:阿里云镜像加速1. 安装/升级Docker客户端 curl -fsSL https://get.docker.com | bash -s docker --mirror ...

  3. Kafka常用操作备忘

    启动nohup ./bin/zookeeper-server-start.sh config/zookeeper.properties &nohup ./bin/kafka-server-st ...

  4. metasploit 常用命令备忘

    metasploit 常用命令备忘    MSFconsole Commands-------------------------------------24show exploits 查看所有exp ...

  5. Linux基础之常用基本命令备忘

    Linux基础之常用基本命令备忘 PWD   查询当前所在Linux上的位置 /         根目录 CD(change directory)切换目录  语法 CD /(注意添加空格)   LS ...

  6. Webstorm常用快捷键备忘(Webstorm入门指南)

    WebStorm 是jetbrains公司旗下一款JavaScript 开发工具.被广大中国JS开发者誉为“Web前端开发神器”.“最强大的HTML5编辑器”.“最智能的JavaSscript IDE ...

  7. sublime 常用快捷键备忘

    转一篇sublime常用的快捷键备忘 sublime常用快捷键 选择类Ctrl+D 选中光标所占的文本,继续操作则会选中下一个相同的文本.Alt+F3 选中文本按下快捷键,即可一次性选择全部的相同文本 ...

  8. Webstorm常用快捷键备忘

    WebStorm 是jetbrains公司旗下一款JavaScript 开发工具.被广大中国JS开发者誉为“Web前端开发神器”.“最强大的HTML5编辑器”.“最智能的JavaSscript IDE ...

  9. CentOS常用命令备忘

    1. 查看进程 ps -a 杀掉进程 kill PID 2. 添加计划任务crontab -e 例如:30 21 * * * service httpd restart 每天21:30重启apache ...

随机推荐

  1. 微服务SpringCloud之注册中心Consul

    Consul 介绍 Consul 是 HashiCorp 公司推出的开源工具,用于实现分布式系统的服务发现与配置.与其它分布式服务注册与发现的方案,Consul 的方案更“一站式”,内置了服务注册与发 ...

  2. 暑期——第三周总结(Ubuntu系统安装eclipse问题【已解决】)

    所花时间:7天 代码行:200(python)+150(java) 博客量:1篇 了解到知识点 : 一: Python: 问题 unresolved reference xrange 解决方案 pyt ...

  3. Spring MVC-从零开始-文件上传(未完待续)

    Spring MVC-从零开始-文件上传(未完待续)

  4. 移动端获取短信验证码java实现——阿里云短信服务

    需求:移动端输入手机号,获取验证码.点击登录,验证验证码是否输入错误.是否超时等情况,一旦校验通过,将用户数据保存到数据中(业务逻辑). 前提:注册阿里用户,开通短信服务,申请key.秘钥.签名.短信 ...

  5. JS实现数组排序的方法

    前言 排序是计算机内经常进行的一种操作,其目的是将一组“无序”的记录序列调整为“有序”的记录序列,当然排序也是算法中的一种,javascript内置的sort函数是多种排序算法的集合,数组在原数组上进 ...

  6. 07-简单认识margin

    margin 外边距,表示边框到最近盒子的距离. 对于左右两边 <!DOCTYPE html> <html lang="en"> <head> ...

  7. php基础——语法、变量

    一.php语法: 1.php语言需要写在<?php  ?>标签里面 2.php语言每行结束需要使用:作为结束符 3.php是一门弱语言,不要求先声明变量 4.可嵌套在HTML和js语言中 ...

  8. Kafka 学习笔记之 High Level Consumer相关参数

    High Level Consumer相关参数 自动管理offset auto.commit.enable = true auto.commit.interval.ms = 60*1000 手动管理o ...

  9. .netcore 开发的 iNeuOS 物联网平台部署在 Ubuntu 操作系统,无缝跨平台。助力《2019 中国.NET 开发者峰会》。

    2019 中国.NET 开发者峰会正式启动 目       录 1.      概述... 2 2.      准备运行程序包... 2 3.      安装.netcore. 3 4.      安 ...

  10. C++set 和 multiset的使用

    最后一个自由支配的暑假,学一些自己感兴趣的部分,也算为大三作准备. C++中set集合的使用 定义一个int类型的集合 set<int> s: set<int>::iterat ...