🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 索引分片存储 提供索引的副本分片的存储信息。存储信息包括了:哪些节点存储分片副本,分片副本分配的ID,每个分片的唯一标识符以及打开分片索引时甚至更早期的引擎异常。 默认情况下,只有至少一个未分配的副本分片的列表存储信息。当集群健康状态为`yellow`时,将列出具有至少一个未分配副本分片的存储信息。当集群健康状态为`red`时,将列出具有未分配主分片的存储信息。 端点包括特定索引,多个索引或全部分片的存储信息: | `curl -XGET ``'[http://localhost:9200/test/_shard_stores'](http://localhost:9200/test/_shard_stores')` `curl -XGET ``'[http://localhost:9200/test1,test2/_shard_stores'](http://localhost:9200/test1,test2/_shard_stores')` `curl -XGET ``'[http://localhost:9200/_shard_stores'](http://localhost:9200/_shard_stores')` | 列出存储信息的分片范围可以通过`status`参数变更。默认为`yellow`和`red`。`yellow`列出至少一个未分配副本分片的信息,`red`列出有未分配的主分片的信息。使用`green`列出所有已分配的副本分片信息。 | `curl -XGET ``'[http://localhost:9200/_shard_stores?status=green'](http://localhost:9200/_shard_stores?status=green%27)` | 响应: 分片存储信息按索引和分片ID分组。 { ... "0": { ① "stores": [ ② { "sPa3OgxLSYGvQ4oPs-Tajw": { ③ "name": "node_t0", "transport_address": "local[1]", "attributes": { "mode": "local" } }, "allocation_id": "2iNySv_OQVePRX-yaRH_lQ", ④ "legacy_version": 42, ⑤ "allocation" : "primary" | "replica" | "unused", ⑥ "store_exception": ... ⑦ }, ... ] }, ... } ① 这个键是存储信息对应的分片id ②所有分片副本的存储信息列表 ③副本托管存储的节点信息,这个键是唯一节点id ④存储副本分片的id ⑤存储副本的版本(仅适用于在当前版本的 **Elasticsearch** 中尚未激活的旧版分区副本) ⑥存储副本的状态,无论用作主存储、副本存储还是不使用的副本。 ⑦打开分片索引或更早引擎故障时遇到的异常信息。