Elasticsearch: java.net.UnknownHostException using sample docker-compose.yml from docs

Created on 19 Jan 2020  路  5Comments  路  Source: elastic/elasticsearch

Hi,

I'm trying to run the sample docker compose for 3 nodes,
and I'm getting java.net.UnknownHostException: es01 error

Steps to reproduce:

  1. go to Install Elasticsearch with Docker
  2. copy the contests of the docker compose file to a new docker-compose.yml
  3. run docker-compose up
es02    | {"type": "server", "timestamp": "2020-01-19T13:45:33,839Z", "level": "WARN", "component": "o.e.d.SeedHostsResolver", "cluster.name": "es-docker-cluster", "node.name": "es02", "message": "failed to resolve host [es03]", 
es02    | "stacktrace": ["java.net.UnknownHostException: es03: Name or service not known",
es02    | "at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method) ~[?:?]",
es02    | "at java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:930) ~[?:?]",
es02    | "at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1499) ~[?:?]",
es02    | "at java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:849) ~[?:?]",
es02    | "at java.net.InetAddress.getAllByName0(InetAddress.java:1489) ~[?:?]",
es02    | "at java.net.InetAddress.getAllByName(InetAddress.java:1348) ~[?:?]",
es02    | "at java.net.InetAddress.getAllByName(InetAddress.java:1282) ~[?:?]",
es02    | "at org.elasticsearch.transport.TcpTransport.parse(TcpTransport.java:528) ~[elasticsearch-7.5.1.jar:7.5.1]",
es02    | "at org.elasticsearch.transport.TcpTransport.addressesFromString(TcpTransport.java:470) ~[elasticsearch-7.5.1.jar:7.5.1]",
es02    | "at org.elasticsearch.transport.TransportService.addressesFromString(TransportService.java:803) ~[elasticsearch-7.5.1.jar:7.5.1]",
es02    | "at org.elasticsearch.discovery.SeedHostsResolver.lambda$resolveHostsLists$0(SeedHostsResolver.java:144) ~[elasticsearch-7.5.1.jar:7.5.1]",
es02    | "at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]",
es02    | "at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:703) ~[elasticsearch-7.5.1.jar:7.5.1]",
es02    | "at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]",
es02    | "at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]",
es02    | "at java.lang.Thread.run(Thread.java:830) [?:?]"] }
:DeliverPackaging Delivery

Most helpful comment

@FLasH3r can you provide some more information about your system? E.g. OS, memory, Docker version.

If you're using Docker Desktop (e.g. on Mac OS or Windows), please make sure that the Docker Engine has at least 4GB of RAM, or some of the Elasticsearch instances can fail to start. If any of the containers exit with 137, that could indicate a lack of memory.

All 5 comments

Pinging @elastic/es-core-infra (:Core/Infra/Packaging)

I get the same error, however, things seem to work once I remove es03 altogether from docker-compose.yml file and run only with two nodes.

@FLasH3r can you provide some more information about your system? E.g. OS, memory, Docker version.

If you're using Docker Desktop (e.g. on Mac OS or Windows), please make sure that the Docker Engine has at least 4GB of RAM, or some of the Elasticsearch instances can fail to start. If any of the containers exit with 137, that could indicate a lack of memory.

I should add that that the example from the documentation works for me using Docker Desktop on Mac with 4GB RAM.

Sorry for the late response, yes - increasing the memory in Docker Desktop solved this issue.
Tested this by changing the memory size back and forth to see that every time I set it to 4GB or above it doesn't fail.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rjernst picture rjernst  路  3Comments

makeyang picture makeyang  路  3Comments

DhairyashilBhosale picture DhairyashilBhosale  路  3Comments

ttaranov picture ttaranov  路  3Comments

brwe picture brwe  路  3Comments