# Unable to connect one elasticsearch master pod to another pod to setup two node cluster

**URL:** <https://discuss.elastic.co/t/unable-to-connect-one-elasticsearch-master-pod-to-another-pod-to-setup-two-node-cluster/344915>\
**Category:** Elasticsearch\
**Created:** [October 12, 2023, 12:26pm UTC](https://discuss.elastic.co/t/unable-to-connect-one-elasticsearch-master-pod-to-another-pod-to-setup-two-node-cluster/344915 "2023-10-12T12:26:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Santhosh\_Sekar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/santhosh_sekar/32/126488_2.png) [@Santhosh\_Sekar](https://discuss.elastic.co/u/Santhosh_Sekar)\
**Post date:** [October 12, 2023, 12:26pm UTC](https://discuss.elastic.co/t/unable-to-connect-one-elasticsearch-master-pod-to-another-pod-to-setup-two-node-cluster/344915/1 "2023-10-12T12:26:55Z")

</div>

Hello Team,

I am trying to setup two node es cluster in k8s.

Issue that i am facing is that es-1 could not elect that as master and could not connect to another pod

es-2.yml file

```auto
   cluster.name: "elastic.cluster"
    network.host: _site_
    #http.host: 0.0.0.0
    node.name: "es-2-0"
    node.master: false
    node.data: true
    node.ingest: false
    discovery.seed_hosts: ["es-2-0","es-clusterip-svc-1.bat-aws-namespace-1.svc.cluster.local"]
    cluster.initial_master_nodes: ["es-clusterip-svc-1.bat-aws-namespace-1.svc.cluster.local"]
    #transport.host: 0.0.0.0
    #network.bind_host: 0.0.0.0
    #network.publish_host: es-clusterip-svc-2.bat-aws-namespace-1.svc.cluster.local
    path.data: /usr/share/elasticsearch/data
    bootstrap.memory_lock: true
    #node.roles: master
    xpack.license.self_generated.type: basic
    #Enable xpack.security which is provided in basic subscription
    xpack.security.enabled: true
    #Disable unused xpack features
    xpack.monitoring.enabled: true
    xpack.graph.enabled: true
    xpack.watcher.enabled: true
    xpack.ml.enabled: true
    logger.org.elasticsearch.cluster.coordination.ClusterBootstrapService: TRACE
    logger.org.elasticsearch.discovery: TRACE

```

es-1.yml file

````auto
 cluster.name: "elastic.cluster"
   network.host: _site_
   #http.host: 0.0.0.0
   node.name: "es-1-0"
   node.master: true
   node.data: false
   node.ingest: false
   discovery.seed_hosts: ["es-1-0","es-clusterip-svc-2.bat-aws-namespace-1.svc.cluster.local"]
   cluster.initial_master_nodes: ["es-1-0","es-clusterip-svc-2.bat-aws-namespace-1.svc.cluster.local"]
   #transport.host: 0.0.0.0
   #network.bind_host: 0.0.0.0
   #network.publish_host: es-clusterip-svc-1.bat-aws-namespace-1.svc.cluster.local
   path.data: /usr/share/elasticsearch/data
   bootstrap.memory_lock: true
   #node.roles: master
   xpack.license.self_generated.type: basic
   #Enable xpack.security which is provided in basic subscription
   xpack.security.enabled: true
   #Disable unused xpack features
   xpack.monitoring.enabled: true
   xpack.graph.enabled: true
   xpack.watcher.enabled: true
   xpack.ml.enabled: true
   logger.org.elasticsearch.cluster.coordination.ClusterBootstrapService: TRACE
   logger.org.elasticsearch.discovery: TRACE```

I am getting below error as 

````

de.name": "es-1-0", "message": "initialized" }  
{"type": "server", "timestamp": "2023-10-12T12:21:28,286Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "elastic.cluster", "node.name": "es-1-0", "message": "starting ..." }  
{"type": "server", "timestamp": "2023-10-12T12:21:28,729Z", "level": "INFO", "component": "o.e.t.TransportService", "cluster.name": "elastic.cluster", "node.name": "es-1-0", "message": "publish\_address {10.42.0.99:9300}, bound\_addresses {10.42.0.99:9300}" }  
{"type": "server", "timestamp": "2023-10-12T12:21:29,260Z", "level": "INFO", "component": "o.e.b.BootstrapChecks", "cluster.name": "elastic.cluster", "node.name": "es-1-0", "message": "bound or publishing to a non-loopback address, enforcing bootstrap checks" }  
ERROR: [2] bootstrap checks failed  
[1]: memory locking requested for elasticsearch process but memory is not locked  
[2]: max virtual memory areas vm.max\_map\_count [65530] is too low, increase to at least [262144]  
ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/elastic.cluster.log

```auto

But when i change network.host: 127.0.0.1 bootstrap setting is getting passed but es-1 is not getting connected with es-2.

i have learned some setting of transport.host and http.host but could not resolve this issue.

If anyone have suggestion please let me know.

Thanks in advance
```

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [October 12, 2023, 12:50pm UTC](https://discuss.elastic.co/t/unable-to-connect-one-elasticsearch-master-pod-to-another-pod-to-setup-two-node-cluster/344915/2 "2023-10-12T12:50:30Z")

</div>

> [@Santhosh\_Sekar](#):
>
> [2]: max virtual memory areas vm.max\_map\_count [65530] is too low, increase to at least [262144]

You need to fix this before, I do not use k8s, but here is some [documentation](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-virtual-memory.html#k8s-virtual-memory) on how to fix that on ECK, you may need to adapt to your infrastructure if you are not using ECK.

> [@Santhosh\_Sekar](#):
>
> But when i change network.host: 127.0.0.1 bootstrap setting is getting passed

This is expected, the bootstrap checks are triggered when you set `network.host` to something different from `127.0.0.1`, which means you are going to production.

---

<div class="post-metadata">

**Author:** ![Santhosh\_Sekar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/santhosh_sekar/32/126488_2.png) [@Santhosh\_Sekar](https://discuss.elastic.co/u/Santhosh_Sekar)\
**Post date:** [October 12, 2023, 2:23pm UTC](https://discuss.elastic.co/t/unable-to-connect-one-elasticsearch-master-pod-to-another-pod-to-setup-two-node-cluster/344915/3 "2023-10-12T14:23:18Z")

</div>

Hi,  
max virtual memory areas vm.max\_map\_count [65530] is too low, increase to at least [262144]  
i have commands in post start to increase vm.max\_map\_count value.  
If container successfully stated those values would be set.

---

<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:** [November 9, 2023, 2:23pm UTC](https://discuss.elastic.co/t/unable-to-connect-one-elasticsearch-master-pod-to-another-pod-to-setup-two-node-cluster/344915/4 "2023-11-09T14:23:35Z")

</div>

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