None of the configured nodes are available

I launch spring boot app that should connect with elasticsearch 5.6.1 on macos catalina with globally installed java 14 .

Elasticsearch 5.6.1 run as docker container via next command :

docker run -d --rm --name elastic_5_6_1 -p 9200:9200 -p 9300:9300 -v /Users/user1/Desktop/mcat_elastic/es:/es -e "ES_PATH_CONF=/es/config" -e "discovery.type=single-node" -e "ELASTIC_PASSWORD=test1234" -e "cluster.name=my-cluster" -e "xpack.security.enabled=false" docker.elastic.co/elasticsearch/elasticsearch:5.6.1

/Users/user1/Desktop/mcat_elastic/es contains folder with name config which store elasticsearch.yml. elasticsearch.yml content is next :

cluster.name: my-cluster

http.port: 9200

path: data: /es/data logs: /es/logs

After start up container in browser on port localhost:9200 I view next :

{ name: "AUaTApX", cluster_name: "my-cluster", cluster_uuid: "yaCjhne4Ry27Ua3Xo2fQVg", version: { number: "5.6.1", build_hash: "667b497", build_date: "2017-09-14T19:22:05.189Z", build_snapshot: false, lucene_version: "6.6.1" }, tagline: "You Know, for Search" }

Then I launch Spring Boot App with version of parent starter 2.2.7.RELEASE.application.yaml properties for connection with elastick container is next :

elasticsearch.clustername=my-cluster

elasticsearch.host=localhost

elasticsearch.port=9300

During execution I get error in console :

org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{VBF0z8OiRYqBpuoNcqI5NQ}{localhost}{127.0.0.1:9300}]

I dont understand how to fix it.Please help.

According to the Spring Boot documentation version 2.2.7 is using Elasticsearch version 6.8.8. While this is not a recommended setup, this setup should theoretically work. I just tried it on my machine with a normal transport client and it was able to connect to the cluster. I think the problem is most likely with how the client is getting created in Spring Boot App. So I would need to take a look at the app itself to provide any help here.

1 Like

Adding to Igor's answer that, as it seems you are starting here a new project, you should use 7.12.1 which is the latest version we released.

5.x is no longer supported.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.