簡體   English   中英

顯示和更改參數 threadpool.bulk.queue_size

[英]show and change parameter threadpool.bulk.queue_size

我正在使用 elasticsearch 版本 6.7.2 並且出現錯誤 429

{
    "error": {
        "root_cause": [
            {
                "type": "remote_transport_exception",
                "reason": "[localhost][localhost:9300][indices:data/write/bulk[s]]"
            }
        ],
        "type": "es_rejected_execution_exception",
        "reason": "rejected execution of processing of [682604930][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[hboauth2-2020.04.20-000113][0]] containing [index {[hboauth2][_doc][yRuEnHEBn6z33bhuCGjZ], source[{\"Action\":\"Service UpdateUserStatus Start\",\"ClientID\":\"\",\"Code\":0,\"Component\":\"UpdateUserStatus\",\"CustomMessage\":\"\",\"Data\":\"null\",\"LogDate\":1587468830939,\"Message\":\"{OK false}\",\"Type\":\"Info\",\"UserID\":\"4c220ab2-282d-466f-a9f5-da0e59b7b803\"}]}], target allocation id: wZFZUPi5TnSYFg-BNonHug, primary term: 1 on EsThreadPoolExecutor[name = localhost/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@744831b0[Running, pool size = 16, active threads = 16, queued tasks = 224, completed tasks = 264136589]]"
    },
    "status": 429
}

我找到了解決問題的方法,但是在我的版本中找不到參數threadpool.bulk.queue_size。 你能幫我找到和改變這個參數嗎

官方示例所示,您可以使用 elasticsearch.config 中的以下配置更改批量線程池的隊列大小或更新集群設置。

請注意,寫入線程池用於批量請求,如同一鏈接中所述:

write 用於單文檔索引/刪除/更新和批量請求 線程池類型的大小固定為可用處理器數,queue_size 為 200。此池的最大大小為 1 + 可用處理器數。

thread_pool:
    write:
        size: 30. --> no if threads in your case, its 16 as shown in exception
        queue_size: 400 --> here you can add `queue_size`

還提到了有關更改這些設置的說明

可以通過設置特定類型的參數來更改特定的線程池; 例如,改變寫線程池中的線程數:

編輯:正如@val 在評論部分指出的那樣,添加關於更改這些默認設置的免責聲明。

請了解這些設置的技術細節和影響,因為這些通常不建議更改,更多信息請參閱此官方博客

我正在尋找如何更改 thread_pool.write.queue_size 並首先找到 2 個解決方案

curl -XPUT  _cluster/settings -d '{
    "persistent" : {
        "thread_pool.write.queue_size" : <new_size>
    }
}'

第二次寫入 elasticsearch.yaml 參數 thread_pool.write.queue_size

所有解決方案都對我的版本 6.2.7 有效嗎?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM