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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容