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 ...
随机推荐
- Mybatis源码解析,一步一步从浅入深(三):实例化xml配置解析器(XMLConfigBuilder)
在上一篇文章:Mybatis源码解析,一步一步从浅入深(二):按步骤解析源码 ,中我们看到 代码:XMLConfigBuilder parser = new XMLConfigBuilder(read ...
- scrapy框架来爬取壁纸网站并将图片下载到本地文件中
首先需要确定要爬取的内容,所以第一步就应该是要确定要爬的字段: 首先去items中确定要爬的内容 class MeizhuoItem(scrapy.Item): # define the fields ...
- java自学小段 产生随机数
public class Suijishu { public static void main(String[] args) { double i=Math.random();//产生一个0-0.5的 ...
- MapReduce之Job提交流程源码和切片源码分析
hadoop2.7.2 MapReduce Job提交源码及切片源码分析 首先从waitForCompletion函数进入 boolean result = job.waitForCompletion ...
- Spring boot 梳理 - SpringBoot中注入ApplicationContext对象的三种方式
直接注入(Autowired) @Configuration public class OAConfig { @Autowired private ApplicationContext applica ...
- SD-WAN 配置及应用模板**(二)
目录 0. 前言 1. 配置模板 1.1 创建各类 'Feature' 模板: 1.1.1 添加波特率模板 1.1.2 添加 'VPN0' 模板 1.1.3 添加 'VPN10' 模板 1.1.4 添 ...
- 【SQL server基础】object_id()函数
在SQLServer数据库中,如果查询数据库中是否存在指定名称的索引或者外键约束等,经常会用到object_id('name','type')方法,做笔记如下: ? 语法:object_id('obj ...
- Spring只定义接口自动代理接口实现类
能够扫描到包 @ComponentScan("org.zxp.esclientrhl") ESCRegistrar类主要实现ImportBeanDefinitionRegistra ...
- 体验Code::Blocks下的Windows GUI编程(32 bit and 64 bit)
0. 前言 不知道为什么,几乎所有的C++编程教程都是从命令行版(控制台应用程序)的Hello World开始的.然而,对于现在的年轻人来说,从小就用鼠标点击窗口或图标操作电脑,对于那个神秘黑色的窗口 ...
- 开发电商平台用PHP语言和JAVA语言有什么区别?哪种语言更好?
现在很多行业都通过电子商务拓展业务,所以商城系统开发成为很多企业的刚性需求.一般有一点技术基础的客户应该知道目前商城系统开发主流语言有两个,PHP和Java.那么很多客户朋友会纠结是选择哪个语言开发好 ...