Which node to connect to

Hello, this is a dum question. But I have two nodes on my cluster (One is master). And I always use the master IP (or URL) to fetch for Info, for example in my Grafana data source I use the Node1 URL to Connect.
Is always this way? I need always to connect to the master node in order to fetch for data? Or I can use any node to fetch for data (for example in Grafana, Elastalert or any other systems).

Does this practice doesn't achieve availability ? Since I'm always using one node to fetch for data

The node you connect to in order to run searches is coordinator node/role which every node is capable of doing.

A 2 nodes cluster is to be avoided as it means there is no high-availability (better to have 3 master-data nodes - or 2 master-data and a voting-only node) and there is also no advantage of dedicated master node if you only have 2 nodes...
It's not clear in your question what are the roles (GET _cat/nodes?v) but assuming 2 scenarios :

  1. If it's one master-dedicated and a data node, you should use the data nodes as coordinator. In this scenario if the data-node fails, as there is no replica shard assigned with only one data node the cluster and all indices will turn red (no shard/index available for search nor write), if the master fails the cluster turns red because it lacks an elected master.
  2. If you have one master-data and one data node, you would normally connect to either/both nodes as coordinator node with a note in this case that assuming indices have 1 replica, cluster will turn yellow (search and write still available) when the data-only node fails, while obviously a failure of the master-data means the cluster becomes unavailable because it has no elected master (you should better have 2 master-data and add a low-specs voting-only node for quorum, the voting-only node would not be used as coordinator node in that case)

Thanks
Julien

Now it's a little bit more clear. I thought that you can only have one master node. So my best scenario is to have 3 master-data nodes (what about ingest nodes?). And If I want to retrieve Info I can use any node

Yes, by default nodes have all roles assigned, ingest (for running ingest pipelines if you use that) and coordinator (for collecting result of multiple searches) roles
Thanks
Julien

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