ES索引数据移动+缩小副本+缩小分片

数据移动到cold节点 + 禁止写入 + 副本降为:0

PUT index_old/_settings
{
 "index.number_of_replicas": "0",
  "index.routing.allocation.require.box_type": "cold",
  "index.blocks.write": true
}

生成新索引:分片降为1

POST /index_old/_shrink/index_new
{
  "settings": {
    "index.number_of_replicas": 0,
    "index.number_of_shards": 1,
    "index.codec": "best_compression",
    "index.routing.allocation.require.box_type": "cold"
  }
}

查看数据分布

GET _cat/shards/index_*

删除老索引:index_old

你可能感兴趣的:(ES索引数据移动+缩小副本+缩小分片)