Failed to connect to Dockerized elasticsearch via java-client
If you set "client.transport.sniff"
to false
it should work.
If you still want to use sniffing follow next instructions:https://github.com/olivere/elastic/wiki/Docker
Detailed discussion here: https://github.com/olivere/elastic/issues/57#issuecomment-88697714
This works for me (in docker-compose.yml).
version: "2"services: elasticsearch5: image: docker.elastic.co/elasticsearch/elasticsearch:5.5.3 container_name: elasticsearch5 environment: - cluster.name=elasticsearch5-cluster - http.host=0.0.0.0 - network.publish_host=127.0.0.1 - transport.tcp.port=9700 - discovery.type=single-node - xpack.security.enabled=false ports: - "9600:9200" - "9700:9700"
Specifying network.publish_host and transport.tcp.port seems to do the trick. And sniff=true still works.