Elasticsearch常用API总结
2021-03-29 14:26
标签:change class 文档 ESS ping 常用 bsp arp last 1、查看集群设置 2、设置allocation 3、删除索引 4、查看未分配分片(unassigned shard) 5、查看索引 6、查看模板(template) 7、删除模板 8、加载模板 9、查看mapping 10、查看集群的状态 11、计算集群中文档数量 Elasticsearch常用API总结 标签:change class 文档 ESS ping 常用 bsp arp last 原文地址:https://www.cnblogs.com/sailq21/p/9298109.htmlGET /_cluster/settings
#禁止分片分配
put _cluster/settings
{
"transient":{
"cluster.routing.allocation.enable": "none"
}
}
#允许分片分配
put /_cluster/settings
{
"transient":{
"cluster.routing.allocation.enable": "all"
}
}
# kibana dev tools
delete {index_name}
eg:delete ngxrelate-2018_05_26
# curl方式
curl -XDELETE -u elastic:changeme ‘localhost:9200/nginxaccess-2017_09?pretty‘
# curl方式
curl http://10.80.17.154:9200/_cat/shards | grep -i unassigned
# kibana dev tools
GET /_cat/indices?v
# curl 方式
curl -u elastic:changeme ‘http://localhost:9200/_cat/indices?v‘
# kibana dev tools
GET /_template/nginxaccess?pretty
# curl方式
curl -u elastic:changeme ‘http://localhost:9200/_template/nginxaccess?pretty‘
# kibana dev tools
DELETE /_template/nginxaccess
# curl方式
curl -XDELETE -u elastic:changeme ‘http://localhost:9200/_template/nginxaccess‘
curl -u elastic:changeme -XPUT ‘http://localhost:9200/_template/nginxaccess‘ -d @nginxaccess.json
curl -u elastic:changeme ‘http://localhost:9200/{INDEX_NAME}/_mapping/?pretty‘
# kibana dev tools
GET /_cat/health?v&ts=false&pretty
# curl
curl -u elastic:changeme ‘http://localhost:9200/_cat/health?v&ts=false&pretty‘
curl -u elastic:changeme ‘http://10.80.17.154:9200/_count?pretty‘ -d ‘{"query": {"match_all": {}}}‘
下一篇:WPF 列表开启虚拟化的方式
文章标题:Elasticsearch常用API总结
文章链接:http://soscw.com/index.php/essay/69556.html