I want to create a cluster of 4 CentOS VMs using Vagrant. I installed Vagrant and VirtualBox on my Widnows machine, downloaded the CentOS 64 box and created the cluster. Steps:
- Execute 'vagrant box add --name centos65-base'
- Execute 'vagrant init centos65-base'
Edit the VagrantFile as follows:
# -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure(2) do |config| config.vm.define :node1 do |node1_config| node1_config.vm.box = "centos65_base" node1_config.vm.network "private_network", ip: "10.0.2.5" end config.vm.define :node2 do |node2_config| node2_config.vm.box = "centos65_base" node2_config.vm.network "private_network", ip: "10.0.2.6" end config.vm.define :node3 do |node3_config| node3_config.vm.box = "centos65_base" node3_config.vm.network "private_network", ip: "10.0.2.7" end config.vm.define :node4 do |node4_config| node4_config.vm.box = "centos65_base" node4_config.vm.network "private_network", ip: "10.0.2.8" end end
Execute 'vagrant up'
At the end of the fourth step, the four nodes of the cluster got configured and brought up, which is great. I sshed into them. I was able to ping to www.google.com and my host machine successfully from the VMs. However, pinging from one node in the cluster to another gives the "destination host unreachable" error. I ran 'ifconfig' to see the network adapters in use. eth0 is being used for DHCP and eth1 is being used for static ip.
[root@vagrant-centos65 vagrant]# ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:4F:B8:06
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe4f:b806/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1142 errors:0 dropped:0 overruns:0 frame:0
TX packets:672 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:106471 (103.9 KiB) TX bytes:84099 (82.1 KiB)
eth1 Link encap:Ethernet HWaddr 08:00:27:EC:A0:37
inet addr:10.0.2.5 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:feec:a037/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:268 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:27329 (26.6 KiB) TX bytes:482 (482.0 b)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:784 (784.0 b) TX bytes:784 (784.0 b)
Any idea how to fix this? I need the VMs in the cluster to be able to talk to each other.