Post data to elasticsearch sometimes throws error 429

command:
curl -u username:pw -X POST 'http://sd-4531-6c55:9200/testindex/_doc' -H 'Content-type: application/json' -d '{"test":11234}'

response:
{"error":{"root_cause":[{"type":"remote_transport_exception","reason":"[sd-15ef-0be6.mydomain][10.105.125.237:9300][indices:data/write/bulk[s]]"}],"type":"es_rejected_execution_exception","reason":"rejected execution of processing of [387323569][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[testindex][3]] containing [index {[testindex][_doc][OHiYk4kB4MkhK63VlcX5], source[{\"test\":11234}]}], target allocation id: q6QnwDtHR6WyA6nWP24cmg, primary term: 1 on EsThreadPoolExecutor[name = sd-15ef-0be6.mydomain/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@17c39c90[Running, pool size = 2, active threads = 2, queued tasks = 200, completed tasks = 161898316]]"},"status":429}

elasticsearch.yml:

cluster.name: ELK_SIT
path.data: /opt/gicapods/elasticdata
network.host: ${HOSTNAME}
discovery.zen.ping.unicast.hosts: sd-4531-6c55,sd-15ef-0be6
node.name: ${HOSTNAME}
http.port: 9200
discovery.zen.minimum_master_nodes: 2
xpack.security.transport.ssl.enabled: true
xpack.security.enabled: true
bootstrap.system_call_filter: false
xpack.ssl.cipher_suites: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256

xpack.security.transport.ssl.verification_mode: none
xpack.security.transport.ssl.keystore.path: certs/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: certs/elastic-certificates.p12

Logfiles of both nodes have no related entries.

Sounds like you are sending more bulk requests than what your cluster can deal with.

You should catch this error and slow down a bit the injection. Or modify your cluster (add more nodes) or send bulk requests to other nodes...

My 2 cents

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.