I try to write test using elasticsearch container. I run it with https://www.testcontainers.org/ library. That's my configuration:
@ClassRule
public static GenericContainer elasticContainer =
new GenericContainer("docker.elastic.co/elasticsearch/elasticsearch:5.3.0")
.withExposedPorts(9300, 9200)
.withEnv("xpack.security.enabled", "false")
.withEnv("transport.host", "127.0.0.1")
.withEnv("http.host", "0.0.0.0");
And I got an exception:
org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{9fuJUZYWS6O6IgLGOgJDaA}{localhost}{127.0.0.1:32792}]
I reconfigured my ports for test and 9200 port is available (on the port that mapped by testcontainers) - I checked it by curl. But 9300 is not.
Does anybody knows how to fix transport host problem?