build highly available ELK stack
Hi Techrunnr Readers, this document deals with how to build highly available ELK stack.
Here I will show you how to setup High availability for Elasticsearch.
Elasticsearch is a search engine based on Lucene. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents. Elasticsearch is developed in Java and is released as open source under the terms of the Apache License.
ElasticSeach 1: 192.168.10.5
ElasticSeach 2: 192.168.10.6
ElasticSeach 3: 192.168.10.7
HAproxy for Elasticsearch: 192.168.10.8
1. Log in to each elasticsearch server, download the elasticsearch
3. configure Elasticsearch
Change as per your environment
Cluster name: It should be unique in all the servers.
discovery.zen.ping.unicast.hosts: add all your host’s address
Do this for all the servers.
Once it is done start the elasticsearch servers.
Check cluster status
The above command gives you the details about the cluster and the number of nodes present in the cluster.
Now Configure HAProxy for load balancing and failover.
Now login to Elasticsearch Haproxy server (192.168.10.8).
1. Install HAproxy
2. Remove the default haproxy configuration
3. Now Create the configuration file and add the following lines.
Here I have added 3 server which acts as load balancing between elastic1 and elastic2 servers. And Failover server as elastic3 when elastic1 and elastic2 fails.
Now you have completed the HA setup for Elasticsearch
Check this document for Kibana HA.
© 2018, Techrunnr. All rights reserved.