Skip to content

Instantly share code, notes, and snippets.

@rdlu
Forked from tkoeppen/setupElasticSearch.sh
Created February 19, 2013 17:58
Show Gist options
  • Save rdlu/4988257 to your computer and use it in GitHub Desktop.
Save rdlu/4988257 to your computer and use it in GitHub Desktop.
#!/bin/bash
# install elasticsearch VERSION on Ubuntu 12.04 (precise)
VERSION=0.19.8
curl -OL -k http://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-$VERSION.zip
unzip elasticsearch-$VERSION.zip
sudo mv elasticsearch-$VERSION /usr/local/
if [ -L /usr/local/elasticsearch ]
then sudo rm /usr/local/elasticsearch
fi
sudo ln -s /usr/local/elasticsearch-$VERSION /usr/local/elasticsearch
# fix wrong permission from the original zip
sudo find /usr/local/elasticsearch/ -type d -exec chmod 755 {} \;
curl -L http://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master | tar -xz
sudo mv *servicewrapper*/service /usr/local/elasticsearch/bin/
rm -Rf *servicewrapper*
sudo chown -R root:root /usr/local/elasticsearch-$VERSION
# install init.d
if [ -L /etc/init.d/elasticsearch ]
then sudo rm /etc/init.d/elasticsearch
fi
sudo /usr/local/elasticsearch/bin/service/elasticsearch install
if [ -L /usr/local/bin/elasticsearch ]
then sudo rm /usr/local/bin/elasticsearch
fi
sudo ln -s `readlink -f /usr/local/elasticsearch/bin/service/elasticsearch` /usr/local/bin/elasticsearch
# fix missing logs dir for first wrapper start
sudo mkdir /usr/local/elasticsearch/logs
# eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment