Skip to content

Instantly share code, notes, and snippets.

@keisatou
Last active December 30, 2015 13:59
Show Gist options
  • Save keisatou/7838805 to your computer and use it in GitHub Desktop.
Save keisatou/7838805 to your computer and use it in GitHub Desktop.
yum -y install unzip
wget -O serf-0.3.0.zip https://dl.bintray.com/mitchellh/serf/0.3.0_linux_amd64.zip
unzip serf-0.3.0.zip
mv serf /usr/local/bin/serf-0.3.0
ln -s /usr/local/bin/serf-0.3.0 /usr/local/bin/serf
/etc/init.d/iptables stop
chkconfig iptables off
http://www.slideshare.net/zembutsu/serf-the-liberator# を参考にserfを試した。
時間無いので自分用のメモとして残す。あとで清書する。たぶん。
# VagrantでVMを2台用意
vagrant up serf_a
vagrant up serf_b
# serfをinstall
略。
# serf agent を起動
## on seerf_a
serf agent -bind=192.168.33.10 &
## on seerf_b
serf agent -bind=192.168.33.20 &
# serf eventを発行
serf event 'hello world'
※ 両方のVMにeventが届く
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.define "serf_a" do |serf_a|
serf_a.vm.box = "base"
serf_a.vm.network :private_network, ip: "192.168.33.10"
serf_a.vm.provision "shell", path: "init_serf.sh"
end
config.vm.define "serf_b" do |serf_b|
serf_b.vm.box = "base"
serf_b.vm.network :private_network, ip: "192.168.33.20"
serf_b.vm.provision "shell", path: "init_serf.sh"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment