Created
November 23, 2021 04:08
-
-
Save madaarya/167a3e6dad2532ca68502318e472b008 to your computer and use it in GitHub Desktop.
Step by step Install elasticsearch on wsl2 + ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// elasticsearch version 7 | |
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-7.5.2-linux-x86_64.tar.gz | |
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-7.5.2-linux-x86_64.tar.gz.sha512 | |
shasum -a 512 -c elasticsearch-oss-7.5.2-linux-x86_64.tar.gz.sha512 | |
tar -xzf elasticsearch-oss-7.5.2-linux-x86_64.tar.gz | |
cd elasticsearch-oss-7.5.2/ | |
echo 'export ES_HOME="$HOME/elasticsearch-7.5.2/"' >> ~/.bashrc | |
echo 'export PATH="$ES_HOME/bin:$PATH"' >> ~/.bashrc | |
exec $SHELL | |
// elasticsearch version 6 | |
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.20.tar.gz | |
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.20.tar.gz.sha512 | |
shasum -a 512 -c elasticsearch-6.8.20.tar.gz.sha512 | |
tar -xzf elasticsearch-6.8.20.tar.gz | |
cd elasticsearch-6.8.20/ | |
echo 'export ES_HOME="$HOME/elasticsearch-6.8.20/"' >> ~/.bashrc | |
echo 'export PATH="$ES_HOME/bin:$PATH"' >> ~/.bashrc | |
exec $SHELL | |
// Just in case missing JAVA_HOME | |
// if not installed, do install first | |
sudo apt install openjdk-11-jdk | |
echo 'export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"' >> ~/.bashrc | |
Run with command: | |
elasticsearch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On Ubuntu, modify this script and add it as
/etc/init.d/elasticsearch
.Then use cmds -
sudo /etc/init.d/elasticsearch start
,sudo /etc/init.d/elasticsearch stop