Skip to content

Instantly share code, notes, and snippets.

@radermacher
Last active March 11, 2016 08:35
Show Gist options
  • Save radermacher/72bbcadeb38f91c75654 to your computer and use it in GitHub Desktop.
Save radermacher/72bbcadeb38f91c75654 to your computer and use it in GitHub Desktop.
Install Elasticsearch 2.x by mikestivala (http://forgerecipes.com/recipes/73)
echo ">> Installing Elastic GPG Key"
wget -O - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | apt-key add -
echo ">> Adding deb package"
echo "deb http://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list
echo ">> Updating apt"
add-apt-repository ppa:webupd8team/java
apt-get update
echo ">> Pre-agreeing to Oracle License"
echo debconf shared/accepted-oracle-license-v1-1 select true | \
sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | \
sudo debconf-set-selections
echo ">> Installing Java and Elastic Search"
apt-get -y install oracle-java7-installer elasticsearch
echo ">> Java Installed"
echo ">> Elastic Search Installed"
echo ">> Scheduling Elasticsearch"
update-rc.d elasticsearch defaults 95 10
echo ">> Starting Elasticsearch"
/etc/init.d/elasticsearch start
echo ">> Test running Elasticsearch"
curl "localhost:9200"
echo ">> Running on port 9200. Make sure to add a firewall rule if you need external access."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment