0

So for whatever reason, I am trying to run a simple java app to create a brand new index from another index ("myindex") to fix up some of the data but it seems to crash and say "could not find search context id=5322" and it says different ids for EACH shard (each node?).

I have 3 nodes. 3 servers with elasticsearch running.

I followed example here:

https://www.elastic.co/guide/en/elasticsearch/client/java-api/5.4/java-search-scrolling.html

And made sure I had 65K limit:

https://www.elastic.co/guide/en/elasticsearch/reference/5.4/file-descriptors.html

main(String[] args){
final TimeValue keepAlive = TimeValue.timeValueSeconds(90L);

SearchResponse scrollResp = client.prepareSearch("myindex").setScroll(keepAlive)
                    .setSize(100).get();

    do
    {
        for(SearchHit hit : scrollResp.getHits().getHits())
        {
        i++;
        // do something here to prepare data for later rewriting to new index
        }
      scrollResp = client.prepareSearchScroll(scrollResp.getScrollId())
                        .setScroll(keepAlive)
                        .execute().actionGet();
    } while(scrollResp.getHits().getHits().length != 0);
    System.out.println("Storing entries...");
    /// store some of this info
 }

I paraphrased the error:

SearchContextMissingException, Caused by: org.elasticsearch.search.SearchContextMissingException: No search context found for id [5031530] at org.elasticsearch.search.SearchService.findContext(SearchService.java:480) at org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:450)

can't find id=45233 in node-2... inner exception: can't find id=52363 node-3

Dexter
  • 6,170
  • 18
  • 74
  • 101

1 Answers1

0

So I haven't isolated the problem, but the problem was fixed due to possible reasons:

  1. memlock set to true in elasticsearch.yml on ALL 3 NODE SERVERS
  2. nofile lock set to true in elasticsearch.yml on all 3 node servers
  3. full replication on all 3 node servers temporarily.
Dexter
  • 6,170
  • 18
  • 74
  • 101