# Unable to connect to ElasticSearch remotely

**URL:** <https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-remotely/52411>\
**Category:** Elasticsearch\
**Created:** [June 10, 2016, 6:35am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-remotely/52411 "2016-06-10T06:35:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![arunkumar987](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@arunkumar987](https://discuss.elastic.co/u/arunkumar987)\
**Post date:** [June 10, 2016, 6:35am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-remotely/52411/1 "2016-06-10T06:35:00Z")

</div>

After googling I tried making some changes in the elasticsearch.yml file like changing network.host: 0.0.0.0 / 127.0.0.1, http.port: 9200, network.bind\_host: 0, making the min and max heap size to be the same and also tried changing the discovery.zen.minimum\_master\_nodes to 2,3, etc. But all in vain. I am getting the following exception, **please set [discovery.zen.minimum\_master\_nodes] to a majority of the number of master eligible nodes in your cluster.**

The complete log is as follows:-  
[2016-06-10 11:43:19,846][INFO][node] [X-X] version[5.0.0-alpha2], pid[5504], build[e3126df/2016-04-26T12:08:58.960Z]  
[2016-06-10 11:43:19,849][INFO][node] [X-X] initializing ...  
[2016-06-10 11:43:21,728][INFO][plugins] [X-X] modules [lang-mustache, lang-painless, ingest-grok, reindex, lang-expression, lang-groovy], plugins []  
[2016-06-10 11:43:21,826][INFO][env] [X-X] using [1] data paths, mounts [[System (C:)]], net usable\_space [210.1gb], net total\_space [299.5gb], spins? [unknown], types [NTFS]  
[2016-06-10 11:43:21,828][INFO][env] [X-X] heap size [247.5mb], compressed ordinary object pointers [true]  
[2016-06-10 11:43:33,436][INFO][node] [X-X] initialized  
[2016-06-10 11:43:33,437][INFO][node] [X-X] starting ...  
[2016-06-10 11:43:33,703][INFO][transport] [X-X] publish\_address {X.X.X.X:9300}, bound\_addresses {[::]:9300}  
[2016-06-10 11:43:33,718][ERROR][bootstrap] [X-X] Exception  
java.lang.RuntimeException: bootstrap checks failed  
please set [discovery.zen.minimum\_master\_nodes] to a majority of the number of master eligible nodes in your cluster.  
at org.elasticsearch.bootstrap.BootstrapCheck.check(BootstrapCheck.java:93)  
at org.elasticsearch.bootstrap.BootstrapCheck.check(BootstrapCheck.java:66)  
at org.elasticsearch.bootstrap.Bootstrap$5.validateNodeBeforeAcceptingRequests(Bootstrap.java:191)  
at org.elasticsearch.node.Node.start(Node.java:323)  
at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:206)  
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:269)  
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:111)  
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:106)  
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:91)  
at org.elasticsearch.cli.Command.main(Command.java:53)  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:74)  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:67)  
Suppressed: java.lang.IllegalStateException: please set [discovery.zen.minimum\_master\_nodes] to a majority of the number of master eligible nodes in your cluster.  
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)  
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)  
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)  
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)  
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)  
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)  
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)  
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)  
at org.elasticsearch.bootstrap.BootstrapCheck.check(BootstrapCheck.java:94)  
... 11 more  
[2016-06-10 11:43:33,739][INFO][node] [X-X] stopping ...  
[2016-06-10 11:43:33,778][INFO][node] [X-X] stopped  
[2016-06-10 11:43:33,779][INFO][node] [X-X] closing ...  
[2016-06-10 11:43:33,823][INFO][node] [X-X] closed

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 10, 2016, 6:57am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-remotely/52411/2 "2016-06-10T06:57:25Z")

</div>

First guess.

The changes you are doing in your `elasticsearch.yml` file are not taken into account?

Either this is the wrong file or it's badly written?

Can you change `node.name: mynode` for example and check that this is printed in logs?  
May be you could share your config file?

---

<div class="post-metadata">

