Failed to load elasticsearch nodes

hi,
i have setup elasticsearch 5.6.3 using docker but when i am trying to access that using my local spring application i am getting below error:

" failed to load elasticsearch nodes : org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{AgKeBNJlTWWIftiNKbT3GA}{127.0.0.1}{127.0.0.1:9300}]"

can anyone pls help me with this error

only doing a wild guess here based on the sparse information without providing any configuration details (please add those for further debugging): If you are using docker, probably your elasticsearch cluster is not available at 127.0.0.1 from your application?

Docker-compose yaml:

version: '2.2'

services:

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.3
build:
context: .
dockerfile: ./Dockerfile
container_name: elasticsearch
environment:
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- esdata1:/usr/share/elasticsearch/data
ports:
- 9200:9200

kibana:
image: docker.elastic.co/kibana/kibana:5.6.3
container_name: kibana
environment:
ELASTICSEARCH_URL: "http://elasticsearch:9200"
ports:
- 5601:5601
depends_on:
- elasticsearch

volumes:
esdata1:
driver: local

spring application.properties:

spring.data.elasticsearch.cluster-name=docker-cluster
spring.data.elasticsearch.cluster-nodes=localhost:9300
server.port=3333

any other configuration file needed

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