【Elasticsearch实战】移动分片

① 设置副本数为0

PUT student/_settings
{
  "number_of_replicas": 0
}

② 移动分片

POST _cluster/reroute
{
  "commands": [
    {
      "move": {
        "index": "索引",
        "shard": 分片序号,
        "from_node": "节点01",
        "to_node": "节点02"
      }
    }
  ]
}

③ 设置副本数为节点数 -1, 属性自行设置

PUT student/_settings
{
  "number_of_replicas": [nodes.size - 1]
}

每一步都确认要执行完再执行下一步!!!

如果帮到你,请点个赞吧 O(∩_∩)O~

猜你喜欢

转载自blog.csdn.net/qq171563857/article/details/89319486
今日推荐