1

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

Harry
  • 3,072
  • 6
  • 43
  • 100
  • hello @Harry Could you clarify that you have whitelisted the `elasticsearch 5.5.'s` *host* and *port* details in `elasticsearch 7.8's` *elasticsearch.yml* file? Were you able to perform reindex for sample doc via kibana? – Kamal Kunjapur Jul 14 '20 at 13:15
  • 1
    Lemme know once you are online. I have been able to reindex via API from sample docs from ES5.5. to ES7.7 on my local machine. – Kamal Kunjapur Jul 14 '20 at 14:17
  • @OpsterESNinja-Kamal It happens only for data with huge datasize, I have 64000 entries in which, It copies approximately 30000 entries then it fails with the above exception – Harry Jul 15 '20 at 02:33
  • Sure, thanks for clarifying. I'll test and let you know. Just final question, did you happen to notice the time it took before the connection got closed? – Kamal Kunjapur Jul 15 '20 at 03:29
  • @OpsterESNinja-Kamal, Could you help me with this : https://stackoverflow.com/questions/62942422/elasticsearch-analyzer-for-parsing-the-application-logs – Harry Jul 16 '20 at 19:46

0 Answers0