# No masternode selected

**URL:** <https://discuss.elastic.co/t/no-masternode-selected/185692>\
**Category:** Elasticsearch\
**Created:** [June 13, 2019, 3:39pm UTC](https://discuss.elastic.co/t/no-masternode-selected/185692 "2019-06-13T15:39:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ho\_al](https://avatars.discourse-cdn.com/v4/letter/h/e9c0ed/32.png) [@ho\_al](https://discuss.elastic.co/u/ho_al)\
**Post date:** [June 13, 2019, 3:39pm UTC](https://discuss.elastic.co/t/no-masternode-selected/185692/1 "2019-06-13T15:39:27Z")

</div>

Hi, I am new to the elastic world and am currently testing the elastic stack in a non production setting.

I previously set up ELK + filebeat and got everything running (first logs from filebeat visible in Kibana via Logstash -\> Elastic). Since this is part of my bachelor thesis I am now trying to replicate this setup with the documentation I wrote, but I am having issues right at the start now and I am not sure why - "I am doing everything like I did the first time", but aparently I am not.

I am using ansible to install & configure everything. I am not allowed to use the official roles & need to do it by myself for the thesis.

My test setup:  
Host macBookPro '15 with i7 & 16GB RAM

Guests:  
Headless Debian 9 VM via VMWare Fusion (172.16.247. **134** ) 2 Cores 2GB RAM  
root + user (user has sudo rights)  
Elasticsearch  
Logstash  
Kibana

[Not really interesting for this question]  
_Headless Debian 9 VM via VMWare Fusion (172.16.247. **132** ) 1 Core 512MB RAM_  
_root + user (user has sudo rights)_  
_Filebeat_

Basically what I am doing is:

- Install java 8
- Adding the apt\_key
- Installing apt-transport-https
- Adding the repository definition in /etc/apt/sources....
- Updating the apt cache & install the elasticsearch package
- Editing the [elasticsearch.yml](https://pastebin.com/VUu8qEUG)
- Enabling the Elasticsearch service
- Starting the elasticsearch service

If I send a curl 172.16.247.134:9200, I get following answer:

{  
"name" : "ELKrebuild",  
"cluster\_name" : "elasticsearch",  
"cluster\_uuid" : "_na_",  
"version" : {  
"number" : "7.1.1",  
"build\_flavor" : "default",  
"build\_type" : "deb",  
"build\_hash" : "7a013de",  
"build\_date" : "2019-05-23T14:04:00.380842Z",  
"build\_snapshot" : false,  
"lucene\_version" : "8.0.0",  
"minimum\_wire\_compatibility\_version" : "6.8.0",  
"minimum\_index\_compatibility\_version" : "6.0.0-beta1"  
},  
"tagline" : "You Know, for Search"  
}

If I now take a look at the [elasticsearch log](https://pastebin.com/dJaiykN9) I think the problem is, that my single elastisearch node is not finding a master (and not electing itself as the master).  
Since the log from the working setup is different from this point on from the new setup, right after "bound or publishing to a non-loopback address, enforcing bootstrap checks".  
The working VM logs a cluster UUID and logs that it was elected-as-master, the non working VM logs "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial\_master\_nodes] is empty on this node: have discovered ; discovery will continue using [127.0.0.1:9300] from hosts providers and [{ELKrebuild}{eDxm9vQURH2wVvEe4ZfnEA}{SddpOSx0Ro6RZVT5z\_KDKw}{172.16.247.134}{172.16.247.134:9300}{ml.machine\_memory=2082492416, xpack.installed=true, ml.max\_open\_jobs=20}] from last-known cluster state; node term 0, last-accepted version 0 in term 0"

I am thankfull for any directions. Thanks!

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [June 13, 2019, 4:03pm UTC](https://discuss.elastic.co/t/no-masternode-selected/185692/2 "2019-06-13T16:03:08Z")

</div>

> [@ho\_al](#):
>
> [cluster.initial\_master\_nodes] is empty on this node

You should set `cluster.initial_master_nodes`. If you don't, the node doesn't know to form a cluster on its own, and tries to find an existing cluster to join instead.

---

<div class="post-metadata">

**Author:** ![ho\_al](https://avatars.discourse-cdn.com/v4/letter/h/e9c0ed/32.png) [@ho\_al](https://discuss.elastic.co/u/ho_al)\
**Post date:** [June 13, 2019, 5:06pm UTC](https://discuss.elastic.co/t/no-masternode-selected/185692/3 "2019-06-13T17:06:44Z")

</div>

Thanks, that did the trick! I just checked, Kibana is working now as well. (I backtracked this problem from kibana not getting license information from elasticsearch and figured there are connection problems to ES, in the kibana log I found something like "kibana cant connect to the elastic master node"). If anyone is interested, David solved my "Kibana server is not ready yet" like this.

@DavidTurner Just curious now, I'm pretty sure I didnt configure `cluster.initial_master_nodes` the first time, but can't be 100% sure. Is it possible to start a cluster without this setting? I read something about a development mode if you dont specify seeding/initial nodes? I basically copied my \*.ymls from my working setup to my new installation. Thanks again, you turned my kinda frustrating day into a good one!

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [June 13, 2019, 6:16pm UTC](https://discuss.elastic.co/t/no-masternode-selected/185692/4 "2019-06-13T18:16:03Z")

</div>

Yes, there's an [auto-bootstrapping feature](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-bootstrap-cluster.html#_auto_bootstrapping_in_development_mode) which you might have unknowingly made use of with your first node. `cluster.initial_master_nodes` only has an effect the first time a cluster is forming; once the cluster is bootstrapped, it does nothing.

---

<div class="post-metadata">

**Author:** ![ho\_al](https://avatars.discourse-cdn.com/v4/letter/h/e9c0ed/32.png) [@ho\_al](https://discuss.elastic.co/u/ho_al)\
**Post date:** [June 13, 2019, 6:38pm UTC](https://discuss.elastic.co/t/no-masternode-selected/185692/5 "2019-06-13T18:38:37Z")

</div>

Thanks again. I think I now understand why my first setup worked and the second didnt:

- I installed & launched ELK with 100% default settings to get that working first (at this point the node elected itself as master and remembered that)
- Later on to get access to my kibana & elasticsearch from my host macBook & the filebeat VM I added `discovery.seed_hosts` (so elastic runs on my external IP & not localhost)
- I then used that config for the new setup & by setting `discovery.seed_hosts` right from the initialization the auto-bootstrapping got disabled and I ran into this issue

Thank you for your time and helping me further understand how things work. Cheers!

---

<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 11, 2019, 6:38pm UTC](https://discuss.elastic.co/t/no-masternode-selected/185692/6 "2019-07-11T18:38:37Z")

</div>

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