小编Nil*_*ana的帖子

带有NEST的Elasticsearch批量插入返回es_rejected_execution_exception

我正在尝试使用.Net APIin 进行批量插入Elasticsearch,这是我在执行操作时得到的错误;

Error   {Type: es_rejected_execution_exception Reason: "rejected execution of org.elasticsearch.transport.TransportService$6@604b47a4 on EsThreadPoolExecutor[bulk, queue capacity = 50, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@51f4f734[Running, pool size = 4, active threads = 4, queued tasks = 50, completed tasks = 164]]" CausedBy: ""}   Nest.BulkError
Run Code Online (Sandbox Code Playgroud)

是因为我的系统空间不足还是批量插入功能本身不起作用?我的NEST版本是5.0,Elasticsearch版本也是5.0.

批量插入逻辑的代码;

public void bulkInsert(List<BaseData> recordList, List<String> listOfIndexName) {
    BulkDescriptor descriptor = new BulkDescriptor();            
    foreach (var j in Enumerable.Range(0, recordList.Count)) {
        descriptor.Index<BaseData>(op => op.Document(recordList[j])
                                           .Index(listOfIndexName[j]));
    }
    var result = clientConnection.Bulk(descriptor);
}
Run Code Online (Sandbox Code Playgroud)

bulkinsert elasticsearch nest

1
推荐指数
1
解决办法
1416
查看次数

标签 统计

bulkinsert ×1

elasticsearch ×1

nest ×1