关闭分片自动转移
PUT http://192.168.6.171:9200/_cluster/settings
{
"transient":{
"cluster.routing.allocation.enable":"none"
}
}
默认 all
手动转移分片
POST http://192.168.6.171:9200/_cluster/reroute
{
"commands" : [
{
"move" : {
"index" : "pack_record_index_201709", "shard" : 2,
"from_node" : "node-125", "to_node" : "node-3"
}
}
]
}
index 索引名
shard 分片序号
from_node 来自哪个节点
to_node 去哪个节点
PUT http://192.168.6.171:9200/_cluster/settings
{
"transient":{
"cluster.routing.allocation.enable":"none"
}
}
默认 all
手动转移分片
POST http://192.168.6.171:9200/_cluster/reroute
{
"commands" : [
{
"move" : {
"index" : "pack_record_index_201709", "shard" : 2,
"from_node" : "node-125", "to_node" : "node-3"
}
}
]
}
index 索引名
shard 分片序号
from_node 来自哪个节点
to_node 去哪个节点