UncategorizedExecutionException[Failed execution]; nested: IOException[Connection is closed] - ElasticSearch

人走茶凉 提交于 2020-07-22 05:13:29

问题


I am running the reindex using the Java client from 5.5 to 7.8

ReindexRequestBuilder reIndexRequest = new ReindexRequestBuilder(client, ReindexAction.INSTANCE);

        // Basic configuration
        reIndexRequest.source(indexObject.getSourceIndex());
        reIndexRequest.destination(indexObject.getDestinationIndex());

if (reIndex.getMaxretry() != 0) {
            reIndexRequest.setMaxRetries(reIndex.getMaxretry());
        }
        // OpType
        if (!CommonUtils.isEmpty(reIndex.getOptype())) {
            reIndexRequest.request().setDestOpType(reIndex.getOptype());
        }
        // Script
        if (!CommonUtils.isEmpty(reIndex.getScript())) {
            reIndexRequest.script(new Script(reIndex.getScript()));
        }
        // Conflicts
        reIndexRequest.abortOnVersionConflict(false);
        if (reIndex.isAbortonconflict()) {
            reIndexRequest.abortOnVersionConflict(reIndex.isAbortonconflict());
        }
        // Batch Size
        if (reIndex.getBatchsize() != 0) {
            reIndexRequest.request().setSourceBatchSize(reIndex.getBatchsize());
        }
        // Setting Refresh
        if (reIndex.isRefresh()) {
            reIndexRequest.refresh(reIndex.isRefresh());
        }
        // Method to set the max docs
        if (!(reIndex.getMaxdocs() <= 0)) {
            reIndexRequest.maxDocs(reIndex.getMaxdocs());
        }
        // Scroll
        if (reIndex.getScroll() != 0) {
            reIndexRequest.request().setScroll(TimeValue.timeValueMinutes(reIndex.getScroll()));
        }
        // Slice
        if (reIndex.getSlice() != 0) {
            reIndexRequest.setSlices(reIndex.getSlice());
        }

where the slice - 1, scroll - 10 and batch size is 100

I get the following error,

 UncategorizedExecutionException[Failed execution]; nested: IOException[Connection is closed]

Let me know, If I need to tune anything specific to avoid this exception.

Thanks, Harry

来源:https://stackoverflow.com/questions/62843709/uncategorizedexecutionexceptionfailed-execution-nested-ioexceptionconnectio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!