elasticsearch 提高bulk api插入效率

在使用ES提供的python版本的bulk api插入数据时,总是报出如下错误:

EsRejectedExcutionException[rejected execution(queue capacity 50) on ...

 

通过curl -XGET 'http://ip:port/_cat/thread_pool?v'发现

bulk.queue远大于默认值50,bulk.rejected也很大。

 

https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-threadpool.html

 

通过官网文档提供的方法设置如下: 

 

curl -XPUT 'http://ip:port/_cluster/settings?pretty' -d '{"transient" : {"threadpool.bulk.queue_size" : 5000}}'

 

 

使用bulk api时控制一下插入线程数。

 

相关文章:http://www.jianshu.com/p/5eeeeb4375d4

 

posted @ 2017-02-28 15:10  swmabby  阅读(542)  评论(0)    收藏  举报