# java.net.UnknownHostException/Name or service not known/failed to resolve host

**URL:** <https://discuss.elastic.co/t/java-net-unknownhostexception-name-or-service-not-known-failed-to-resolve-host/334920>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [June 1, 2023, 7:43am UTC](https://discuss.elastic.co/t/java-net-unknownhostexception-name-or-service-not-known-failed-to-resolve-host/334920 "2023-06-01T07:43:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sundeep\_Teja\_Polina](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sundeep_teja_polina/32/121717_2.png) [@Sundeep\_Teja\_Polina](https://discuss.elastic.co/u/Sundeep_Teja_Polina)\
**Post date:** [June 1, 2023, 7:43am UTC](https://discuss.elastic.co/t/java-net-unknownhostexception-name-or-service-not-known-failed-to-resolve-host/334920/1 "2023-06-01T07:43:00Z")

</div>

Hi

I'm trying to deploy a self-managed containerized multinode Elasticsearch cluster in aws ecs. I was able to deploy and use a single node Elasticsearch cluster inside aws ecs. When I'm trying to host the same in multinode approach in aws ecs, The master & the data node are throwing the above-mentioned errors and I'm not sure what I'm missing here. I tried using multiple containers in the same service and also 2 different services for different nodes. Can anyone help here to make me understand where i'm going wrong so that I can get this working.

Please find the task definition I'm using below:

{  
"family": "elasticsearchmultinode",  
"containerDefinitions": [  
{  
"name": "elasticsearch-master",  
"image": "[docker.elastic.co/elasticsearch/elasticsearch:7.10.2](http://docker.elastic.co/elasticsearch/elasticsearch:7.10.2)",  
"cpu": 1024,  
"memory": 2048,  
"portMappings": [  
{  
"name": "elasticsearch-master-9200-tcp",  
"containerPort": 9200,  
"hostPort": 9200,  
"protocol": "tcp"  
}  
],  
"essential": true,  
"environment": [  
{  
"name": "discovery.seed\_hosts",  
"value": "es02"  
},  
{  
"name": "cluster.name",  
"value": "docker-cluster"  
},  
{  
"name": "cluster.initial\_master\_nodes",  
"value": "es01,es02"  
},  
{  
"name": "ES\_JAVA\_OPTS",  
"value": "-Xms2g -Xmx2g"  
},  
{  
"name": "node.name",  
"value": "es01"  
},  
{  
"name": "bootstrap.memory\_lock",  
"value": "true"  
},  
{  
"name": "node.roles",  
"value": "master"  
}  
],  
"mountPoints": ,  
"volumesFrom": ,  
"ulimits": [  
{  
"name": "nofile",  
"softLimit": 65535,  
"hardLimit": 65535  
},  
{  
"name": "memlock",  
"softLimit": -1,  
"hardLimit": -1  
}  
],  
"logConfiguration": {  
"logDriver": "awslogs",  
"options": {  
"awslogs-group": "c2dev1pop1-esmultinode-logs",  
"awslogs-region": "us-east-1",  
"awslogs-stream-prefix": "elasticsearch-master"  
}  
}  
},  
{  
"name": "elasticsearch-data",  
"image": "[docker.elastic.co/elasticsearch/elasticsearch:7.10.2](http://docker.elastic.co/elasticsearch/elasticsearch:7.10.2)",  
"cpu": 1024,  
"memory": 2048,  
"portMappings": ,  
"essential": true,  
"environment": [  
{  
"name": "discovery.seed\_hosts",  
"value": "es01"  
},  
{  
"name": "cluster.name",  
"value": "docker-cluster"  
},  
{  
"name": "cluster.initial\_master\_nodes",  
"value": "es01,es02"  
},  
{  
"name": "ES\_JAVA\_OPTS",  
"value": "-Xms2g -Xmx2g"  
},  
{  
"name": "node.name",  
"value": "es02"  
},  
{  
"name": "bootstrap.memory\_lock",  
"value": "true"  
},  
{  
"name": "node.roles",  
"value": "data"  
}  
],  
"mountPoints": ,  
"volumesFrom": ,  
"dependsOn": [  
{  
"containerName": "elasticsearch-master",  
"condition": "START"  
}  
],  
"ulimits": [  
{  
"name": "nofile",  
"softLimit": 65535,  
"hardLimit": 65535  
},  
{  
"name": "memlock",  
"softLimit": -1,  
"hardLimit": -1  
}  
],  
"logConfiguration": {  
"logDriver": "awslogs",  
"options": {  
"awslogs-group": "c2dev1pop1-esmultinode-logs",  
"awslogs-region": "us-east-1",  
"awslogs-stream-prefix": "elasticsearch-data"  
}  
}  
}  
],  
"executionRoleArn": "arn:aws:iam::xxxxxxxxxxxx:role/ecsTaskExecutionRole",  
"networkMode": "awsvpc",  
"requiresCompatibilities": [  
"EC2"  
],  
"cpu": "2048",  
"memory": "4096"  
}

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 1, 2023, 7:59am UTC](https://discuss.elastic.co/t/java-net-unknownhostexception-name-or-service-not-known-failed-to-resolve-host/334920/2 "2023-06-01T07:59:11Z")

</div>

> [@Sundeep\_Teja\_Polina](#):
>
> "image": "[docker.elastic.co/elasticsearch/elasticsearch:7.10.2](http://docker.elastic.co/elasticsearch/elasticsearch:7.10.2)",

If you are deploying a new cluster, why are you using such an old version that has been EOL for a long time?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 29, 2023, 7:59am UTC](https://discuss.elastic.co/t/java-net-unknownhostexception-name-or-service-not-known-failed-to-resolve-host/334920/3 "2023-06-29T07:59:20Z")

</div>

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