# Puppet elasticsearch nodes not discovering each other

**URL:** <https://discuss.elastic.co/t/puppet-elasticsearch-nodes-not-discovering-each-other/83915>\
**Category:** Elasticsearch\
**Created:** [April 27, 2017, 5:42pm UTC](https://discuss.elastic.co/t/puppet-elasticsearch-nodes-not-discovering-each-other/83915 "2017-04-27T17:42:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![corywink](https://avatars.discourse-cdn.com/v4/letter/c/6bbea6/32.png) [@corywink](https://discuss.elastic.co/u/corywink)\
**Post date:** [April 27, 2017, 5:42pm UTC](https://discuss.elastic.co/t/puppet-elasticsearch-nodes-not-discovering-each-other/83915/1 "2017-04-27T17:42:39Z")

</div>

Hello, I am using puppet to set up an elasticsearch cluster and I am having some problems getting the nodes to discover each other. I am using Puppet 4.5.2 and the elastic/elasticsearch module 5.1.1. Here is my puppet class for the elasticsearch nodes:

`class profile::elasticsearch {`  
`class { 'elasticsearch':`  
`manage_repo => true,`  
`repo_version => '5.x',`  
`restart_on_change => true,`  
`autoupgrade => true,`  
`}`

`elasticsearch::instance { hiera('es_instance', 'default_instance'):`  
`config => {`  
`'discovery.zen.ping.unicast.hosts' => ["es-node1-hostname", "es-node1-hostname", "es-node1-hostname"],`  
`'cluster.name' => 'build-staging',`  
`}`  
`}`  
`}`

I have taken out the actual hostnames of the nodes shown here but I have their fqdn in my code.

When the catalog is applied to the nodes elasticsearch is installed correctly but the nodes do not connect to one another.  
When I run `curl -XGET 'http://localhost:9200/_cluster/state?pretty'` on each node they each show the cluster name as 'build-staging' but the cluster uuids are different and they each only show one node in the cluster. What am I doing wrong here? Am I setting the discovery hosts correctly through puppet? Thanks for the help!

---

<div class="post-metadata">

**Author:** ![tylerjl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylerjl/32/44965_2.png) [@tylerjl](https://discuss.elastic.co/u/tylerjl)\
**Post date:** [April 28, 2017, 4:40pm UTC](https://discuss.elastic.co/t/puppet-elasticsearch-nodes-not-discovering-each-other/83915/2 "2017-04-28T16:40:53Z")

</div>

Hi @corywink,

There's a few things to consider with your nodes' configuration:

- [By default, Elasticsearch 5 will bind to localhost](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html#common-network-settings). You'll probably need to make changes to the `network.host` setting to ensure Elasticsearch is listening for all external connections.
- If you want to avoid letting the nodes come online without successfully forming a cluster, you may want to read up on the [`minimum_master_nodes`](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-zen.html#master-election) setting (and [how it helps to avoid split-brain](https://www.elastic.co/guide/en/elasticsearch/guide/1.x/_important_configuration_changes.html#_minimum_master_nodes)).

I'd also check out your logfiles, which may include messages about being unable to connect to your other nodes if they are indeed not listening on an externally resolvable IP.

---

<div class="post-metadata">

**Author:** ![corywink](https://avatars.discourse-cdn.com/v4/letter/c/6bbea6/32.png) [@corywink](https://discuss.elastic.co/u/corywink)\
**Post date:** [April 28, 2017, 5:20pm UTC](https://discuss.elastic.co/t/puppet-elasticsearch-nodes-not-discovering-each-other/83915/3 "2017-04-28T17:20:46Z")

</div>

Thanks @tylerjl ,

The network.host setting is what fixed it! I just needed to set that to '0.0.0.0' to listen for all ips.

---

<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:** [May 26, 2017, 5:27pm UTC](https://discuss.elastic.co/t/puppet-elasticsearch-nodes-not-discovering-each-other/83915/4 "2017-05-26T17:27:44Z")

</div>

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