Elasticsearch:批量执行失败

时间:2017-12-27 04:15:44

标签: elasticsearch elasticsearch-x-pack

在安装xpack之前,我能够批量索引文档。安装xpack后,我收到了failure in bulk execution:。我正在使用java客户端xpack

<dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>x-pack-transport</artifactId>
        <version>5.5.1</version>
 </dependency>

并通过

连接到ES服务器
client = new PreBuiltXPackTransportClient(Settings.builder()
.put("cluster.name", "name")
.put("xpack.security.user", "user:pass")
.build())
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("ip"), 9300));

和批量索引

    try {
    BulkResponse r = bulkRequest.get();
   System.out.println("number of actions : 
   "+bulkRequest.numberOfActions()); // prints 29
    System.out.println(r.buildFailureMessage()); // prints failure in bulk 
     execution:
    for(BulkItemResponse a : r.getItems()){
    System.out.println("failure message : "+a.getFailureMessage()); //failure message : null
    System.out.println("response : "+a.getResponse()); // prints response : IndexResponse[index=bigmart_bill_store_id,type=bill_store_id,id=AWCWJzhqNaFB56dBfQnX,version=1,result=created,shards={"total":2,"successful":1,"failed":0}]
    System.out.println("failure : "+a.getFailure()); // prints failure message : null
    }
    new ConfigureES().client.close();
    } catch (Exception we) {
    we.printStackTrace();
    }

这个代码在安装xpack之前工作正常。现在它给了我error.I没有得到任何异常或任何错误堆栈跟踪,我不能批量索引
我将提供调试此错误所需的任何信息

0 个答案:

没有答案