<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # cat shards 原文鏈接 : [https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-shards.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-shards.html) 譯文鏈接 : [http://www.apache.wiki/display/Elasticsearch/cat+shards](http://www.apache.wiki/display/Elasticsearch/cat+shards) 貢獻者 : [那伊抹微笑](/display/~wangyangting) **shards** 命令詳細的描述了節點包含的分片信息。它將告訴您它是一個主分片還是一個副本,和文檔的數量,硬盤上占用的字節數,以及節點所在的位置。下面我將看一個單獨的索引,它有 **3** 個主分片和 **0** 個副本。 ``` % curl 192.168.56.20:9200/_cat/shards wiki1 0 p STARTED 3014 31.1mb 192.168.56.10 H5dfFeA wiki1 1 p STARTED 3013 29.6mb 192.168.56.30 bGG90GE wiki1 2 p STARTED 3973 38.1mb 192.168.56.20 I8hydUG ``` ## Index pattern(索引模式) 如果有許多分片,您也許想要限制在輸出中顯示的索引。您可以一直使用 **grep**,但是您可以通過提供一個 **index** **pattern**(索引模式)到尾部以節省帶寬。 ``` % curl 192.168.56.20:9200/_cat/shards/wiki* wiki2 0 p STARTED 197 3.2mb 192.168.56.10 H5dfFeA wiki2 1 p STARTED 205 5.9mb 192.168.56.30 bGG90GE wiki2 2 p STARTED 275 7.8mb 192.168.56.20 I8hydUG ``` ## Relocation(遷移) 假設您在檢測集群健康時發現遷移的分片。它們原來在哪里,并且遷移到哪呢? ``` % curl 192.168.56.10:9200/_cat/health 1384315316 20:01:56 foo green 3 3 12 6 2 0 0 % curl 192.168.56.10:9200/_cat/shards | fgrep RELO wiki1 0 r RELOCATING 3014 31.1mb 192.168.56.20 I8hydUG -> 192.168.56.30 bGG90GE wiki1 1 r RELOCATING 3013 29.6mb 192.168.56.10 H5dfFeA -> 192.168.56.30 bGG90GE ``` ## Shard states(分片狀態) 在一個分配能使用之前,它會經過一個?``**INITIALIZING**(初始化)狀態,**shards** 可以告訴您更詳細的信息。`` ``` % curl -XPUT 192.168.56.20:9200/_settings -d'{"number_of_replicas":1}' {"acknowledged":true} % curl 192.168.56.20:9200/_cat/shards wiki1 0 p STARTED 3014 31.1mb 192.168.56.10 H5dfFeA wiki1 0 r INITIALIZING 0 14.3mb 192.168.56.30 bGG90GE wiki1 1 p STARTED 3013 29.6mb 192.168.56.30 bGG90GE wiki1 1 r INITIALIZING 0 13.1mb 192.168.56.20 I8hydUG wiki1 2 r INITIALIZING 0 14mb 192.168.56.10 H5dfFeA wiki1 2 p STARTED 3973 38.1mb 192.168.56.20 I8hydUG ``` 如果一個分片不能夠被分配,例如,你分配的分片數量超過了集群中節點的數量,分片將保持?`**UNASSIGNED**(未分配的)狀態與?[reason code](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-shards.html#reason-unassigned "Reasons for unassigned shardedit")(異常代碼)`**ALLOCATION_FAILED**(分配失敗)。`` ``` % curl -XPUT 192.168.56.20:9200/_settings -d'{"number_of_replicas":3}' % curl 192.168.56.20:9200/_cat/health 1384316325 20:18:45 foo yellow 3 3 9 3 0 0 3 % curl 192.168.56.20:9200/_cat/shards wiki1 0 p STARTED 3014 31.1mb 192.168.56.10 H5dfFeA wiki1 0 r STARTED 3014 31.1mb 192.168.56.30 bGG90GE wiki1 0 r STARTED 3014 31.1mb 192.168.56.20 I8hydUG wiki1 0 r UNASSIGNED ALLOCATION_FAILED wiki1 1 r STARTED 3013 29.6mb 192.168.56.10 H5dfFeA wiki1 1 p STARTED 3013 29.6mb 192.168.56.30 bGG90GE wiki1 1 r STARTED 3013 29.6mb 192.168.56.20 I8hydUG wiki1 1 r UNASSIGNED ALLOCATION_FAILED wiki1 2 r STARTED 3973 38.1mb 192.168.56.10 H5dfFeA wiki1 2 r STARTED 3973 38.1mb 192.168.56.30 bGG90GE wiki1 2 p STARTED 3973 38.1mb 192.168.56.20 I8hydUG wiki1 2 r UNASSIGNED ALLOCATION_FAILED ``` ## Reasons for unassigned shard 對于在 **unassigned state**(未分配狀態)中的分片,這里有一些可能的原因 :? | Reason Code(異常代碼) | Description(描述) | | `INDEX_CREATED` | Unassigned as a result of an API creation of an index. | | `CLUSTER_RECOVERED` | Unassigned as a result of a full cluster recovery. | | `INDEX_REOPENED` | Unassigned as a result of opening a closed index. | | `DANGLING_INDEX_IMPORTED` | Unassigned as a result of importing a dangling index. | | `NEW_INDEX_RESTORED` | Unassigned as a result of restoring into a new index. | | `EXISTING_INDEX_RESTORED` | Unassigned as a result of restoring into a closed index. | | `REPLICA_ADDED` | Unassigned as a result of explicit addition of a replica. | | `ALLOCATION_FAILED` | Unassigned as a result of a failed allocation of the shard. | | `NODE_LEFT` | Unassigned as a result of the node hosting it leaving the cluster. | | `REROUTE_CANCELLED` | Unassigned as a result of explicit cancel reroute command. | | `REINITIALIZED` | When a shard moves from started back to initializing, for example, with shadow replicas. | | `REALLOCATED_REPLICA` | A better replica location is identified and causes the existing replica allocation to be cancelled. |
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看