In order to run Elasticsearch, a Java Runtime Environment (JRE) is required on the machine. Elasticsearch requires Java 7 or higher and recommends Oracle JDK version 1.8.0_73
.
So, be sure if you have Java in your system. If not, then follow the procedure:
# Install wget with yum
yum -y install wget
# Download the rpm jre-8u60-linux-x64.rpm for 64 bit
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u60-b27/jre-8u60-linux-x64.rpm"
# Download the rpm jre-8u101-linux-i586.rpm for 32 bit
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u101-b13/jre-8u101-linux-i586.rpm"
# Install jre-.*.rpm
rpm -ivh jre-.*.rpm
Java should be installed by now in your centOS system. You can check it with:
java -version
Download & install elasticsearch
# Download elasticsearch-2.3.5.rpm
wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/rpm/elasticsearch/2.3.5/elasticsearch-2.3.5.rpm
# Install elasticsearch-.*.rpm
rpm -ivh elasticsearch-.*.rpm
Running elasticsearch as a systemd service on startup
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch
sudo systemctl start elasticsearch
# check the current status to ensure everything is okay.
systemctl status elasticsearch
Installing Kibana
First import GPG-key on rpm
sudo rpm --import http://packages.elastic.co/GPG-KEY-elasticsearch
Then create a local repository kibana.repo
sudo vi /etc/yum.repos.d/kibana.repo
And Add the following content:
[kibana-4.4]
name=Kibana repository for 4.4.x packages
baseurl=http://packages.elastic.co/kibana/4.4/centos
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1
Now install the kibana by following command:
yum -y install kibana
Start it with:
systemctl start kibana
Check status with:
systemctl status kibana
You may run it as a startup service.
systemctl enable kibana