问题
“reason”: “Validation Failed: 1: this action would add [2] shards, but this cluster currently has [999]/[1000] maximum normal shards open;”
原因
分片达到最大数 无法新增
解决方法
- 方法1 (不推荐)修改最大分片数量
PUT /_cluster/settings
{
"transient": {
"cluster": {
"max_shards_per_node":10000 # 这里可以修改
}
}
}
- 方法2 日志保留n天自动删除
在kibana 中点击索引管理 ->添加索引生命周期策略->开启删除阶段->添加索引模板->匹配索引模式->应用生命周期策略
添加索引
删除阶段
将滚动更新关闭
创建索引模板
添加索引模式 添加后该模式下的索引就会被添加上自己创建的生命周期
添加生命周期设置
{
"index": {
#生命周期设置
"lifecycle": {
"name": "auto_delete_policy" #生命周期名称
},
"number_of_shards": "1",
"refresh_interval": "5s"
}
}
作者声明
如有问题,欢迎指正!