Hi,
1.How to configure elasticsearch cluster with 3 nodes
2.How many master nodes i need to configure if i had only 3 nodes to avoid split brain.
3.If had 3 nodes, which node I need to configure in logstash
Hi,
1.How to configure elasticsearch cluster with 3 nodes
2.How many master nodes i need to configure if i had only 3 nodes to avoid split brain.
3.If had 3 nodes, which node I need to configure in logstash
My suggestion is if you have three nodes, is to setup 2 master eligible servers.
with a minimum of 2 so that you don't have a split brain situation.
configuration could be:
node1 - elasticsearch.yml:
cluster.name: three_node_cluster
node.name: node-1
network.host: _site_
discovery.zen.ping.unicast.hosts: ["192.168.43.1", "192.168.43.2", "192.168.43.3"]
discovery.zen.minimum_master_nodes: 2
node2 - elasticsearch.yml:
cluster.name: three_node_cluster
node.name: node-2
network.host: _site_
discovery.zen.ping.unicast.hosts: ["192.168.43.1", "192.168.43.2", "192.168.43.3"]
discovery.zen.minimum_master_nodes: 2
node3 - elasticsearch.yml:
cluster.name: three_node_cluster
node.name: node-3
network.host: _site_
discovery.zen.ping.unicast.hosts: ["192.168.43.1", "192.168.43.2", "192.168.43.3"]
discovery.zen.minimum_master_nodes: 2
To avoid split-brain its best to use (number_of_nodes / 2) + 1. In this case 2, but in general we use a maximum of 3 master eligible servers in a cluster.
For logstash you can configure it to connect to multiple IP's of the hosts. All the nodes can coordinate the data.
Mind the firewall settings if you do not use cloud.elastic.co which has security by default. I recommend to follow Elastic Engineer 1 - course which gives a good explanation about setting up a cluster.
The ideal number of master eligible nodes is 3, so I would recommend you set up all 3 nodes as master/data. Add the IP address of all nodes to discovery.zen.ping.unicast.hosts
and set discovery.zen.minimum_master_nodes
to 2 to avoid split brain scenarios.
coordinating node is requred....?
All nodes are default master, data, ingest and coordinating nodes unless you set the boolean to false for that option.
consider a scenario
If I had 3 nodes all are master/data nodes
192.168.43.1
192.168.43.2
192.168.43.3
my logstash is congfigured with 192.168.43.1 server(elasticsearch) and if 192.168.43.1 server is down, at this case what will happen...?
You can set multiple IPs for logstash in your config. I will change the config above to those IPs
output {
elasticsearch {
host => ["192.168.43.1", "192.168.43.2", "192.168.43.3"]
...
}
}
logs will go to all 3 servers or single server
It will go to a single server that responds.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.