elasticsearch学习心得
来源:互联网 发布:linux tweak yool 编辑:程序博客网 时间:2024/06/11 15:11
elasticsearch索引的增删改查有一个类似的格式,总结如下:
curl -X<REST Verb> <Node>:<Port>/<Index>/<Type>/<ID>/<operation> //其中operation可为:_update、_search
<REST Verb>:REST风格的语法谓词
<Node>:节点ip
<port>:节点端口号,默认9200
<Index>:索引名
<Type>:索引类型
<ID>:操作对象的ID号
//REST Verb 可为DELETE、POST、PUT
//查询特定区域内的数据
curl -XPOST '192.168.211.50:9200/users/_search?pretty' -d '{"query": { "match_all": {} },"from":10,"size": 10}'
//查询特定区域内且降序排列的数据
curl -XPOST '192.168.211.50:9200/users/_search?pretty' -d '{"query": { "match_all": {} },"from":10,"size": 10,"sort": { "age": { "order": "desc" } }}'
//查询匹配字段
curl -XPOST '192.168.211.50:9200/users/_search?pretty' -d '{"query": { "match": {"age":80} }}'
//删除索引
curl -XDELETE '192.168.211.50:9200/users?pretty'
//查看索引
curl '192.168.211.50:9200/_cat/indices?v'
//创建索引
curl -XPUT '192.168.211.50:9200/users?pretty'
//查看节点列表
curl '192.168.211.50:9200/_cat/nodes?v'
//查看集群是否健康
加上如下三句:
network.host: 192.168.20.50
http.port: 9200
bootstrap.system_call_filter: false # 针对 system call filters failed to install
复制代码
> vim /etc/security/limits.conf
文件最后加上如下两句:siem是仅次于root权限的用户
siem hard nofile 65536 # 针对 max file descriptors
siem soft nproc 2048 # 针对 max number of threads
> vim /etc/sysctl.conf
vm.max_map_count=262144
curl -X<REST Verb> <Node>:<Port>/<Index>/<Type>/<ID>/<operation> //其中operation可为:_update、_search
<REST Verb>:REST风格的语法谓词
<Node>:节点ip
<port>:节点端口号,默认9200
<Index>:索引名
<Type>:索引类型
<ID>:操作对象的ID号
//REST Verb 可为DELETE、POST、PUT
//查询特定区域内的数据
curl -XPOST '192.168.211.50:9200/users/_search?pretty' -d '{"query": { "match_all": {} },"from":10,"size": 10}'
//查询特定区域内且降序排列的数据
curl -XPOST '192.168.211.50:9200/users/_search?pretty' -d '{"query": { "match_all": {} },"from":10,"size": 10,"sort": { "age": { "order": "desc" } }}'
//查询匹配字段
curl -XPOST '192.168.211.50:9200/users/_search?pretty' -d '{"query": { "match": {"age":80} }}'
//删除索引
curl -XDELETE '192.168.211.50:9200/users?pretty'
//查看索引
curl '192.168.211.50:9200/_cat/indices?v'
//创建索引
curl -XPUT '192.168.211.50:9200/users?pretty'
//查看节点列表
curl '192.168.211.50:9200/_cat/nodes?v'
//查看集群是否健康
curl '192.168.211.50:9200/_cat/health?v'
安装Elasticsearch注意的地方:
> vim /etc/elasticsearch/elasticsearch.yml
加上如下三句:
network.host: 192.168.20.50
http.port: 9200
bootstrap.system_call_filter: false # 针对 system call filters failed to install
复制代码
> vim /etc/security/limits.conf
文件最后加上如下两句:siem是仅次于root权限的用户
siem hard nofile 65536 # 针对 max file descriptors
siem soft nproc 2048 # 针对 max number of threads
> vim /etc/sysctl.conf
vm.max_map_count=262144
阅读全文
0 0
- elasticsearch学习心得
- elasticsearch系列-elasticsearch学习心得
- 学习心得
- 学习心得
- 学习心得
- 学习心得
- 学习心得
- 学习心得
- 学习心得
- 学习心得
- 学习心得
- 学习心得
- 学习心得
- 学习心得
- 学习心得
- 学习心得
- 学习心得
- 学习心得
- 纯java获取CPU序列号,生成机器码
- [bzoj3781]小B的询问 智障莫队
- linux centos 安装PHP Web环境详细步骤及常见问题解决
- Android 动态设置RadioButton选中和没选中的颜色及设置默认选中某一项
- Oracle中Merge into用法总结
- elasticsearch学习心得
- VS2012的安装项目只能用InstallShield Limited Edition activex控件的问题
- git学习教程
- 【STM32F0】Keil 查看局部变量显示<not in scope>
- [java基础]InputStream,InputStreamReader,BufferedReader
- 前后端正常交互的流程
- CVPR2016论文以及代码
- jsp加载不同的页面
- 验证输入的邮件地址是否合法