number of documents in the index cannot exceed 2147483519
ES单个分片最大的文档数是21个亿。如果写入的doc总量超过这个值,就会写入拒绝!!
为防止因分片满导致写入拒绝,一定要提前做好监控告警,分片文档数大于19亿及时告警。平时控制分片大小在30-50G健康水位,防止单个分片过大。防止倾斜数据产生。
新建新索引写入,并且规划好分片大小。
reindex索引,新索引做好分片规划
PUT _cluster/settings
{
"persistent": {
"action.auto_create_index": false
}
}
PUT indexname/_settings
{
"blocks.write": true
}
执行拷贝
POST _reindex?wait_for_completion=false&slices=auto&refresh
{
"source": {
"index": "indexname"
},
"dest": {
"index": "indexname_new"
}
}
获取reindex任务列表
GET _tasks?detailed=true&actions=*reindex
根据任务ID查看任务
GET /_tasks/r1A2WoRbTwKZ516z6NEs5A:36619
若想取消任务
POST _tasks/r1A2WoRbTwKZ516z6NEs5A:36619/_cancel
POST /_aliases
{
"actions": [
{
"add": {
"index": "indexname_new",
"alias": "indexname" //这里可以用老索引名字,就不需要业务侧修改写入索引名了
}
}
]
}
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。