Skip to content

Instantly share code, notes, and snippets.

@w33ble
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save w33ble/c106aa4decc99186f242 to your computer and use it in GitHub Desktop.
Save w33ble/c106aa4decc99186f242 to your computer and use it in GitHub Desktop.
Simple shell-based Vagrant setup for ElasticSearch
#!/usr/bin/env bash
# User settings
ESVERSION='1.2.2'
ESURL="https://download.elasticsearch.org/elasticsearch/elasticsearch"
TARFILE="elasticsearch-${ESVERSION}.tar.gz"
# Allow installation of PPAs and update packages
apt-get update
apt-get install -y python-software-properties
# Automated install of Oracle Java
add-apt-repository -y ppa:webupd8team/java
apt-get update
echo debconf shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
apt-get install -y oracle-java7-installer
# Grab and unpack ElasticSearch tarball
wget -q "${ESURL}/${TARFILE}"
su vagrant -c "tar -zxf ${TARFILE}"
echo "ElasticSearch is not running, SSH in to start it"
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.provision :shell, :path => "provision.sh"
config.vm.network :forwarded_port, host: 9200, guest: 9200
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--cpuexecutioncap", "60", "--cpus", "1"]
vb.memory = 512
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment