elasticsearch - 增加弹性搜索 Kubernetes 中的分片数
问题描述
部署了一个Elasticsearch
on GKE
。ECK 有 3 个主节点和 2 个数据节点。当创建具有 1 个分片和 1 个副本的索引时,当分片数达到 1000 时收到 400 错误响应。
是否可以增加分片数?请提出一种增加分片数量的方法。
错误详情
Invalid NEST response built from a unsuccessful (400) low level call on PUT: /t-2af14520-e76d-4091-a51d-1c89cf990e97
Audit trail of this API call:
[1] BadResponse: Node: http://eck.com/ Took: 00:00:00.2833118
OriginalException: Elasticsearch.Net.ElasticsearchClientException: Request failed to execute. Call: Status code 400 from: PUT /t-2af14520-e76d-4091-a51d-1c89cf990e97. ServerError: Type: illegal_argument_exception Reason: "Validation Failed: 1: this action would add [2] total shards, but this cluster currently has [2000]/[2000] maximum shards open;"
Request:
<Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>
Response:
<Response stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>
解决方案
您可以按如下方式更改分片编号。有关更多详细信息,请参阅集群更新设置 API。我建议您在测试后应用它。
PUT /_cluster/settings
{
"persistent" : {
"cluster.max_shards_per_node" : 3000
}
}
推荐阅读
- javascript - lodash 在对象数组中搜索文本
- visual-studio - 在 Visual Studio 中,环境变量在哪里定义?
- ms-access - 如何在访问数据库报告上创建关闭按钮
- javascript - 在 Axios 中结束请求
- javascript - 如何在 nuxtjs 中使用 /foo-:bar 路由?
- javascript - 添加到 Google 日历呈现链接不显示用户的当地时间
- mongodb - mongodb shell命令上传视频文件
- mysql - 在 MySQL 中从长到宽重塑数据
- java - Android工作室,任务':app:packageDebug'的执行失败
- python - FieldError at / 无法将关键字“title_icontains”解析为字段。选项有:完成、创建、解密、id、标题、用户、user_id