在Elasticsearch中添加不存在的集群设置 [英] Add non existing cluster settings in elasticsearch
问题描述
最近,我已经用fluentd和Kibana构建了elasticsearch,并且一切正常,但是在执行由Java引起的搜索时,我们面临着很高的cpu负载。
我有60 GB的Ram和16个处理器,每个处理器有2个内核。
ES_HEAP_SIZE = 32g
查找下面的更多详细信息
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
- elasticsearch.log的快照
[DEBUG ] [action.search.type] [绿巨人2099]
[logstash-2015.03.14] [4],节点[qxcAN3lURs65Lf1GMhB_qg],[P],
s [STARTED]:无法执行
[org.elasticsearch.action.search.SearchRequest@7c71025f] lastShard
[true]
org.elasticsearch.common.util.concurrent.EsRejectedExecutionException:
拒绝执行(队列容量1000 )在org.elasticsearch.common.util上的
org.elasticsearch.search.action.SearchServiceTransportAction$23@1d7c9f0f.concurrent.EsAbortPolicy.rejectedExecution(EsAbortPolicy.java:62)
在java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821)
在java.util .concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372)
在org.elasticsearch.search.action.SearchServiceTransportAction.execute(SearchServiceTransportAction.java:551)
在org .elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:228)
在org.elasticsearch.action.search.type.TransportSearchCountAction $ AsyncAction.sendExecuteFirstPhase(TransportSearchCountAction.java:71)$ b org.elasticsearch.action.search.type.TransportSearchTypeAction $ BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:171)中的
$ b
现在我读到我必须更新ES中的线程池设置,并且现在有了
curl -XGET localhost:9200 / _cluster / settings?pretty
{ persistent:{}, transient:{}}
我正在尝试使用下面的命令
curl -XPUT localhost:9200 / _cluster / settings -d'{
线程池:{ 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 [Validation Failed:1:No
settings to update;],状态:400}
此命令出了什么问题?这是解决我问题的正确方法吗?
请告知
谢谢。
艾曼
解决方案下面是获取,设置和设置示例清除临时群集设置...
GET / _cluster / settings?include_defaults = true
GET / _cluster / settings
PUT / _cluster / settings
{
transient:{ cluster.routing.allocation.cluster_concurrent_rebalance:0}
}
PUT / _cluster / settings
{
//设置为null以清除
transient:{ cluster.routing.allocation.cluster_concurrent_rebalance:null}
}
这些参考值得一看:
- https://www.elastic.co/guide/zh-CN/elasticsearch/reference/current/cluster-update-settings.html
- https://www.elastic.co/guide/zh-CN/elasticsearch/reference/current/cluster-get-settings.html
- https://logz.io/blog/elasticsearch-cheat-sheet/
Recently i have built elasticsearch with fluentd and Kibana and all is working fine, but we are facing high cpu load while performing search caused by java.
I have 60 GB Ram and 16 processors and each processor has 2 cores.
ES_HEAP_SIZE=32g
-find below more details
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
- snapshot from elasticsearch.log
[DEBUG][action.search.type ] [Hulk 2099] [logstash-2015.03.14][4], node[qxcAN3lURs65Lf1GMhB_qg], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@7c71025f] lastShard [true] org.elasticsearch.common.util.concurrent.EsRejectedExecutionException: rejected execution (queue capacity 1000) on 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)
Now i read that i have to update the threadpool settings in ES and i have now
curl -XGET localhost:9200/_cluster/settings?pretty
{ "persistent" : { }, "transient" : { } }
i'm trying to update the settings with the below commands
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 } } }'
but i keep getting
{"error":"ActionRequestValidationException[Validation Failed: 1: no settings to update;]","status":400}
What's wrong with this command? is it the right solution for my issue ?
Please advise
Thanks.
Ayman
解决方案Here's an example of getting, setting, and clearing transient cluster settings...
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 } }
These reference are worth a look:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html
- https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-get-settings.html
- https://logz.io/blog/elasticsearch-cheat-sheet/
这篇关于在Elasticsearch中添加不存在的集群设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!