40. Vagrant
• Vagrant uses VirtualBox to build configurable,
lightweight, and portable virtual machines
dynamically
• Open Source: MIT license
• It support more providers recently:
• VMware Fusion
• AWS EC2
• Rackspace
73. Server provisioning
• Server provisioning is a set of actions to
prepare a server with appropriate systems,
data and software, and make it ready for
network operation. (from wikipedia)
74. Server provisioning
• Server provisioning is a set of actions to
prepare a server with appropriate systems,
data and software, and make it ready for
network operation. (from wikipedia)
• 就是裝 server 啦
100. Chef Example
package "nginx"
service "nginx" do
supports :status => true, :restart => true, :reload => true
action [:enable, :start]
end
template "/etc/nginx/nginx.conf" do
source "nginx.conf.erb"
notifies :reload, "service[nginx]"
end
105. Multi-VM
• 同⼀一個 Vagrantfile 可以設定多個 VM
• vagrant up 就會同時開起來
• 適合 distributed 和 SOA 開發環境
• ⼀一台 Web server
• 多台 Application servers
• ⼀一台 Database server
106. Vagrantfile example
指定IP,VMs 之間也可以互通
Vagrant.configure("2") do |config|
config.vm.define :web do |web|
web.vm.box = "precise64"
web.vm.network :private_network, :ip => "192.168.33.11"
end
config.vm.define :app do |app|
app.vm.box = "precise64"
app.vm.network :private_network, :ip => "192.168.33.12"
end
config.vm.define :db do |db|
db.vm.box = "precise64"
db.vm.network :private_network, :ip => "192.168.33.13"
end
end