ElasticSearch 2.0 Transport Client - No Node Available exception

后端 未结 3 1651
Happy的楠姐
Happy的楠姐 2021-01-27 01:22

[Using ElasticSearch version 2.0]

In etc/hosts file \"esnode\" is mapped to IP address(some other machine where ES is running) as shown

192.168.2.219 esnode

相关标签:
3条回答
  • 2021-01-27 02:15

    Other reason could be, your Elasticsearch Java client is a different version from your Elasticsearch server.

    Elasticsearch Java client version is nothing but your elasticsearch jar version in your code base.

    For example: In my code it's elasticsearch-2.4.0.jar

    To verify Elasticsearch server version,

    $ /Users/kkolipaka/elasticsearch/bin/elasticsearch -version Version: 5.2.2, Build: f9d9b74/2017-02-24T17:26:45.835Z, JVM: 1.8.0_111

    As you can see, I've downloaded latest version of Elastic server 5.2.2 but forgot to update the ES Java API client version 2.4.0 https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/client.html

    0 讨论(0)
  • 2021-01-27 02:21

    Setup elasticsearch host ip address to network.host value in elasticsearch.yml

    network.host: es_host_ip

    This is solve TransportClient NoNodeAvailableException issue.

    0 讨论(0)
  • 2021-01-27 02:21

    Check if your elasticsearch server have also version 2.0, if no, upgrade. Client and server must have the same version to work, I don't know why but this solved my problem.

    Cheers,

    0 讨论(0)
提交回复
热议问题