**Author:** ![arunkumar987](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@arunkumar987](https://discuss.elastic.co/u/arunkumar987)\
**Post date:** [June 10, 2016, 7:04am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-remotely/52411/3 "2016-06-10T07:04:37Z")

</div>

> [@dadoonet](#):
>
> May be you could share your config file

# ======================== Elasticsearch Configuration =========================

# 

# NOTE: Elasticsearch comes with reasonable defaults for most settings.

# Before you set out to tweak and tune the configuration, make sure you

# understand what are you trying to accomplish and the consequences.

# 

# The primary way of configuring a node is via this file. This template lists

# the most important settings you may want to configure for a production cluster.

# 

# Please see the documentation for further information on configuration options:

# [http://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html](http://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html)

# 

# ---------------------------------- Cluster -----------------------------------

# 

# Use a descriptive name for your cluster:

# 

# cluster.name: my-application

# 

# ------------------------------------ Node ------------------------------------

# 

# Use a descriptive name for the node:

# 

# node.name: node-1

# 

# Add custom attributes to the node:

# 

# node.rack: r1

# 

# ----------------------------------- Paths ------------------------------------

# 

# Path to directory where to store the data (separate multiple locations by comma):

# 

# path.data: /path/to/data

# 

# Path to log files:

# 

# path.logs: /path/to/logs

# 

# ----------------------------------- Memory -----------------------------------

# 

# Lock the memory on startup:

# 

# bootstrap.mlockall: true

# 

# Make sure that the heap size is set to about half the memory available

# on the system and that the owner of the process is allowed to use this

# limit.

# 

# Elasticsearch performs poorly when the system is swapping the memory.

# 

# ---------------------------------- Network -----------------------------------

# 

# Set the bind address to a specific IP (IPv4 or IPv6):

# 

network:  
host: 0.0.0.0  
http:  
port: 9200

# network.host: 0.0.0.0

# 

# Set a custom port for HTTP:

# 

# http.port: 9200

# 

# For more information, see the documentation at:

# [http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html](http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html)

# 

# --------------------------------- Discovery ----------------------------------

# 

# Pass an initial list of hosts to perform discovery when new node is started:

# The default list of hosts is ["127.0.0.1", "[::1]"]

# 

# discovery.zen.ping.unicast.hosts: ["host1", "host2"]

# 

# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):

# 

# discovery.zen.minimum\_master\_nodes: 3

# 

# For more information, see the documentation at:

# [http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html](http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html)

# 

# ---------------------------------- Gateway -----------------------------------

# 

# Block initial recovery after a full cluster restart until N nodes are started:

# 

# gateway.recover\_after\_nodes: 3

# 

# For more information, see the documentation at:

# [http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html](http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html)

# 

# ---------------------------------- Various -----------------------------------

# 

# Disable starting multiple nodes on a single system:

# 

# node.max\_local\_storage\_nodes: 1

# 

# Require explicit names when deleting indices:

# 

# action.destructive\_requires\_name: true

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 10, 2016, 8:57am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-remotely/52411/4 "2016-06-10T08:57:32Z")

</div>

Please format your code using `</>` icon

---

<div class="post-metadata">

**Author:** ![arunkumar987](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@arunkumar987](https://discuss.elastic.co/u/arunkumar987)\
**Post date:** [June 10, 2016, 10:18am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-remotely/52411/5 "2016-06-10T10:18:31Z")

</div>

I got it resolved. The only changes I made to the elasticsearch.yml file were,  
network.host: 0.0.0.0 and  
discovery.zen.minimum\_master\_nodes: 2

---

<div class="post-metadata">

**Author:** ![arunkumar987](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@arunkumar987](https://discuss.elastic.co/u/arunkumar987)\
**Post date:** [June 10, 2016, 10:23am UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-remotely/52411/6 "2016-06-10T10:23:23Z")

</div>

And now am getting the error, **master\_not\_discovered\_exception** when running [http://localhost:9200/\_cat/indices?v](http://localhost:9200/_cat/indices?v) in the browser.  
I verified that the master node is present by running [http://localhost:9200/\_nodes](http://localhost:9200/_nodes) and I got the output as "roles":[  
"master",  
"data",  
"ingest"  
]

---

<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 5, 2017, 10:44pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-elasticsearch-remotely/52411/7 "2017-07-05T22:44:48Z")

</div>


