<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之旅 廣告
                # Cluster Health 原文鏈接 : [https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-health.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-health.html) 譯文鏈接 : [http://www.apache.wiki/display/Elasticsearch/Cluster+Health](http://www.apache.wiki/display/Elasticsearch/Cluster+Health) 貢獻者 : [那伊抹微笑](/display/~wangyangting) **cluster health**(集群健康)**API** 可以獲取一個集群健康的簡單狀態。例如,在一個單節點的集群上,存在一個有 **5** 個分片和 **1** 個副本的索引,如下操作 :? ``` curl -XGET 'localhost:9200/_cluster/health?pretty' ``` 響應如下 :? ``` { "cluster_name" : "testcluster", "status" : "yellow", "timed_out" : false, "number_of_nodes" : 1, "number_of_data_nodes" : 1, "active_primary_shards" : 5, "active_shards" : 5, "relocating_shards" : 0, "initializing_shards" : 0, "unassigned_shards" : 5, "delayed_unassigned_shards": 0, "number_of_pending_tasks" : 0, "number_of_in_flight_fetch": 0, "task_max_waiting_in_queue_millis": 0, "active_shards_percent_as_number": 50.0 } ``` 該 **API** 也可以針對一個或多個索引執行請求以獲得指定索引的健康狀態 :? ``` curl -XGET 'localhost:9200/_cluster/health/test1,test2?pretty' ``` 集群健康的狀態是 : **green**,**yellow** 或 **red**。從分片的角度來說,**red** 狀態的索引表示集群中指定的分片沒有分配,**yellow** 意味著主分片已經分配成功但是副本還沒有分配,**green** 意味著所有的分片已經分配成功。索引級別的狀態由最差的分片狀態所控制。集群狀態由最差的索引狀態所控制。 該 **API** 其中的一個好處是有等到直到集群達到了某個標記的健康級別的閥值的能力。例如,為了集群達到 **yellow** 級別下面將等待 **50** 秒(如果在 **50** 秒之前達到了 **green** 或 **yellow** 狀態,它將在這時候返回):? ``` curl -XGET 'localhost:9200/_cluster/health?wait_for_status=yellow&timeout=50s&pretty' ``` ## Request Parameters 該集群 **API** 接受下列的請求參數 :? | 請求參數 | 描述 | | --- | --- | | level | Can be one of?`cluster`,?`indices`?or?`shards`. Controls the details level of the health information returned. Defaults to?`cluster`. | | wait_for_status | One of?`green`,?`yellow`?or?`red`. Will wait (until the timeout provided) until the status of the cluster changes to the one provided or better, i.e.?`green`?&gt;?`yellow`?&gt;?`red`. By default, will not wait for any status. | | wait_for_no_relocating_shards | A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards. | | wait_for_active_shards | A number controlling to how many active shards to wait for,?`all`?to wait for all shards in the cluster to be active, or?`0`?to not wait. Defaults to?`0`. | | wait_for_nodes | The request waits until the specified number?`N`?of nodes is available. It also accepts?`&gt;=N`,?`&lt;=N`,?`&gt;N`?and?`&lt;N`. Alternatively, it is possible to use?`ge(N)`,?`le(N)`,?`gt(N)`?and?`lt(N)`?notation. | | timeout | A time based parameter controlling how long to wait if one of the wait_for_XXX are provided. Defaults to?`30s`. | | local | If?`true`?returns the local node information and does not provide the state from master node. Default:?`false`. | 下面是一個獲取集群中 shards(分片)級別的集群健康的示例 :? ``` curl -XGET 'localhost:9200/_cluster/health/twitter?level=shards&pretty' ```
                  <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>

                              哎呀哎呀视频在线观看