前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >elasticsearch查询某个索引分片信息

elasticsearch查询某个索引分片信息

作者头像
johnhuster的分享
发布2022-03-28 20:11:51
2.1K0
发布2022-03-28 20:11:51
举报
文章被收录于专栏:johnhuster

elasticsearch6.8

通过下面的路径可以查询elasticsearch某个索引分片信息

http://xx.xx.xx.xx:9200/索引名称/_search_shards

代码语言:javascript
复制
{
     "nodes": {
         "Q6i1duFYQLmJFIu812DQjQ": {
             "name": "node1",
             "ephemeral_id": "Zaxg4gF1QweERCnY63t1fA",
             "transport_address": "172.26.0.4:9300",
             "attributes": {
                 "ml.machine_memory": "5312626688",
                 "ml.max_open_jobs": "20",
                 "xpack.installed": "true",
                 "ml.enabled": "true"
             }
         },
         "eGOZucwVSqSlivu7U4M15A": {
             "name": "node2",
             "ephemeral_id": "s6BOw2weR_CWJqIB9t8nxg",
             "transport_address": "172.26.0.3:9302",
             "attributes": {
                 "ml.machine_memory": "5312626688",
                 "ml.max_open_jobs": "20",
                 "xpack.installed": "true",
                 "ml.enabled": "true"
             }
         }
     },
     "indices": {
         "elk-nginx-20191029": {}
     },
     "shards": [
         [
             {
                 "state": "STARTED",
                 "primary": true,
                 "node": "Q6i1duFYQLmJFIu812DQjQ",
                 "relocating_node": null,
                 "shard": 0,
                 "index": "elk-nginx-20191029",
                 "allocation_id": {
                     "id": "hVy0KVIbSdSC7aitI453_A"
                 }
             },
             {
                 "state": "STARTED",
                 "primary": false,
                 "node": "eGOZucwVSqSlivu7U4M15A",
                 "relocating_node": null,
                 "shard": 0,
                 "index": "elk-nginx-20191029",
                 "allocation_id": {
                     "id": "1LEnZTSMQLmLC8-FXUMW4g"
                 }
             }
         ],
         [
             {
                 "state": "STARTED",
                 "primary": true,
                 "node": "eGOZucwVSqSlivu7U4M15A",
                 "relocating_node": null,
                 "shard": 1,
                 "index": "elk-nginx-20191029",
                 "allocation_id": {
                     "id": "pieh1viPT56eXlkZ7Ki4xg"
                 }
             },
             {
                 "state": "STARTED",
                 "primary": false,
                 "node": "Q6i1duFYQLmJFIu812DQjQ",
                 "relocating_node": null,
                 "shard": 1,
                 "index": "elk-nginx-20191029",
                 "allocation_id": {
                     "id": "0jTTLcL5T0in8_IHDSl4Yw"
                 }
             }
         ],
         [
             {
                 "state": "STARTED",
                 "primary": true,
                 "node": "Q6i1duFYQLmJFIu812DQjQ",
                 "relocating_node": null,
                 "shard": 2,
                 "index": "elk-nginx-20191029",
                 "allocation_id": {
                     "id": "OpQ5KMPQQRKPN3IoGfjaaQ"
                 }
             },
             {
                 "state": "STARTED",
                 "primary": false,
                 "node": "eGOZucwVSqSlivu7U4M15A",
                 "relocating_node": null,
                 "shard": 2,
                 "index": "elk-nginx-20191029",
                 "allocation_id": {
                     "id": "qNkggEgoRsSHsli4pgeoXw"
                 }
             }
         ],
         [
             {
                 "state": "STARTED",
                 "primary": false,
                 "node": "Q6i1duFYQLmJFIu812DQjQ",
                 "relocating_node": null,
                 "shard": 3,
                 "index": "elk-nginx-20191029",
                 "allocation_id": {
                     "id": "ag9IdGs6QrO4489j4eY1Vg"
                 }
             },
             {
                 "state": "STARTED",
                 "primary": true,
                 "node": "eGOZucwVSqSlivu7U4M15A",
                 "relocating_node": null,
                 "shard": 3,
                 "index": "elk-nginx-20191029",
                 "allocation_id": {
                     "id": "wnZSVqEkSgK3AC0Y6dVwfQ"
                 }
             }
         ],
         [
             {
                 "state": "STARTED",
                 "primary": false,
                 "node": "eGOZucwVSqSlivu7U4M15A",
                 "relocating_node": null,
                 "shard": 4,
                 "index": "elk-nginx-20191029",
                 "allocation_id": {
                     "id": "nCJp71GST96W5kK-JQK6mw"
                 }
             },
             {
                 "state": "STARTED",          //分片状态
                 "primary": true,                  //是否是主分片
                 "node": "Q6i1duFYQLmJFIu812DQjQ",          //所在elasticsearch节点
                 "relocating_node": null,
                 "shard": 4,                                                //分片号
                 "index": "elk-nginx-20191029",                 //索引名字
                 "allocation_id": {
                     "id": "rjY1Y3S7So-jZMhq6YmJ3w"
                 }
             }
         ]
     ]
 }

nodes为该索引所在的所有elasticsearch实例,shards为该索引对应分片信息

PS:对应elasticsearch官网地址https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-shards.html,把6.8切换为自身使用elasticsearch版本即可。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019/10/30 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
Elasticsearch Service
腾讯云 Elasticsearch Service(ES)是云端全托管海量数据检索分析服务,拥有高性能自研内核,集成X-Pack。ES 支持通过自治索引、存算分离、集群巡检等特性轻松管理集群,也支持免运维、自动弹性、按需使用的 Serverless 模式。使用 ES 您可以高效构建信息检索、日志分析、运维监控等服务,它独特的向量检索还可助您构建基于语义、图像的AI深度应用。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档