mazeltov7のweb断片

備忘録的なテキトーなことを書きます。(技術記事はQiitaに移行しました http://qiita.com/mazeltov7 )

Elasticsearchで大量データ挿入でのエラー(queueのcapacity)

これはなに

前回のMysqlからESにデータを200万件くらい入れるとエラー出て5000件くらい喪失してた件。 MysqlからElasticsearchにデータを入れる - mazeltov7のweb断片

ログをチェックすると、esrejectedexecutionexception queue capacity 50とか出てて、このあたりっぽい。
exception - EsRejectedExecutionException in elasticsearch for parallel search - Stack Overflow
ここも参考。
fluentd -> Elasticsearch 大量データ転送でトラブル | diaspora

とりあえずbulkのqueueのキャパを増やして再トライ

elasticsearch.ymlで、

threadpool.bulk.queue_size: 100 // デフォルト50

結果:ES内データ2068221 (Mysqlのデータ2068246)
惜しい・・20件くらいどっか行ってる・・ 次は、

threadpool.bulk.queue_size: 130 // デフォルト50

でトライ
結果:ES内データ2068246(Mysqlのデータ2068246)
YAY!
ただ、途中で以下のこのエラーやっぱり出てるの気になるな・・

[99]: index [.marvel-es-1-2016.09.20], type [index_stats], id [AVdG8wYaTnsUn8dLrCLT], message [RemoteTransportException[[Avarrish][127.0.0.1:9300][indices:data/write/bulk[s][p]]]; nested: EsRejectedExecutionException[rejected execution of org.elasticsearch.transport.TransportService$4@3a0e97f2 on EsThreadPoolExecutor[bulk, queue capacity = 130, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@4c6977a4[Running, pool size = 8, active threads = 8, queued tasks = 130, completed tasks = 7362]]];]]

まぁ、データ入ったので、ちと保留