zl程序教程

您现在的位置是:首页 >  工具

当前栏目

ES集群状态、节点、索引等查看及根据字段、排序查询

2023-09-27 14:26:27 时间

ES集群基础:

1. 查看集群:

http://172.xxx.xxx.8:9200

2. 查看状态:

http://172.xxx.xxx.8:9200/_cat/health?v

3. 查看索引:

http://172.xxx.xxx.8:9200/_cat/indices?v

4. 查看节点:

http://172.xxx.xxx.8:9200/_cat/nodes?v

5. 查看磁盘空间:

http://172.xxx.xxx.8:9200/_cat/allocation?v

6. 查看节点的分配情况:

http://172.xxx.xxx.8:9200/_cat/shards

7. 找到某个节点id:

http://172.xxx.xxx.8:9200/_nodes/process

8. 查看索引结构:

http://172.xxx.xxx.8:9200/idx_tile

9. 查询索引数据:

http://172.xxx.xxx.8:9200/idx_point/_search

10. 查询所有数据,根据某个字段降序排序 post查询,body的参数如下

http://172.xxx.xxx.8:9200/idx_point/_search
{
  "query": {
    "match_all": {}
  },
  "sort": [
    {
      "seq": {
        "order": "desc"
      }
    }
  ]
}

11. 根据某个字段查询

http://172.xxx.xxx.8:9200/idx_point/_search
{
	"query":{
		"match_phrase":{
			"pid":"H2019001"
		}
	}
}

12. 根据某个字段查询结果,删除

http://172.xxx.xxx.8:9200/idx_point/_delete_by_query
{
	"query":{
		"match_phrase":{
			"pid":"H201900001"
		}
	}
}

13. 根据某个字段查询并只返回某一个字段

http://172.xxx.xxx.8:9200/idx_point/_search
{
    "query":{
        "match":{
           "pid":"1111124345511"
        }
    },
    "_source":"timestamp"
}

14. 修改settings某个字段

在kibana console中先查询,在更新

GET idx_cx_test/_settings
{
    "query":{
        "match_all":{}
    }
}
PUT idx_cx_test/_settings
{
   "max_result_window": 100000
}

15. Kibana console查询集群状态、节点、索引等

GET _cat/health?v
{
    "query":{
        "match_all":{}
    }
}
GET _cat/nodes?v
{
    "query":{
        "match_all":{}
    }
}
GET _cat/indices?v
{
    "query":{
        "match_all":{}
    }
}

16. Kibana console导出为curl请求

在这里插入图片描述