问题
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