21

I am trying to run elastic search and using the following command I am trying to put data-

'curl -XPOST http://localhost:9200/_bulk?pretty --data-binary @data_.json'

But I am getting the following error-

    "create" : {
      "_index" : "appname-docm",
      "_type" : "HYD",
      "_id" : "AVVYfsk7M5xgvmX8VR_B",
      "status" : 429,
      "error" : {
        "type" : "es_rejected_execution_exception",
        "reason" : "rejected execution of org.elasticsearch.transport.TransportService$4@c8998f4 on EsThreadPoolExecutor[bulk, queue capacity = 50, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@553aee29[Running, pool size = 4, active threads = 4, queued tasks = 50, completed tasks = 0]]"
      }
    }
  },

I tried increasing the queue size by-

threadpool.search.queue_size: 100000

But I still get the same error.

  • Possible duplicate of [ElasticSearch gives error about queue size](http://stackoverflow.com/questions/20683440/elasticsearch-gives-error-about-queue-size) – Jim G. Apr 20 '17 at 19:23

2 Answers2

26

The problem that you are getting is because the bulk operations queue is full.

A node ES has many threads pools, generic, search, index, suggest, bulk, etc. In your case the problem is due to the queue of bulk operations is full.

Try adjusting the queue size of thread pool of bulk operation:

thread_pool.bulk.queue_size: 100

Or reduce the amount of bulk operations that you are sending at once.

For more details see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-threadpool.html

Xiao
  • 12,235
  • 2
  • 29
  • 36
Juan Ignacio
  • 826
  • 8
  • 10
4

Try the following:

curl -XPUT localhost:9200/_cluster/settings -d '{ "transient" : { "threadpool.bulk.queue_size" : 500 } }'

Edit: And to Get current settings

curl -X GET "localhost:9200/_cluster/settings?include_defaults=true"

arberg
  • 4,148
  • 4
  • 31
  • 39
Jim G.
  • 15,141
  • 22
  • 103
  • 166