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:
docker-compose upes02 | {"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) [?:?]"] }
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.
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.