Skip to main content

ElasticSearch Clustering and Backups

ElasticSearch Installation:


The version we want to install is 2.x (latest sub version of 2).

First we have to install java on centOS machine with following command:

sudo yum install java-1.8.0-openjdk.x86_64

Install Public Signing Key:
 

Create new repo in your /etc/yum.repos.d/ directory. For example I have created elasticsearch.repo here.
/etc/yum.repos.d/elasticsearch.repo
--------------------------------------------------------------------------------------------
[elasticsearch-2.x]
name=Elasticsearch repository for 2.x packages
baseurl=http://packages.elastic.co/elasticsearch/2.x/centos
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1
---------------------------------------------------------------------------------------------

Now Elasticsearch 2.x will avilable for installation using yum
 
yum install elasticsearch

After installation enable the service at startup.

chkconfig --add elasticsearch

Otherwise if your distribution is using systemd:
 
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service

Starting service of elasticsearch:

systemctl start elasticsearch

Now we have done with Elasticsearch installation. You can check your default Elasticsearch configuration in /etc/elasticsearch/elasticsearch.yml

Summary of important Elasticsearch Configuration that are to be changed/uncommented:
 
cluster.name: TechnTech
node.name: es-node-1
network.host: 10.0.0.10
http.port: 9200
discovery.zen.ping.unicast.hosts: ["127.0.0.1"]

Restart the elasticsearch service

systemctl restart elasticsearch

Verify the installation by visiting URL: 10.0.0.10:9200

Install Head plugin in ElasticSearch:

Go to ES directory

cd /usr/share/

Enter the following command to install the Head plugin on ElasticSearch.

sudo elasticsearch/bin/plugin install mobz/elasticsearch-head

Install kopf plugin on ElasticSearch:

./elasticsearch/bin/plugin install lmenezes/elasticsearch-kopf/2.0
 
kopf can be used for monitoring and backups of elasticsearch.
 
Backup ElasticSearch with kopf

ElasticSearch Clustering:


Edit the elasticsearch.yml file in /etc/elasticsearch/elasticsearch.yml for enabling the cluster in elasticsearch.
 

Comments

Popular posts from this blog

Configuring Failover and Load Balancing with HAproxy using Keepalived

Network Scenario: LB1: 192.168.10.10 LB2: 192.168.10.11 Virtual IP: 192.168.10.12 APP_Server1: 192.168.10.20 APP_Server2: 192.168.10.21 Load Balancing: STEP 1 - Install HAProxy: HAProxy package is available under default yum repository for CentOS, Redhat systems. Use the following yum package manager command to install HAProxy on your system.   # yum install haproxy   STEP 2 - Configure HAProxy : Update your HAProxy configuration file /etc/haproxy/haproxy.cfg as per your requirement, You may also use below given configuration file as an example of setup and modify it. Keep the config file same of both servers i.e. LB1 and LB2.   ----------------------------------------------------------------------------------------------------------- global         log /dev/log    local0         log /dev/log    local1 notice     ...

Line Following Robot!

What is a line follower? Line follower is a machine that can follow a path. The path can be visible like a black line on a white surface (or vice-versa) or it can be invisible like a magnetic field. Why build a line follower? Sensing a line and maneuvering the robot to stay on course, while constantly correcting wrong moves using feedback mechanism forms a simple yet effective closed loop system. As a programmer you get an opportunity to ‘teach’ the robot how to follow the line thus giving it a human-like property of responding to stimuli. Practical applications of a line follower : Automated cars running on roads with embedded magnets; guidance system for industrial robots moving on shop floor etc.   I started with building a parallel port based robot which could be controlled manually by a keyboard. On the robot side was an arrangement of relays connected to parallel port pins via opto-couplers. The next version was a true computer controlled line foll...