Last active
August 29, 2015 14:04
-
-
Save w33ble/c106aa4decc99186f242 to your computer and use it in GitHub Desktop.
Simple shell-based Vagrant setup for ElasticSearch
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
#!/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" |
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
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