elasticsearch命令curl(学习笔记)
2017-02-17 16:41
316 查看
好记性不如烂笔头,这年头少了笔多了互联网。是个好东西。
先知道一些elasticsearch的命令是干嘛的,才能写代码吧。呵呵
curl -XGET 'localhost:9200/_cat/indices?v&pretty' #查看索引
health status index pri rep docs.count docs.deleted store.size pri.store.size
green open xxx_xxx_2017-02-10 5 1 0 0 1.5kb 795b
green open xxx_xxx_2017-02-17 5 1 10 0 119kb 59.5kb
green open xxx_xxx_2017-02-14 5 1 0 0 1.5kb 795b
curl -XGET 'localhost:9200/_cat/nodes?v&pretty' #查看节点状态
host ip heap.percent ram.percent load node.role master name
192.168.151.190 192.168.151.190 10 83 -1.00 d m node-2
192.168.151.190 192.168.151.190 9 83 -1.00 d * node-1
192.168.151.190 192.168.151.190 20 83 -1.00 d m node-3
curl -XGET http://localhost:9200/_cluster/health?pretty #查看集群状态
{
"cluster_name" : "elasticsearch",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 3,
"number_of_data_nodes" : 3,
"active_primary_shards" : 60,
"active_shards" : 120,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 100.0
}
curl -XGET http://localhost:9200/_all #查看所有索引信息
curl -XDELETE 'http://localhost:9200/twitter,fgfg,ghjg/' #删除一个或多个索引 中间用,隔开 _all表示删除所有,并支持通配符*
curl -XGET
'http://localhost:9200/twitter/_settings,_mappings' #支持参数 The available features are
JavaScriptAPI 调用
client.indices.get({index:'_all',feature:'_mappings'},function (error,response) {
//console.log("gel_allindex:"+ JSON.stringify(response));
});
先知道一些elasticsearch的命令是干嘛的,才能写代码吧。呵呵
curl -XGET 'localhost:9200/_cat/indices?v&pretty' #查看索引
health status index pri rep docs.count docs.deleted store.size pri.store.size
green open xxx_xxx_2017-02-10 5 1 0 0 1.5kb 795b
green open xxx_xxx_2017-02-17 5 1 10 0 119kb 59.5kb
green open xxx_xxx_2017-02-14 5 1 0 0 1.5kb 795b
curl -XGET 'localhost:9200/_cat/nodes?v&pretty' #查看节点状态
host ip heap.percent ram.percent load node.role master name
192.168.151.190 192.168.151.190 10 83 -1.00 d m node-2
192.168.151.190 192.168.151.190 9 83 -1.00 d * node-1
192.168.151.190 192.168.151.190 20 83 -1.00 d m node-3
curl -XGET http://localhost:9200/_cluster/health?pretty #查看集群状态
{
"cluster_name" : "elasticsearch",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 3,
"number_of_data_nodes" : 3,
"active_primary_shards" : 60,
"active_shards" : 120,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 100.0
}
curl -XGET http://localhost:9200/_all #查看所有索引信息
{"xxx_xxx_2017-02-17":{"aliases":{},"mappings":{"xxx":{"properties":{"Content":{"type":"string"},"ErrorType":{"type":"string"},"OrderID":{"type":"string"},"RequestType":{"type":"string"},"SessionID":{"type":"string"},"TimeStamp":{"type":"string"},"Type":{"type":"string"}}},"CarQuery":{"properties":{"Content":{"type":"string"},"RequestType":{"type":"string"},"SessionID":{"type":"string"},"TimeStamp":{"type":"string"}}}},"settings":{"index":{"creation_date":"1487297244079","uuid":"RIUMHuf5QROGUWOvxzVCkw","number_of_replicas":"1","number_of_shards":"5","version":{"created":"2030499"}}},"warmers":{}}}
curl -XDELETE 'http://localhost:9200/twitter,fgfg,ghjg/' #删除一个或多个索引 中间用,隔开 _all表示删除所有,并支持通配符*
curl -XGET
'http://localhost:9200/twitter/_settings,_mappings' #支持参数 The available features are
_settings,
_mappings,
_warmersand
_aliases.
JavaScriptAPI 调用
client.indices.get({index:'_all',feature:'_mappings'},function (error,response) {
//console.log("gel_allindex:"+ JSON.stringify(response));
});
相关文章推荐
- 【shell学习笔记】curl命令总结
- linux命令之curl学习笔记
- 学习笔记之 curl 命令用法详解
- 学习用Node.js和Elasticsearch构建搜索引擎(3):使用curl命令操作elasticsearch
- 用curl命令操作Elasticsearch命令笔记
- 学习笔记之 curl 命令用法详解
- [Shell学习笔记] 命令行下的高级网络工具cURL命令
- linux命令学习笔记(62)-curl命令-url下载工具
- 【shell学习笔记】curl命令总结
- 写得蛮好的linux学习笔记三-压缩命令(收藏)
- 《Head.First设计模式》的学习笔记(7)--命令模式
- Linux学习笔记13--使用mount命令挂载CDROM
- FreeBSD学习笔记01-基本命令
- 写得蛮好的linux学习笔记 [转] 二基本命令
- oracle9i学习笔记,常用的命令!
- fvwm学习笔记之命令扩展 by stack
- Linux学习笔记5--Top命令
- 设计模式学习笔记(十七)——Command命令模式
- latex学习笔记之常用命令
- 写得蛮好的linux学习笔记(压缩命令,vi一般用法,认识SHELL,正规表示法)