I'm trying to setup a cluster with 2 nodes. one master node and other data node

Continuing the discussion from Elasticsearch: Not enough master nodes discovered during pinging:

how can I bind these nodes so that I can query on one elasticsearch

Can someone help me to understand this problem??

network.host: some_ip_that_can_be_accessed_from_other_machines

network.host can not be localhost or 127.0.0.1 if you want to create a cluster (have more than one node) or if you want to be able to access Elasticsearch from another host.

Read this and specifically the "Also be patient" part.

It's fine to answer on your own thread after 2 or 3 days (not including weekends) if you don't have an answer.

I already set network.host:<ip_address_node>
But it still shows "elasticsearch: service not available"

Is the Elasticsearch service running?

If the service is running, try this on the machine running Elastic search and from another machine

curl http://<ip_address_node>:9200

That should work from both the Elasticsearch machine and from other machines.

If it doesn't work anywhere, check service
If it works just on Elasticseach machine

  • check network, like firewall rules
  • make sure <ip_address_node> is an IP that can be reached for other machines

Share elasticsearch logs as well.

I probably lack the knowledge. Does discovery.zen.ping.unicast.hosts need to equal the actual network.host names?

The current settings provided by komal_mittal: discovery.zen.ping.unicast.hosts: ["node1", "node2", "node3", "node4"]

Does it need to be: discovery.zen.ping.unicast.hosts: ["private-ip_1st-node", "private-ip_2nd-node", "private-ip_3rd-node", "private-ip_4th-node"]

Elasticsearch is working but i got error to search data

How do you know it's running?

@komal_mittal why do you seek one sole master and one sole data node?

Why not start up a two node cluster as per the defaults(master, data, ingest) and have a second data node for replica shards to reside on thus giving you a green health status but also redundancy in the event one node goes down.

Where does this thread currently stand, what are the issues faced, what has been conducted thus far?

running by http://<ip_address_node>:9200
It shows cluster name, uuid etc.

this means
first node:
node.master: true
node.data: true
node.ingest: true
second node:
node.master: false
node.data: true
node.ingest: false

Can you ping <ip_address_node> from other machines? What sort of machines are these, physical machines or VMs? If VMs, what hypervisor or platform do you run them on?

I meant have two nodes with all roles.

node.master: true
node.data: true
node.ingest: true

Where does this thread currently stand, what are the issues faced, what has been conducted thus far?

[2018-05-31T05:14:16,815][WARN ][r.suppressed ] path: /_aliases, params: {}
org.elasticsearch.discovery.MasterNotDiscoveredException: ClusterBlockException[blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];]
at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction$4.onTimeout(TransportMasterNodeAction.java:213) [elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.cluster.ClusterStateObserver$ContextPreservingListener.onTimeout(ClusterStateObserver.java:317) [elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.cluster.ClusterStateObserver$ObserverClusterStateListener.onTimeout(ClusterStateObserver.java:244) [elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.cluster.service.ClusterApplierService$NotifyTimeout.run(ClusterApplierService.java:581) [elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:573) [elasticsearch-6.2.4.jar:6.2.4]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_162]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_162]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_162]
Caused by: org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];
at org.elasticsearch.cluster.block.ClusterBlocks.indicesBlockedException(ClusterBlocks.java:203) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.action.admin.indices.get.TransportGetIndexAction.checkBlock(TransportGetIndexAction.java:70) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.action.admin.indices.get.TransportGetIndexAction.checkBlock(TransportGetIndexAction.java:49) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction.doStart(TransportMasterNodeAction.java:135) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction.start(TransportMasterNodeAction.java:127) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.action.support.master.TransportMasterNodeAction.doExecute(TransportMasterNodeAction.java:105) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.action.support.master.TransportMasterNodeAction.doExecute(TransportMasterNodeAction.java:55) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:167) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:139) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:81) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.client.node.NodeClient.executeLocally(NodeClient.java:83) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.client.node.NodeClient.doExecute(NodeClient.java:72) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:405) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.client.support.AbstractClient$IndicesAdmin.execute(AbstractClient.java:1253) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.client.support.AbstractClient$IndicesAdmin.getIndex(AbstractClient.java:1354) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.rest.action.admin.indices.RestGetAllAliasesAction.lambda$prepareRequest$0(RestGetAllAliasesAction.java:73) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:97) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:240) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.rest.RestController.tryAllHandlers(RestController.java:336) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:174) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.http.netty4.Netty4HttpServerTransport.dispatchRequest(Netty4HttpServerTransport.java:500) ~[?:?]
at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.channelRead0(Netty4HttpRequestHandler.java:80) ~[?:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) ~[?:?]
at org.elasticsearch.http.netty4.pipelining.HttpPipeliningHandler.channelRead(HttpPipeliningHandler.java:68) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) ~[?:?]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) ~[?:?]
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) ~[?:?]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) ~[?:?]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[?:?]
at i

org.elasticsearch.action.search.SearchphaseExcecutionException: all shards failed

Is there anything else in which I have to change??

Can we go back a step, do you have a up and running two node cluster?
Can you share the elasticsearch.yml from both nodes please, ensuring when pasting here to add with proper markdown.

1st node configuration file:
cluster.name: elastic_cluster
node.name: master
node.master: true
node.data: true
node.ingest: true
path.data: /path-1
network.host: <ip_address_1st_node>
transport.host: 127.0.0.1
http.host: 0.0.0.0
discovery.zen.ping.unicast.hosts: ["<ip_address_1st_node>","<ip_address_2nd_node>"]

2nd node configuration file:
cluster.name: elastic_cluster
node.name: master
node.master: true
node.data: true
node.ingest: true
path.data: /path-2
network.host: <ip_address_2st_node>
transport.host: 127.0.0.1
http.host: 0.0.0.0
discovery.zen.ping.unicast.hosts: ["<ip_address_1st_node>","<ip_address_2nd_node>"]

This is what I changed in elasticsearch.yml file.