-
-
Save kolosek/f2fcfbe645486901144b23d1cfc8c40f to your computer and use it in GitHub Desktop.
echo "Requires JAVA installation" | |
read | |
sudo apt-get purge elasticsearch | |
sudo su -c "echo 'deb https://artifacts.elastic.co/packages/6.x/apt stable main'>> /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 | |
sudo systemctl enable elasticsearch.service | |
sudo systemctl start elasticsearch.service |
In case permission is denied error:
sudo chown -R elasticsearch:elasticsearch /etc/default/elasticsearch
Check if ElasticSearch is running and what version:
curl -XGET 'http://elasticsearch:9200/'
Running 2 versions of ES:
/Get the first ElasticSearch version
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.10.tar.gz
tar -zxf elasticsearch-5.6.10.tar.gz
//Get the second ElasticSearch version you would like to install
e.g. (if used one or another please adjuct directory location)
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.3-linux-x86_64.tar.gz
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.2.tar.gz
tar -zxf elasticsearch-6.8.2.tar.gz
//Configure the elasticsearch.yml file as follows
vim elasticsearch-5.6.10/config/elasticsearch.yml
cluster.name: elastic_cluster1
node.name: node-1
node.master: true
node.data: true
transport.host: localhost
transport.tcp.port: 9300
http.port: 9200
network.host: 0.0.0.0
//Configure elasticsearch.yml file for another ES version
vim elasticsearch-6.8.2/config/elasticsearch.yml
cluster.name: elastic_cluster2
node.name: node-2
#node.master: true
node.data: true
transport.host: localhost
transport.tcp.port: 9301
http.port: 9201
network.host: 0.0.0.0
//To start ElasticSearch Services from Terminal
cd elasticsearch-5.6.10
bin/elasticsearch -d
cd elasticsearch-6.8.2
bin/elasticsearch -d
Additional notes:
sudo apt-get remove elasticsearch
sudo apt-get --purge elasticsearch
sudo rm -rf /var/lib/elasticsearch/
sudo rm -rf /etc/elasticsearch
For installing 5.6.12 version:
Download deb file from:
https://www.elastic.co/downloads/past-releases/elasticsearch-5-6-12
Install with:
sudo dpkg -i elasticsearch-5.6.12.deb
It indicates that log4j2.properties file is missing.
Elastic will also show the location where he tries to find it, probably it is [/etc/elasticsearch].
You should run sudo -i, refer to that directory and create a file with adjusted properties: