流浪的虚拟机可以互相通话,但我无法通过主机

时间:2016-01-17 21:50:36

标签: solr vagrant vagrantfile

我在192.168.56上有5个虚拟机。*:

  • .19 - Zookeeper
  • .20 - Solr1
  • .21 - Solr2
  • .22 - Solr3
  • .23 - Solr4

这是我的Vagrantfile:

Vagrant.configure(2) do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://atlas.hashicorp.com/search.
  # config.vm.box = "base"

  (1..4).each do |x|
    ip = 20
    config.vm.define "solr#{x}" do |solr|
      solr.vm.box = 'ubuntu/wily64'
      solr.vm.network "private_network", ip: "192.168.56.#{ip}", bridge: "Intel(R) Centrino(R) Advanced-N 6205"
      ip = ip + 1
      solr.vm.provider "virtualbox" do |v|
        v.memory = 2048
        #v.cpus = 1
      end
    end
  end
end

我在端口80上有Apache HTTP,在端口8983上有Solr。我可以从ZooKeeper VM做wget 192.168.56.20:8983并下载主页面。当我尝试从主机操作系统命中192.168.56.20:8983时,它只是挂起。防火墙规则已经到位,可以打开这些端口,所以不知道为什么.19可以访问Solr,但主机不能。

有什么想法吗?

0 个答案:

没有答案