最近我用流利的和Kibana构建了elasticsearch并且一切正常,但是我们在执行由java引起的搜索时面临高CPU负载。
我有60 GB Ram和16个处理器,每个处理器有2个内核。
ES_HEAP_SIZE =32克
- 查看以下更多详情
curl "localhost:9200/_cat/thread_pool?v&h=search.rejected"
search.rejected 387
curl "localhost:9200/_cat/thread_pool?v&h=index.rejected"
index.rejected 0
[DEBUG] [action.search.type] [Hulk 2099] [logstash-2015.03.14] [4],节点[qxcAN3lURs65Lf1GMhB_qg],[P], s [已启动]:无法执行 [org.elasticsearch.action.search.SearchRequest@7c71025f] lastShard [真正] org.elasticsearch.common.util.concurrent.EsRejectedExecutionException: 拒绝执行(队列容量1000) org.elasticsearch.search.action.SearchServiceTransportAction$23@1d7c9f0f
at org.elasticsearch.common.util.concurrent.EsAbortPolicy.rejectedExecution(EsAbortPolicy.java:62) at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) at org.elasticsearch.search.action.SearchServiceTransportAction.execute(SearchServiceTransportAction.java:551) at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:228) at org.elasticsearch.action.search.type.TransportSearchCountAction$AsyncAction.sendExecuteFirstPhase(TransportSearchCountAction.java:71) at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:171)
现在我读到我必须更新ES中的线程池设置,现在我已经
了 curl -XGET localhost:9200/_cluster/settings?pretty
{“持久性”:{},“瞬态”:{}}
我正在尝试使用以下命令更新设置
curl -XPUT localhost:9200/_cluster/settings -d '{
"threadpool" : { "index": {
"type": "fixed",
"size": 32,
"queue_size": 1000 }, "bulk": {
"type": "fixed",
"size": 32,
"queue_size": 1000 }, "search": {
"type": "fixed",
"size": 96,
"queue_size": 1000 } } }'
但我一直在
{“error”:“ActionRequestValidationException [验证失败:1:没有 要更新的设置;]“,”状态“:400}
这个命令出了什么问题?这是我的问题的正确解决方案吗?
请告知
感谢。
艾曼
答案 0 :(得分:0)
您需要指定更新是permanent
(适用于所有重新启动)还是transient
(将无法在完整群集重启后继续存在)。查找更多信息here。
如果要暂时应用设置,请使用以下命令:
curl -XPUT localhost:9200/_cluster/settings -d '{
"transient": {
"threadpool": {
"index": {
"type": "fixed",
"size": 32,
"queue_size": 1000
},
"bulk": {
"type": "fixed",
"size": 32,
"queue_size": 1000
},
"search": {
"type": "fixed",
"size": 96,
"queue_size": 1000
}
}
}
}
要永久应用它们,请将transient
替换为permanent
。请注意,您还可以通过在群集更新命令中对其进行相应分组来暂时或永久地设置单个设置。
答案 1 :(得分:0)
这是获取,设置和清除瞬态群集设置的示例...
GET /_cluster/settings?include_defaults=true
GET /_cluster/settings
PUT /_cluster/settings
{
"transient":{ "cluster.routing.allocation.cluster_concurrent_rebalance":0 }
}
PUT /_cluster/settings
{
// set to null to clear
"transient":{ "cluster.routing.allocation.cluster_concurrent_rebalance":null }
}
这些参考值得一看: