Created
October 7, 2015 15:30
-
-
Save ncolomer/dfcf2ca5026171653561 to your computer and use it in GitHub Desktop.
Install elasticsearch on any Linux
This file contains hidden or 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
#!/bin/bash | |
[[ "$UID" -ne "$ROOT_UID" ]] && echo "You must be root to do that!" && exit 1 | |
VERSION=${1:-"1.1.1"} | |
IP=$(ifconfig eth0 | grep -oP 'inet addr:\K\S+') | |
apt-get update | |
apt-get install -y screen unzip wget nmon openjdk-7-jdk | |
wget -P /tmp https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-${VERSION}.zip | |
unzip /tmp/elasticsearch-${VERSION}.zip -d /opt | |
cd /opt/elasticsearch-$VERSION | |
mkdir -p /mnt/elasticsearch | |
sed -iE "s|^# path.data:.*$|path.data: /mnt/elasticsearch|" config/elasticsearch.yml | |
sed -iE "s|^# network.host:.*$|network.host: $IP|" config/elasticsearch.yml | |
bin/plugin -i mobz/elasticsearch-head | |
bin/plugin -i elasticsearch/marvel/latest | |
bin/elasticsearch -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment