“Node Discovery Disabled” in Elastic Search

后端 未结 1 1123
陌清茗
陌清茗 2021-01-25 05:43

I used below Java code on UBUNTU and I am getting \"Node Discovery Disabled\". Because of this I am not able move forward.

Could anyone please help me out solving this

相关标签:
1条回答
  • 2021-01-25 06:08

    I am not sure what version you are using. I am using 0.1.2 and the factory I have only has a setHttpClientConfig method. So I used the HttpClientConfig instead, which extends ClientConfig. That point aside, the builder has two methods you'll want:

    • discoveryEnabled
    • discoveryFrequency

    These set node node discovery and how frequently to poll.

    HttpClientConfig httpClientConfig = new HttpClientConfig.Builder("http://localhost:9200") 
            .discoveryEnabled(true)
            .discoveryFrequency(10l, TimeUnit.SECONDS)
            .multiThreaded(true)
            .build();
    
    JestClientFactory factory = new JestClientFactory();
    factory.setHttpClientConfig(httpClientConfig);
    
    0 讨论(0)
提交回复
热议问题