ES常用内置index

ES常用内置index


前言

个人总结了一些ES里面常用的index可以帮我们监控ES服务器状态,管理ES索引等,持续更新…


一、健康相关

索引备注
_cat/nodes查看服务器节点状态
_cat/indices查看索引状态
_cat/health查看集群状态
/?pretty查看单节点信息
_cluster/health (?level=indices)查看集群状态,添加level=indices可查看集群中索引状态
_cluster/allocation/explain当集群为red时,可查看分片未分配的原因

二、索引操作相关

以test索引为例,mappings和settings为

{
  "settings": {
    // "refresh_interval": "-1" --禁止刷新会导致插入数据无法洛盘被查询到
    "analysis" : {
      "analyzer" : {
        "ik" : {
          "tokenizer" : "ik_max_word"
        }
      }
    },
    "number_of_shards" : 3,
    "number_of_replicas" : 2
  },
  "mappings": {
    "properties": {
      "title": {
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "status": {
        "type": "short"
      },
      "updateTime": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
      },
      "modifiedTimeDay": {
        "type": "keyword"
      }
    }
  }
}'
索引备注
/test创建索引 curl -L -X PUT ‘http://localhost:9200/test’
/test删除索引 curl -L -X DELETE ‘http://localhost:9200/test’
test/_doc/1查看索引状态 curl -L -X POST ‘http://localhost:9200/test/_doc/1’
test/_doc/_search索引数据查询 curl -L -X POST ‘http://localhost:9210/information/_doc/_search’
/_aliases此索引用于对别名的操作
/test/_alias查看索引test的别名
test/_mappings查看索引test的mappings
test/_settings查看索引test的settings
_cat/aliases/test查看别名test对应的真实索引
/_analyze查看分词器的分词结果
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值