# Name or service not known

**URL:** https://discuss.elastic.co/t/name-or-service-not-known/284831
**Category:** Elasticsearch
**Created:** [September 22, 2021, 9:31am UTC](https://discuss.elastic.co/t/name-or-service-not-known/284831 "2021-09-22T09:31:58Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![mahalanobis](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mahalanobis](https://discuss.elastic.co/u/mahalanobis)
#### Post date: [September 22, 2021, 9:31am UTC](https://discuss.elastic.co/t/name-or-service-not-known/284831/1 "2021-09-22T09:31:58Z")

</div>

I'm trying to setup an Elasticsearch cluster but I'm getting "Name or service not known"

Below you can find configuration and logs

first node logs: [https://gist.github.com/sintonag/d6ee4e4c68084a0941c28afcf251b519](https://gist.github.com/sintonag/d6ee4e4c68084a0941c28afcf251b519)  
second node logs: [https://gist.github.com/sintonag/d2443267154a485f33f1f7c18d073e30](https://gist.github.com/sintonag/d2443267154a485f33f1f7c18d073e30)

Node 1 yaml file

```auto
cluster.name: es-cluster
node.name: es-a
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: xx.xxx.xxx.xx
discovery.seed_hosts:
        - yy.yyy.yyy.yy
cluster.initial_master_nodes:
        - es-a
        - es-b

```

Node 2 yaml file

```auto
cluster.name: es-cluster
node.name: es-b
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: yy.yyy.yyy.yy
discovery.seed_hosts:
        - xx.xxx.xxx.xx
cluster.initial_master_nodes:
        - es-a
        - es-b

```

If the problem is related to ports, how can I override port 9300 in the Elasticsearch.yml file?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [September 22, 2021, 12:31pm UTC](https://discuss.elastic.co/t/name-or-service-not-known/284831/2 "2021-09-22T12:31:05Z")

</div>

I'd try this:

```auto
cluster.initial_master_nodes:
        - xx.xxx.xxx.xx
        - yy.yyy.yyy.yy

```

---

<div class="post-metadata">

### Author: ![mahalanobis](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mahalanobis](https://discuss.elastic.co/u/mahalanobis)
#### Post date: [September 23, 2021, 9:52am UTC](https://discuss.elastic.co/t/name-or-service-not-known/284831/3 "2021-09-23T09:52:10Z")

</div>

Still I cannot setup the cluster. I tried your suggestion.  
On logs I don't see any errors.

Are the changes I make to Elasticsearch.yml applied? I just stop and start the service every time I change something.

Also, I would like to override the default ports 9200 and 9300. How can I do that?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [September 23, 2021, 11:59am UTC](https://discuss.elastic.co/t/name-or-service-not-known/284831/4 "2021-09-23T11:59:26Z")

</div>

Please share the full logs after the change.

> Also, I would like to override the default ports 9200 and 9300. How can I do that?

Why would you do that?

---

<div class="post-metadata">

### Author: ![mahalanobis](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mahalanobis](https://discuss.elastic.co/u/mahalanobis)
#### Post date: [September 24, 2021, 8:52am UTC](https://discuss.elastic.co/t/name-or-service-not-known/284831/5 "2021-09-24T08:52:37Z")

</div>

@dadoonet I have the impression nodes cannot communicate so I was thinking to change the ports

Anyway, I'm posting the logs

node-a: [https://gist.github.com/sintonag/c61acbcad418616e49a28c3c95a6117b](https://gist.github.com/sintonag/c61acbcad418616e49a28c3c95a6117b)  
node-b: [https://gist.github.com/sintonag/15a66f9c0561db75fa87b1e1b5b35a9e](https://gist.github.com/sintonag/15a66f9c0561db75fa87b1e1b5b35a9e)

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [September 28, 2021, 11:48am UTC](https://discuss.elastic.co/t/name-or-service-not-known/284831/6 "2021-09-28T11:48:39Z")

</div>

Could you stop the nodes, remove the content of the data dir (`/var/lib/elasticsearch`) for each node (I guess you don't have any data yet) and the restart node 1, then node 2.

Here is what I would write as the settings for both nodes:

```auto
cluster.name: es-cluster
node.name: es-a # (or es-b)
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
discovery.seed_hosts:
   - xx.xxx.xxx.xx
   - yy.yyy.yyy.yy
cluster.initial_master_nodes: 
   - es-a
   - es-b

```

If it does not work, I'd try to stop again, remove the data dir and restart with the following config

```auto
cluster.name: es-cluster
node.name: es-a # (or es-b)
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
discovery.seed_hosts:
   - xx.xxx.xxx.xx
   - yy.yyy.yyy.yy
cluster.initial_master_nodes: 
   - xx.xxx.xxx.xx
   - yy.yyy.yyy.yy

```

---

<div class="post-metadata">

### Author: ![mahalanobis](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mahalanobis](https://discuss.elastic.co/u/mahalanobis)
#### Post date: [September 29, 2021, 12:29pm UTC](https://discuss.elastic.co/t/name-or-service-not-known/284831/7 "2021-09-29T12:29:50Z")

</div>

Yes! It worked. Thank you.

---

<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: [October 27, 2021, 12:30pm UTC](https://discuss.elastic.co/t/name-or-service-not-known/284831/8 "2021-10-27T12:30:40Z")

</div>

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