我正在使用Java客户端(从5.5到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());
}
其中切片-1,滚动-10并且批处理大小为100
我收到以下错误消息,
UncategorizedExecutionException[Failed execution]; nested: IOException[Connection is closed]
让我知道,如果我需要调整任何特定内容以避免此异常。
谢谢, 哈里