用了Elasticsearch,一口气上5T

reroute命令中的from_node怎么填

Elasticsearch | 作者 ridethewind | 发布于2019年03月07日 | 阅读数:1856

发现环境中有几个分片处于unassigned,于是准备对这些分片进行reroute,结果发现from_node参数不知道填什么,cat/shards中看不出来这些分片在哪个结点
已邀请:

bean

赞同来自:

curl -X POST "localhost:9200/_cluster/reroute" -H 'Content-Type: application/json' -d'
{
    "commands" : [
        {
          "allocate_replica" : {
                "index" : "test", "shard" : 1,
                "node" : "node3"
          }
        }
    ]
}
'
参见官网https://www.elastic.co/guide/e ... .html

ridethewind

赞同来自:

POST /_cluster/reroute
{
"commands" : [
{
"move" : {
"index" : "test", "shard" : 0,
"from_node" : "node1", "to_node" : "node2"
}
},
{
"allocate_replica" : {
"index" : "test", "shard" : 1,
"node" : "node3"
}
}
]
}


我指的是上面的from_node

bean

赞同来自:

不用填from_node,就是说
{
"move" : {
"index" : "test", "shard" : 0,
"from_node" : "node1", "to_node" : "node2"
}
},
这一段是不需要的,可以删掉。
move是指移动已分配的分片,你现在要移动的是未分配的分片,所以用不上move;
allocate_replica是指将未分配的分片移动到指定node上。
你试下。

要回复问题请先登录注册