-
Notifications
You must be signed in to change notification settings - Fork 9
/
install_elasticsearch.sh
36 lines (27 loc) · 1.15 KB
/
install_elasticsearch.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
#!/bin/bash
# Author name: Ruel Nopal
# Company: Ruel Nopal - IT Consultant.
# url: www.ruelnopal.com
# Installing Elasticsearch to aws instance.
# change version before running.
# wget https://raw.githubusercontent.com/raketbizdev/code-snippits/master/install_elasticsearch.sh; sudo chmod 755 install_elasticsearch.sh; ./install_elasticsearch.sh
sudo apt install openjdk-8-jre-headless
java -version
echo $JAVA_HOME
# if not available add java home to .bash_profile
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
sudo apt-get install apt-transport-https
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo add-apt-repository "deb https://artifacts.elastic.co/packages/7.x/apt stable main"
sudo apt-get update
sudo apt-get install elasticsearch
# sudo nano /etc/elasticsearch/elasticsearch.yml
# network.host: 127.0.0.1
# cluster.name: myCluster1
# node.name: myNode1
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
sudo /bin/systemctl start elasticsearch.service
echo "Note! Elasticsearch Need 2GB of RAM per node"
curl -X GET 'http://localhost:9200'
sudo rm -rf install_elasticsearch.sh