forked from zuzu59/elk_hello_world
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·49 lines (31 loc) · 1.64 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
#Petit script pour installer ELK avec la derniere version
#310817.1556
sudo apt-get -y install jruby
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | sudo tee -a /etc/apt/sources.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
sudo apt-get update
sudo apt-get -y install oracle-java8-installer
sudo apt-get -y install oracle-java8-set-default
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key ad$
echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee$
sudo apt-get update
sudo apt-get -y install elasticsearch
sudo update-rc.d elasticsearch defaults 95 10
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
sudo apt-get -y install kibana
sudo update-rc.d kibana defaults 95 10
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable kibana.service
sudo apt-get -y install logstash
THEIP=$(/sbin/ifconfig ens18 | /bin/grep "inet ad" | /usr/bin/cut -f2 -d: | /usr/bin/awk '{print $1}')
echo "network.host: "$THEIP | sudo tee -a /etc/elasticsearch/elasticsearch.yml
echo "network.bind_host: "$THEIP | sudo tee -a /etc/elasticsearch/elasticsearch.yml
sudo service elasticsearch restart
echo "server.host: "$THEIP | sudo tee -a /opt/kibana/config/kibana.yml
echo "elasticsearch.url: http://"$THEIP":9200" | sudo tee -a /opt/kibana/config/kibana.yml
sudo service kibana restart
sudo /usr/share/logstash/bin/logstash-plugin install logstash-filter-elasticsearch
sudo chmod -R 777 /usr/share/logstash/data