国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

解決Elasticsearch exception [type=circuit_breaking_exception, reason=[parent] Data too large問題

這篇具有很好參考價(jià)值的文章主要介紹了解決Elasticsearch exception [type=circuit_breaking_exception, reason=[parent] Data too large問題。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

一、背景

公司有一批8萬的數(shù)據(jù)存儲(chǔ)在Mysql中,然后我使用多線程的方式調(diào)用Elasticsearch的bulk()方法推送到ES,但是在推送過程中出現(xiàn)了該問題,這屬于插入數(shù)據(jù)時(shí)產(chǎn)生的問題

二、異常

EVERE: Servlet.service() for servlet [default] in context with path [appBoot] threw exception [http://192.168.3.83:10014/api/kms-wiki/ElasticsearchService/createIndex] with root cause
ElasticsearchStatusException[Elasticsearch exception [type=circuit_breaking_exception, reason=[parent] Data too large, data for [<http_request>] would be [511812774/488.1mb], which is larger than the limit of [510027366/486.3mb], real usage: [510461080/486.8mb], new bytes reserved: [1351694/1.2mb], usages [request=0/0b, fielddata=10341/10kb, in_flight_requests=18268042/17.4mb, accounting=2110340/2mb]]]
	at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:177)
	at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:1793)
	at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:1770)
	at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1527)
	at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1484)
	at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1454)
	at org.elasticsearch.client.RestHighLevelClient.bulk(RestHighLevelClient.java:497)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:544)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:364)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:616)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:831)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1629)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
	Suppressed: org.elasticsearch.client.ResponseException: method [POST], host [http://elasticsearch:9200], URI [/_bulk?timeout=1m], status line [HTTP/1.1 429 Too Many Requests]
{"error":{"root_cause":[{"type":"circuit_breaking_exception","reason":"[parent] Data too large, data for [<http_request>] would be [511812774/488.1mb], which is larger than the limit of [510027366/486.3mb], real usage: [510461080/486.8mb], new bytes reserved: [1351694/1.2mb], usages [request=0/0b, fielddata=10341/10kb, in_flight_requests=18268042/17.4mb, accounting=2110340/2mb]","bytes_wanted":511812774,"bytes_limit":510027366,"durability":"TRANSIENT"}],"type":"circuit_breaking_exception","reason":"[parent] Data too large, data for [<http_request>] would be [511812774/488.1mb], which is larger than the limit of [510027366/486.3mb], real usage: [510461080/486.8mb], new bytes reserved: [1351694/1.2mb], usages [request=0/0b, fielddata=10341/10kb, in_flight_requests=18268042/17.4mb, accounting=2110340/2mb]","bytes_wanted":511812774,"bytes_limit":510027366,"durability":"TRANSIENT"},"status":429}
		at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:283)
		at org.elasticsearch.client.RestClient.performRequest(RestClient.java:261)
		at org.elasticsearch.client.RestClient.performRequest(RestClient.java:235)
		at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1514)
		... 37 more

三、解決辦法

加大-Xms-Xmx的值,比如docker-compose.yaml文件中可以這樣設(shè)置:

services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.10.0
    environment:
     - ES_JAVA_OPTS=-Xms1g -Xmx2g

四、解釋

1、異常分析

從上面錯(cuò)誤日志可以看出,現(xiàn)在是父熔斷器(parent)直接熔斷了,現(xiàn)在我們來介紹一下這幾種熔斷器作用

  • parent circuit breaker(父熔斷器):在所有斷路器上使用的總內(nèi)存量
  • Field data circuit breaker(列數(shù)據(jù)熔斷器)
  • Request circuit breaker(請(qǐng)求熔斷器)
  • Accounting requests circuit breaker
  • Script compilation circuit breaker(腳本編譯熔斷器)
2、查看父熔斷器占據(jù)JVM最大堆內(nèi)存的比例值

默認(rèn)值: 95%

要求: 大點(diǎn)好

查看方式:

請(qǐng)求方式:
GET

請(qǐng)求鏈接(ip和port都是Elasticsearch的;查看該接口返回值中的indices.breaker.total.limit參數(shù)值就是上面提到的比例值;如果沒有該值,那就是使用默認(rèn)值95%):
http://ip:port/_cluster/settings?

設(shè)置方式:

請(qǐng)求方式:
PUT 

請(qǐng)求鏈接(其中ip和port都是Elasticsearch的):
http://ip:port/_cluster/settings

請(qǐng)求體:
{
  "persistent": {
    "indices.breaker.total.limit": "95%"
  }
}
3、查看父熔斷器占據(jù)JVM堆的具體值
請(qǐng)求方式:
GET

請(qǐng)求鏈接(ip和port都是Elasticsearch的;查看該接口返回值中的parent的limit_size參數(shù)值,該值受到上面比例值的限制):
http://ip:port/_nodes/stats/breaker

比如現(xiàn)在設(shè)置- ES_JAVA_OPTS=-Xms1g -Xmx2g,然后具體值是1.8g,我現(xiàn)在的父熔斷器占比是95%,所以1.8g是差不多的,如下:

reason=[parent] data too large, data for [<http_request>] would be [24728743,java學(xué)習(xí)之路,elasticsearch,大數(shù)據(jù),搜索引擎文章來源地址http://www.zghlxwxcb.cn/news/detail-777564.html

4、解決查詢時(shí)導(dǎo)入的熔斷問題
  • ES調(diào)優(yōu)2(bulk報(bào)錯(cuò))

到了這里,關(guān)于解決Elasticsearch exception [type=circuit_breaking_exception, reason=[parent] Data too large問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Elasticsearch exception [type=cluster_block_exception, reason=blocked by: [FORBIDDEN/12/index r【已解決】

    Elasticsearch exception [type=cluster_block_exception, reason=blocked by: [FORBIDDEN/12/index r【已解決】

    親測(cè) 2022/08/16 BJ 集群存儲(chǔ)資源高水位異常,默認(rèn)當(dāng)磁盤空間大于95%時(shí),就會(huì)禁止寫入。 首先讓es節(jié)點(diǎn)騰出足夠的空間、 刪除磁盤數(shù)據(jù) ; 擴(kuò)容。 執(zhí)行恢復(fù)命令 讓es恢復(fù)到可寫入狀態(tài)。問題解決!

    2024年02月12日
    瀏覽(23)
  • elasticsearch 7.12.1報(bào)錯(cuò)處理:ElasticsearchStatusException[Elasticsearch exception [type=parse_exception]

    提示:文章寫完后,目錄可以自動(dòng)生成,如何生成可參考右邊的幫助文檔 最近在使用RestHighLevelClient測(cè)試后端數(shù)據(jù)時(shí),遇到如下一個(gè)報(bào)錯(cuò): 問題出在我沒有給 geoDistanceQuery 設(shè)置中心坐標(biāo) 設(shè)置中心坐標(biāo)后問題得到解決。 以下是elastic客戶端查詢索引的代碼

    2024年02月16日
    瀏覽(26)
  • ElasticsearchStatusException[Elasticsearch exception [type=mapper_parsing_exception, reason=failed t

    今天在用java寫代碼查ES中數(shù)據(jù)的時(shí)候,出現(xiàn)了下面提示的錯(cuò)誤,我排查了一會(huì)才發(fā)現(xiàn)問題 ES中地理坐標(biāo)屬性location的數(shù)據(jù)結(jié)構(gòu)是 (緯度,經(jīng)度) ,而我在進(jìn)行字符串拼接的時(shí)候后了中間的逗號(hào),導(dǎo)致插入數(shù)據(jù)錯(cuò)誤。下面就是上面那一段代碼真正有用的部分。 真正錯(cuò)誤原因:

    2024年02月11日
    瀏覽(25)
  • org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=illegal_argument_excep

    org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=illegal_argument_excep

    org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=illegal_argument_exception, reason=request [/zc/_search] contains unrecognized parameters: [ccs_minimize_roundtrips], [ignore_throttled]] 原因: 該異常是由于在對(duì)索引進(jìn)行搜索請(qǐng)求時(shí),使用了不被識(shí)別的參數(shù)導(dǎo)致的。具體來說,異常信息中列出了兩

    2024年02月08日
    瀏覽(46)
  • ES排序報(bào)錯(cuò):Elasticsearch exception [type=illegal_argument_exception, reason=Text

    翻譯過來就是: 對(duì)于需要每個(gè)文檔字段數(shù)據(jù)(如聚合和排序)的操作,文本字段沒有進(jìn)行優(yōu)化,因此這些操作在默認(rèn)情況下是禁用的。請(qǐng)使用字段代替?;蛘?,在[createTime]上設(shè)置fielddata=true,以便通過反求倒排索引來加載字段數(shù)據(jù)。注意,這可能會(huì)使用有效內(nèi)存。] 更改后

    2024年02月11日
    瀏覽(25)
  • Elasticsearch exception [type=index_not_found_exception, reason=no such index [**]]

    Elasticsearch exception [type=index_not_found_exception, reason=no such index [**]]

    ?1.代碼運(yùn)行出現(xiàn)找不到Index,先排除index是否存在。 ? 2.springboot和ES映射,默認(rèn)是把對(duì)象類型映射為index,class對(duì)象默認(rèn)是大寫開頭,所以要看是都是因?yàn)榇笮懖黄ヅ洹H缛粢驗(yàn)榇笮懺驅(qū)е?,可以通過@Document注解指定index ?

    2024年02月14日
    瀏覽(23)
  • Caused by: ElasticsearchException[Elasticsearch exception [type=mapper_parsing_exception, reason=Roo

    Caused by: ElasticsearchException[Elasticsearch exception [type=mapper_parsing_exception, reason=Roo

    ?我們?cè)谑褂肦estClient創(chuàng)建索引庫(kù)時(shí)出現(xiàn)了這個(gè)錯(cuò)誤。 可以檢查一下 CreateIndexRequest 類型變量request 是否導(dǎo)入正確的包 有兩個(gè)同名的包,我們選擇: import org.elasticsearch.client.indices.CreateIndexRequest; ? ? 測(cè)試成功 ?創(chuàng)建的DSL的索引庫(kù) ?以上解決辦法參考 Elasticsearch exception [type=mapp

    2024年01月23日
    瀏覽(25)
  • Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]

    Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]

    Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed] 今天在做項(xiàng)目遇到這個(gè)問題,Es那邊出現(xiàn)了問題,谷粒商城去Es中查數(shù)據(jù)的時(shí)候,根據(jù)品牌id去查詢數(shù)據(jù)報(bào)錯(cuò)。 ? {\\\"error\\\":{\\\"root_cause\\\":[{ \\\"type\\\":\\\"query_shard_exception\\\",\\\"reason\\\":\\\"failed to create query: {n ?\\\"bool\\\" : {n ? ?\\\"fil

    2024年02月02日
    瀏覽(23)
  • Elasticsearch exception [type=mapper_parsing_exception, reason=Failed to parse mapping [properties]

    Elasticsearch exception [type=mapper_parsing_exception, reason=Failed to parse mapping [properties]

    Elasticsearch exception [type=mapper_parsing_exception, reason=Failed to parse mapping [properties]: Root mapping definition has unsupported parameters: ? 我們?cè)谑褂肦estClient創(chuàng)建索引庫(kù)時(shí)出現(xiàn)了這個(gè)錯(cuò)誤。 可以檢查一下 CreateIndexRequest 類型變量request 是否導(dǎo)入正確的包 有兩個(gè)同名的包,我們選擇: 創(chuàng)建的索引

    2024年02月11日
    瀏覽(24)
  • Elasticsearch exception [type=parsing_exception, reason=[multi_match] unknown token [START_ARRAY] af

    代碼報(bào)錯(cuò) QueryBuilder queryBuilder = QueryBuilders.multiMatchQuery(deptIdList, “data.deptId”, “modifiedData.deptId”); multiMatchQuery這個(gè)API,第一個(gè)參數(shù)不支持List類型, 雖然傳List沒報(bào)錯(cuò), 但是往ES發(fā)送查詢請(qǐng)求的時(shí)候就會(huì)拋異常出來 傳一個(gè)字段, 如果你想多字段in查詢,就用類似下面這樣寫法就可以了

    2024年02月07日
    瀏覽(49)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包