# Setting up elasticsearch.yml for Discovery

**URL:** <https://discuss.elastic.co/t/setting-up-elasticsearch-yml-for-discovery/4310>\
**Category:** Elasticsearch\
**Created:** [April 28, 2011, 3:12pm UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-yml-for-discovery/4310 "2011-04-28T15:12:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thor](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@Thor](https://discuss.elastic.co/u/Thor)\
**Post date:** [April 28, 2011, 3:12pm UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-yml-for-discovery/4310/1 "2011-04-28T15:12:51Z")

</div>

Greetings for Norway!

Question for the kind folks, I am a new to ES. I am using RHEL

Here is my YML file... I have two nodes, but when they startup they are not seeing each other, and electing themselves as masters. What am I missing?

.../elasticsearch.yml

name: (IP address of node)

# Cluster Settings

cluster:  
name: \_Cluster

# Gateway Settings

#gateway:

# recover\_after\_nodes: 1

# recover\_after\_time: 5m

xpected\_nodes: 2

network:  
host: x.x.x.163 # IP address of your server

discovery:  
zen:  
ping:  
multicast:  
enabled: false  
unicast:  
hosts:["x.x.x.163:9300","x.x.x.166:9301"]

transport:  
tcp:  
port: 9300

\<---end of file--\>

I have the service wrapper installed/configured, but I start the servers up with the #./elasticsearch/bin/elasticsearch -f so I can see how it starts up.

Any tips or things I am missing? Thanks !

---

<div class="post-metadata">

**Author:** ![ofavre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ofavre/32/116819_2.png) [@ofavre](https://discuss.elastic.co/u/ofavre)\
**Post date:** [April 28, 2011, 3:30pm UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-yml-for-discovery/4310/2 "2011-04-28T15:30:12Z")

</div>

I would bet this is a port problem.  
Aren't your 2 instances listening on the same port 9300, whereas you try to  
reach the second one through the port 9301?

Pardon me if I'm saying nonsense, I am new to ES as well.

Olivier @Yakaz

2011/4/28 Thor [via Elasticsearch Users] \<  
[ml-node+2875050-61290776-393975@n3.nabble.com](mailto:ml-node+2875050-61290776-393975@n3.nabble.com)\>

> Greetings for Norway!
> 
> Question for the kind folks, I am a new to ES. I am using RHEL
> 
> Here is my YML file... I have two nodes, but when they startup they are not  
> seeing each other, and electing themselves as masters. What am I missing?
> 
> .../elasticsearch.yml
> 
> name: (IP address of node)
> 
> # Cluster Settings
> 
> cluster:  
> name: \_Cluster
> 
> # Gateway Settings
> 
> #gateway:
> 
> # recover\_after\_nodes: 1
> 
> # recover\_after\_time: 5m
> 
> xpected\_nodes: 2
> 
> network:  
> host: x.x.x.163 # IP address of your server
> 
> discovery:  
> zen:  
> ping:  
> multicast:  
> enabled: false  
> unicast:  
> hosts:["x.x.x.163:9300","x.x.x.166:9301"]
> 
> transport:  
> tcp:  
> port: 9300
> 
> \<---end of file--\>
> 
> I have the service wrapper installed/configured, but I start the servers up  
> with the #./elasticsearch/bin/elasticsearch -f so I can see how it starts  
> up.
> 
> Any tips or things I am missing? Thanks !
> 
> * * *
> 
> If you reply to this email, your message will be added to the discussion  
> below:
> 
> [http://elasticsearch-users.115913.n3.nabble.com/Setting-up-elasticsearch-yml-for-Discovery-tp2875050p2875050.html](http://elasticsearch-users.115913.n3.nabble.com/Setting-up-elasticsearch-yml-for-Discovery-tp2875050p2875050.html)  
> To start a new topic under Elasticsearch Users, email  
> [ml-node+115913-1699315842-393975@n3.nabble.com](mailto:ml-node+115913-1699315842-393975@n3.nabble.com)  
> To unsubscribe from Elasticsearch Users, click here[http://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe\_by\_code&node=115913&code=b2xpdmllckB5YWthei5jb218MTE1OTEzfDIxMjI2MTYwOTc=](http://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=115913&code=b2xpdmllckB5YWthei5jb218MTE1OTEzfDIxMjI2MTYwOTc=).

---

<div class="post-metadata">

**Author:** ![Thor](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@Thor](https://discuss.elastic.co/u/Thor)\
**Post date:** [April 28, 2011, 3:39pm UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-yml-for-discovery/4310/3 "2011-04-28T15:39:15Z")

</div>

I totally disabled my firewall to check if it was a firewall/port problem and still getting the same problem... maybe I am setting my ports up wrong in the YML file?

---

<div class="post-metadata">

**Author:** ![Thor](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@Thor](https://discuss.elastic.co/u/Thor)\
**Post date:** [April 28, 2011, 5:01pm UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-yml-for-discovery/4310/4 "2011-04-28T17:01:41Z")

</div>

Ahhhhh, I did not understand what you were saying... but now yes, I changed everything to :9300 and it finds them all now nicely!! Thanks!

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 28, 2011, 10:04pm UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-yml-for-discovery/4310/5 "2011-04-28T22:04:51Z")

</div>

Just a note, you don't have to specify the port (its optional). You can just specify the host name, and the port will be derived based on the (current node) transport settings (which default to 9300).  
On Thursday, April 28, 2011 at 8:01 PM, Thor wrote:

> Ahhhhh, I did not understand what you were saying... but now yes, I changed  
> everything to :9300 and it finds them all now nicely!! Thanks!
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Setting-up-elasticsearch-yml-for-Discovery-tp2875050p2875462.html](http://elasticsearch-users.115913.n3.nabble.com/Setting-up-elasticsearch-yml-for-Discovery-tp2875050p2875462.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![DKN](https://avatars.discourse-cdn.com/v4/letter/d/77aa72/32.png) [@DKN](https://discuss.elastic.co/u/DKN)\
**Post date:** [June 29, 2011, 11:52am UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-yml-for-discovery/4310/6 "2011-06-29T11:52:03Z")

</div>

I'm trying to setup a two node cluster .. one acting as master and the other being an additional node that can act as master if the first node goes down ..

I have installed the 0.16.2 and everything appears to be running okay on a single node .. My configuration looks like this :

============

# Cluster Settings

cluster:  
name: elasticsearch

# Gateway Settings

gateway:  
recover\_after\_nodes: 1  
recover\_after\_time: 5m  
expected\_nodes: 2

network:  
host: x.184.167.54

# Force all memory to be locked, forcing JVM to never swap

# (make sure to set MIN and MAX mem to the same value)

#bootstrap:

# mlockall: true

# Unicast Discovery (disable multicast)

discovery:  
zen:  
multicast.enabled: false  
unicast.hosts: ["x.184.167.54:9300", "x.182.149.181:9300"]

transport:  
tcp:  
port:9300

============

The ES server comes up well on .54 server.

How do I start ES on .181 server so that I can see .181 listed as an additional node ?

If I run the ES server from .181 server with the same configuration above, I get the following error :

[2011-06-29 07:39:06,191][ERROR][bootstrap] [Force] {elasticsearch/0.16.2}: Startup Failed ...

- BindTransportException[Failed to bind to [9300-9400]]  
ChannelException[Failed to bind to: /x.184.167.54:9400]  
BindException[Cannot assign requested address]

If I remove the network: host entry .. ES starts up properly, but is in a master mode ..

[2011-06-29 07:41:30,733][INFO][cluster.service] [Saxon, Samuel "Starr"] new\_master [Saxon, Samuel "Starr"][bD-aa-VgSjev1URs7zCLvw][inet[/x.182.149.181:9300]], reason: zen-disco-join (elected\_as\_master)

=============

Is there anything that I'm missing in the configuration ? Where do I find the list of all parameters that can go into elasticsearch.yml

Regards, DKN

---

<div class="post-metadata">

**Author:** ![DKN](https://avatars.discourse-cdn.com/v4/letter/d/77aa72/32.png) [@DKN](https://discuss.elastic.co/u/DKN)\
**Post date:** [July 1, 2011, 6:19am UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-yml-for-discovery/4310/7 "2011-07-01T06:19:18Z")

</div>

I could get this working when my nodes are in the same subnet. I am not sure why this design decision was made, as we anyways would specify the IP addresses of the nodes participating in the cluster. A multi-cast enabled configuration should have ideally honored two of my nodes sitting in two different continents ..

As of now, I have my two node cluster running with the above configuration .. without the "netowrk" settings specified in both the configurations.

---

<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:** [July 6, 2017, 4:02am UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-yml-for-discovery/4310/8 "2017-07-06T04:02:05Z")

</div>


