ES常用操作备忘
格式:<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常用操作备忘的更多相关文章
- Axure常用操作备忘
目录 前言 技巧 边框重合 复制对象文本居中 复制粘贴样式 文本自适应 给图形添加连接点 导出图片无空白 前言 下面列出Axure画图过程中曾经遇到过的问题,备忘一下,避免别人也走弯路,法布施一下~ ...
- docker常用操作备忘
一.docker安装 参考资料:阿里云镜像加速1. 安装/升级Docker客户端 curl -fsSL https://get.docker.com | bash -s docker --mirror ...
- Kafka常用操作备忘
启动nohup ./bin/zookeeper-server-start.sh config/zookeeper.properties &nohup ./bin/kafka-server-st ...
- metasploit 常用命令备忘
metasploit 常用命令备忘 MSFconsole Commands-------------------------------------24show exploits 查看所有exp ...
- Linux基础之常用基本命令备忘
Linux基础之常用基本命令备忘 PWD 查询当前所在Linux上的位置 / 根目录 CD(change directory)切换目录 语法 CD /(注意添加空格) LS ...
- Webstorm常用快捷键备忘(Webstorm入门指南)
WebStorm 是jetbrains公司旗下一款JavaScript 开发工具.被广大中国JS开发者誉为“Web前端开发神器”.“最强大的HTML5编辑器”.“最智能的JavaSscript IDE ...
- sublime 常用快捷键备忘
转一篇sublime常用的快捷键备忘 sublime常用快捷键 选择类Ctrl+D 选中光标所占的文本,继续操作则会选中下一个相同的文本.Alt+F3 选中文本按下快捷键,即可一次性选择全部的相同文本 ...
- Webstorm常用快捷键备忘
WebStorm 是jetbrains公司旗下一款JavaScript 开发工具.被广大中国JS开发者誉为“Web前端开发神器”.“最强大的HTML5编辑器”.“最智能的JavaSscript IDE ...
- CentOS常用命令备忘
1. 查看进程 ps -a 杀掉进程 kill PID 2. 添加计划任务crontab -e 例如:30 21 * * * service httpd restart 每天21:30重启apache ...
随机推荐
- Flask关于request一些方法和属性的整理(持续更新)
前提:基于纯后端服务, post 请求 (Content-Type: application/json,) 1.获取未经处理过的原始数据而不管内容类型,如果数据格式是json的,则取得的是json字符 ...
- 看完您如果还不明白 Kerberos 原理,算我输!
系统环境 操作系统:CentOS 6 或 CentOS 7 JDK 版本:1.8.0_151 Ambari 版本:2.6.1 HDP 版本:2.6.4.0 扩展链接 Kerberos原理--经典对话 ...
- Python学习笔记整理总结【Django】:Model操作(一)
Model操作(一) 一.Django ORM基本配置 ORM:关系对象映射(Object Relational Mapping,简称ORM)db Frist:到目前为止,当我们的程序涉及到数据库相关 ...
- Spring boot 梳理 - 在bean中使用命令行参数-自动装配ApplicationArguments
If you need to access the application arguments that were passed to SpringApplication.run(…), you c ...
- layui table 行按钮事件,启用禁用切换
{{# ){ }} <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="forbidden& ...
- springboot 2.1.3.RELEASE版本解析.properties文件配置
1.有时为了管理一些特定的配置文件,会考虑单独放在一个配置文件中,如redis.properties: #Matser的ip地址 redis.host=192.168.5.234 #端口号 redis ...
- Hyper-V安装CentOS 8问题
CentOS 8 已经发布很长时间了,作为一直折腾Linux虚拟机的一员怎么少的了我. 环境&准备工作 系统:Win 10 pro 19H1 虚拟机:Hyper-V ISO:CentOS 8 ...
- 从零开始搭建WebAPI Core_SqlSugar管理系统 (持续更新中......)
从零开始搭建WebAPI Core_SqlSugar管理系统 前言 本系列皆在从零开始逐步搭建,后台管理系统服务端部分,后续还会推出前端部分. 这次的目的是搭出一个功能完善的 本次系列技术栈以下几个部 ...
- Zookeeper 学习笔记之 节点个数
zookeeper的节点配置的个数推荐是奇数个这是为什么呢? 选举机制 两种情况无法选出leader: 整个集群只有2台服务器(注意不是只剩2台,而是集群的总节点数为2) 整个集群超过半数机器挂掉. ...
- Mongoose: aggregate聚合 $group使用说明
aggregate聚合是通过管道操作实现的.聚合管道里的每一步输出,都会作为下一步的输入,每一步在输入文档执行完操作后生成输出文档. 聚合管道: $project 修改输入文档的结构.可以用来重命名 ...