You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ElasticSearchStudy/Docs/使用RestClient管理ES集群.http

73 lines
1.8 KiB
Plaintext

# 说明ES是通过提供WEBAPI的方式进行交互的。
# url参数v是显示更多(标题)对于json结果参数pretty是人类友好json(未压缩便于阅读)
# 全局变量
//ES服务管理WebApi地址
@baseUrl = https://127.0.0.1:9201
//帐号认证信息:除了用户名:密码形式外也可使用使用其它base64字符串
@accounts = elastic:es-461400
### 请求ES首页
GET {{baseUrl}}?pretty
Content-Type: application/json
Authorization: Basic {{accounts}}
### 请求ES节点信息
GET {{baseUrl}}/_cat/nodes?v
Content-Type: application/json
Authorization: Basic {{accounts}}
### ES健康信息
GET {{baseUrl}}/_cat/health?v
Content-Type: application/json
Authorization: Basic {{accounts}}
# 集群故障诊断主要有到_cat和_cluster
### 集群中的节点
GET {{baseUrl}}/_cat/nodes?v
Content-Type: application/json
Authorization: Basic {{accounts}}
### 节点属性
GET {{baseUrl}}/_cat/nodeattrs?v
Content-Type: application/json
Authorization: Basic {{accounts}}
### 健康状态
GET {{baseUrl}}/_cat/health?v
Content-Type: application/json
Authorization: Basic {{accounts}}
### 所有索引
GET {{baseUrl}}/_cat/indices?v
Content-Type: application/json
Authorization: Basic {{accounts}}
### 指定状态索引
GET {{baseUrl}}/_cat/indices?health=green&v=true
Content-Type: application/json
Authorization: Basic {{accounts}}
### 分片
GET {{baseUrl}}/_cat/shards?v
Content-Type: application/json
Authorization: Basic {{accounts}}
### 检查集群状态
GET {{baseUrl}}/_cluster/health?pretty
Content-Type: application/json
Authorization: Basic {{accounts}}
### 诊断分片:没有异常分片时会报错
GET {{baseUrl}}/_cluster/allocation/explain
Content-Type: application/json
Authorization: Basic {{accounts}}
### 搜索
GET {{baseUrl}}/_search?pretty
Content-Type: application/json
Authorization: Basic {{accounts}}