Unable to connect to ElasticSearch remotely

After googling I tried making some changes in the elasticsearch.yml file like changing network.host: /, 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

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?

======================== 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:


---------------------------------- 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


Elasticsearch performs poorly when the system is swapping the memory.

---------------------------------- Network -----------------------------------

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

port: 9200


Set a custom port for HTTP:

http.port: 9200

For more information, see the documentation at:


--------------------------------- Discovery ----------------------------------

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

The default list of hosts is ["", "[::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:


---------------------------------- 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:


---------------------------------- 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

Please format your code using </> icon

I got it resolved. The only changes I made to the elasticsearch.yml file were,
network.host: and
discovery.zen.minimum_master_nodes: 2

And now am getting the error, master_not_discovered_exception when running http://localhost:9200/_cat/indices?v in the browser.
I verified that the master node is present by running http://localhost:9200/_nodes and I got the output as "roles":[