Elasticsearch集群(操作记录)
文章目录
版本7.3.0
设置集群分片数量:
默认一个节点是1000分片的上限,超过后会抛异常,数据进不去。
this action would add [1] total shards, but this cluster currently has [1000]/[1000] maximum shards。
PUT /_cluster/settings
{
"transient": {
"cluster": {
"max_shards_per_node": 2000
}
}
}
修改类型,转移数据方案:
使用别名
1.新建一个新的索引,定义类型
2.使用scroll api将数据批量查询出来
3.采用bulk api将scoll查出来的一批数据,批量写入新索引
4.将别名指向新的索引
POST /_aliases
{
"actions": [
{"remove":{"index":"old_index","alias":"index_alias"}},
{"add":{"index":"new_index","alias":"index_alias"}}
]
}

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论