Skip to content

Instantly share code, notes, and snippets.

@zhanghui9700
Last active August 29, 2015 13:57
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 zhanghui9700/9780549 to your computer and use it in GitHub Desktop.
Save zhanghui9700/9780549 to your computer and use it in GitHub Desktop.
vagrantfile for test keepalived
http://blog.csdn.net/k_james/article/details/12994145
VM1: 192.168.1.11
VM2: 192.168.1.13
VIP: 192.168.1.201
VM1: /etc/keepalived/keepalived.conf
vrrp_instance VI_NODE {
state MASTER
interface eth2
virtual_router_id 100
priority 200
advert_int 1
#track_script {
# chk_nginx
#}
virtual_ipaddress {
192.168.1.201
}
}
VM2: /etc/keepalived/keepalived.conf
vrrp_instance VI_NODE {
state MASTER
interface eth2
virtual_router_id 100
priority 100
advert_int 1
#track_script {
# chk_nginx
#}
virtual_ipaddress {
192.168.1.201
}
}
---
Vagrantfile
# -*- 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|
-
config.vm.define :node1 do |node1|
node1.vm.box = "precise64"
node1.vm.hostname = "ceph-admin.fx-dev.net"
node1.vm.network :private_network, :ip => "192.168.176.99"
node1.vm.network :public_network, :bridge => "en1"
end-
-
config.vm.define :node2 do |node2|
node2.vm.box = "precise64"
node2.vm.hostname = "ceph-client.fx-dev.net"
node2.vm.network :private_network, :ip => "192.168.176.101"
node2.vm.network :public_network, :bridge => "en1"
end-
-
config.vm.provider :virtualbox do |vb|
vb.gui = false
vb.customize ["modifyvm", :id, "--memory", "2048"]
vb.customize ["modifyvm", :id, "--ioapic", "on"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
end-
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment