commit
cf4e9a3f8c
@ -0,0 +1,28 @@
|
|||||||
|
# -*- mode: ruby -*-
|
||||||
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
|
VAGRANTFILE_API_VERSION = "2"
|
||||||
|
|
||||||
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
|
config.vm.box = "ubuntu/trusty64"
|
||||||
|
|
||||||
|
config.vm.define "rqlite" do |rqlite|
|
||||||
|
config.vm.network "private_network", ip: "192.168.200.10"
|
||||||
|
config.vm.provision :shell, :path => "setup.sh"
|
||||||
|
config.vm.provision :shell, :inline => "rqlite -logfile /vagrant/rqlite1.log ~/node.1 &"
|
||||||
|
|
||||||
|
if not ENV['CLUSTER_SIZE'].nil?
|
||||||
|
port = 4001
|
||||||
|
(2..ENV['CLUSTER_SIZE'].to_i).each do |i|
|
||||||
|
port = port + 1
|
||||||
|
config.vm.provision :shell, :inline => "rqlite -join localhost:4001 -p #{port} -logfile /vagrant/rqlite#{i}.log ~/node.#{i} &"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.provider :virtualbox do |vb|
|
||||||
|
vb.customize ["modifyvm", :id, "--memory", "2048"]
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
add-apt-repository ppa:git-core/ppa -y
|
||||||
|
echo "Updating..."
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y curl git bison make mercurial sqlite3
|
||||||
|
|
||||||
|
# Golang
|
||||||
|
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
|
||||||
|
source ~/.gvm/scripts/gvm
|
||||||
|
gvm install go1.4
|
||||||
|
gvm use go1.4
|
||||||
|
|
||||||
|
# Rqlite
|
||||||
|
mkdir -p rqlite
|
||||||
|
cd rqlite
|
||||||
|
export GOPATH=$PWD
|
||||||
|
go get github.com/otoolep/rqlite
|
||||||
|
ln -s $GOPATH/bin/rqlite /usr/local/bin/rqlite
|
Loading…
Reference in New Issue