<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>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # Cluster Reroute 原文鏈接 : [https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-reroute.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-reroute.html) 譯文鏈接 : [http://www.apache.wiki/display/Elasticsearch/Cluster+Reroute](http://www.apache.wiki/display/Elasticsearch/Cluster+Reroute) 貢獻者 : [那伊抹微笑](/display/~wangyangting) **reroute** 命令可以明確的執行包括指定命令的集群重新路由分配命令。例如,一個分片可以從一個節點明確的移動到另一個節點,分配可以被取消,或者未分配的分片可能被明確的分配到一個指定的節點。 下面是一個見簡單的重新路由 **API** 調用的例子 :? ``` curl -XPOST 'localhost:9200/_cluster/reroute' -d '{ "commands" : [ { "move" : { "index" : "test", "shard" : 0, "from_node" : "node1", "to_node" : "node2" } }, { "allocate_replica" : { "index" : "test", "shard" : 1, "node" : "node3" } } ] }' ``` 要記住的一個重要方面是, 在分配時,集群將針對 **re-balancing**(重新平衡)它的狀態到一個相等的狀態。例如,如果分配包括從 **node1** 移動分片到 **node2**,在一個相等的狀態中,其它的分片將會從 **node2** 移動到 **node1** 以達到平衡。 即可可以設置禁用分配,這意味著只有在明確的指定分配情況下才被執行。很顯然,僅僅一次所有的命令被請求時,該集群將重新平衡它的狀態。 另一種選擇是在 **dry_run**(作為一個 **URI** 標記,或者在請求體中)中運行命令。這將導致命令應用到當前的集群狀態,并且在命令別被執行后返回集群結果。 如果指定了 **explain** 參數,會返回命令可以或者不能被執行的詳細的說明。 支持的命令是 :? | 命令 | 描述 | | --- | --- | | move | Move a started shard from one node to another node. Accepts?`index`?and?`shard`?for index name and shard number,?`from_node`?for the node to move the shard?`from`, and?`to_node`?for the node to move the shard to. | | cancel | Cancel allocation of a shard (or recovery). Accepts?`index`?and?`shard`?for index name and shard number, and?`node`?for the node to cancel the shard allocation on. It also accepts?`allow_primary`?flag to explicitly specify that it is allowed to cancel allocation for a primary shard. This can be used to force resynchronization of existing replicas from the primary shard by cancelling them and allowing them to be reinitialized through the standard reallocation process. | | allocate_replica | Allocate an unassigned replica shard to a node. Accepts the?`index`?and?`shard`?for index name and shard number, and?`node`?to allocate the shard to. Takes?[allocation deciders](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-cluster.html "Cluster")?into account. | 兩個更多的命令可用,允許分配主分片到節點。這些命令需要謹慎使用,因為主分片的分配通常有 **Elasticsearch** 自動處理。為什么主分片不能被自動分配的原因如下 :? * 一個新的索引被創建,但是沒有滿足分配策略者的節點。 * 一個最新的分片數據的副本,不能在集群中當前數據節點上找到。為了防止數據丟失,系統不會自動的促使一個穩定的分片復制為主分片。 在手動覆蓋時,兩個命令強制分配主分片可供選擇 :? | 命令 | 描述 | | --- | --- | | allocate_stale_primary | Allocate a primary shard to a node that holds a stale copy. Accepts the?`index`?and?`shard`?for index name and shard number, and?`node`?to allocate the shard to. Using this command may lead to data loss for the provided shard id. If a node which has the good copy of the data rejoins the cluster later on, that data will be overwritten with the data of the stale copy that was forcefully allocated with this command. To ensure that these implications are well-understood, this command requires the special field?`accept_data_loss`?to be explicitly set to?`true`?for it to work. | | allocate_empty_primary | Allocate an empty primary shard to a node. Accepts the?`index`?and?`shard`?for index name and shard number, and?`node`?to allocate the shard to. Using this command leads to a complete loss of all data that was indexed into this shard, if it was previously started. If a node which has a copy of the data rejoins the cluster later on, that data will be deleted! To ensure that these implications are well-understood, this command requires the special field?`accept_data_loss`?to be explicitly set to?`true`?for it to work. | ## Retry failed shards(重試故障的分片) 集群嘗試分配一個分片的最大次數為 **index.allocation.max_retries**(默認為 **5**),在放棄和離開未分配的分片之前。該場景會造成結構上的問題,例如有一個分析器,它引用了一個在所有節點上不存在的?**stopwords** 文件。 在該問題被修復后,可以通過手動重復與 **?retry_failed** 一起調用?[`_reroute`](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-reroute.html "Cluster Reroute")?API,它將為那些節點單獨的重試。
                  <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>

                              哎呀哎呀视频在线观看