Name or service not known

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
second node logs: https://gist.github.com/sintonag/d2443267154a485f33f1f7c18d073e30

Node 1 yaml file

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

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?

I'd try this:

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

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?

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?

@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
node-b: https://gist.github.com/sintonag/15a66f9c0561db75fa87b1e1b5b35a9e

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:

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

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

Yes! It worked. Thank you.