Wednesday, August 1, 2018

Install elasticsearch ubuntu 18


Install elasticsearch ubuntu 18


01 Install java


Set JAVA_HOME edit file /etc/environment and add the content shown below in comments


sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
java -version
echo $JAVA_HOME
sudo vi /etc/environment
#PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
#JAVA_HOME="/usr/lib/jvm/java-8-oracle"
source /etc/environment
echo $JAVA_HOME



02 Install Elasticsearch-6.3


echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -  
sudo apt-get update && sudo apt-get install elasticsearch
ls /etc/init.d/elasticsearch
sudo service elasticsearch status

03 Change bind address and JVM heap option as per requirement


Change network.host to 0.0.0.0 in elasticsearch.yml and set -Xms 4g & -Xmx 4g in jvm.options
sudo vi /etc/elasticsearch/elasticsearch.yml
sudo vi /etc/elasticsearch/jvm.options


04 Install Kibana

sudo apt-get update && sudo apt-get install kibana
sudo service kibana restart

05 Install nginx

sudo apt-get -y install nginx

06 Add nginx config file for kibana

sudo vi /etc/nginx/conf.d/kibana.conf
Replace mykibana.com with your server_name or IP. We will setup auth in next step, hence we have placed a line for auth_basic in kibana.conf

 server {
    listen 80;
    server_name mykibana.com;
    auth_basic "Restricted Access";
    auth_basic_user_file /etc/nginx/htpasswd.users;

    location / {
        proxy_pass http://localhost:5601;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}


07 Setup auth

sudo apt-get install apache2-utils
sudo htpasswd -c /etc/nginx/htpasswd.users admin
sudo service nginx restart



08 Web view of Kibana



2 comments:

  1. Welcome to Slots - Moo's Casino and Hotel
    Join KTM Casino and Hotel - 원주 출장마사지 Your best 여수 출장안마 chance to escape from 시흥 출장마사지 the casino and make a splash in our newest casino & hotel! Our 군포 출장안마 hotel is 구리 출장마사지 surrounded by

    ReplyDelete