Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Kibana Installation

apt-get install bash-completion
source /usr/share/bash-completion/bash_completion
## Kibana 7.5.0 installation ## 
#Install dependencies and java 8
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update 
sudo apt install openjdk-8-jdk -y
java -version
##output##	
openjdk version "1.8.0_342"
OpenJDK Runtime Environment (build 1.8.0_342-8u342-b07-0ubuntu1~18.04-b07)
OpenJDK 64-Bit Server VM (build 25.342-b07, mixed mode)

#Change hostname
hostnamectl set-hostname kibana

#Install nginx
apt-get install nginx -y
systemctl status nginx
vim /etc/elasticsearch/elasticsearch.yml

## Install ELastic Search 
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.5.0-amd64.deb
dpkg -i elasticsearch-7.14.0-amd64.deb
vim /etc/elasticsearch/elasticsearch.yml
#Elasticsearch Configuration 
# ------------------------------------ Node ------------------------------------
node.name: node-1
# ----------------------------------- Paths ------------------------------------
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
# ---------------------------------- Network -----------------------------------
network.host: 0.0.0.0
# --------------------------------- Discovery ----------------------------------
discovery.seed_hosts: ["127.0.0.1"]
cluster.initial_master_nodes: ["node-1"]
##############################################################################
sudo systemctl edit elasticsearch		## edit memory to enable memory lock
[Service]
LimitMEMLOCK=infinity
################################################################################
systemctl enable --now elasticsearch
curl -X GET "localhost:9200"
## Output
{
  "name" : "node-1",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "5OvmLbcNQkiW1S4wb2PUAA",
  "version" : {
    "number" : "7.14.0",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "dd5a0a2acaa2045ff9624f3729fc8a6f40835aa1",
    "build_date" : "2021-07-29T20:49:32.864135063Z",
    "build_snapshot" : false,
    "lucene_version" : "8.9.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}
#################################################################################
## Install kiabna

dpkg -i kibana-7.14.0-amd64.deb
vim /etc/kibana/kibana.yml
#Kibana Configuration 
# Kibana is served by a back end server. This setting specifies the port to use.
server.port: 5601
# To allow connections from remote users, set this parameter to a non-loopback address.
server.host: 0.0.0.0
# The URLs of the Elasticsearch instances to use for all your queries.
elasticsearch.hosts: ["http://localhost:9200"]
##############################################################################
##Configur kibana with Nginx
vim /etc/nginx/sites-available/kibana.conf

#kibana.conf
server {
        listen 8080;

        server_name kibana X.X.X.X;

        location / {
                proxy_pass http://127.0.0.1:5601;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                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;
                # proxy_pass_request_headers off;
                # proxy_redirect off;
                # try_files $1 $1/ /app/kibana%23/_REWRITE_COMMAND=$1&args;
                # rewrite ^/app/kibana# /app/kibana break;
                #try_files $uri $uri/ /app/kibana/_REWRITE_COMMAND=$uri&args;
        }
}
##############################################################################

ln -s /etc/nginx/sites-available/kibana.conf /etc/nginx/sites-enabled/kibana.comf
echo "kibanaadmin:`openssl passwd -apr1`" | sudo tee -a /etc/nginx/htpasswd.users
systemctl enable --now kibana

##############################################################################
#Install Logstash
wget https://artifacts.elastic.co/downloads/logstash/logstash-7.5.0.deb
dpkg -i logstash-7.14.0-amd64.deb

vim /etc/logstash/conf.d/02-beats-input.conf

input {
  beats {
    port => 5044
  }
}
#######

vim /etc/logstash/conf.d/30-elasticsearch-output.conf

output {
  elasticsearch {
    hosts => ["localhost:9200"]
    manage_template => false
    index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
  }
}
##############################################################################
sudo systemctl edit logstash		## edit memory to enable memory lock
[Service]
LimitMEMLOCK=infinity
##############################################################################
sudo -u logstash /usr/share/logstash/bin/logstash --path.settings /etc/logstash -t
systemctl enable --now logstash
Comment

PREVIOUS NEXT
Code Example
Shell :: rsync exclude directory 
Shell :: gitignore still tracking files 
Shell :: netflix app ubuntu 
Shell :: powershell script to run powershell script 
Shell :: pkg_resources.DistributionNotFound: 
Shell :: pyinstaller version file 
Shell :: mysql password inline cli 
Shell :: centos create home directory for existing user 
Shell :: mac finder quick preview for markdown 
Shell :: rollup emotion 
Shell :: how to copy one file to multiple directories in linux 
Shell :: rvm does not load gemset when open new tab in terminal 
Shell :: berew install skype 
Shell :: Basic listing in linux 
Shell :: install htop sudo add-apt-repository universe 
Shell :: Swappiness setting recommendation swap sysctl.conf performance improvement Hadoop system 
Shell :: kube cluster 
Shell :: install nomad on aws linux 2 
Shell :: How to point project to another remote repository git 
Shell :: 7zip split archive command line fat32 
Shell :: how to list linux files in mb (human readable format) 
Shell :: sftp client online linux remote 
Shell :: powershell send message to all currently logged on users 
Shell :: command to convert standard input to arguments for a piped command 
Shell :: passwd password for aibotuser is unchanged docker 
Shell :: git change oriign 
Shell :: deleting when you terminate it 
Shell :: ubuntu edit file 
Shell :: dpkg --configure -a » pour corriger le problème. 
Shell :: assign diff result into a variable in shell script 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =