Vagrant SSH连接失败.....(错误:ECONNREFUSED - 连接(2)127.0.0.1:2200)

时间:2016-03-29 13:40:02

标签: vagrant chef test-kitchen

我正在尝试使用Vagrant(1.8.1)和Virtualbox(5.0)在代理服务器(使用charles代理配置)后面运行kitchen-converge / test。

我要么在进行厨房测试时挂断电话,要么在运行厨房时拒绝连接。

我发布了包含错误的配置和日志文件。我使用berkshelf,test-kitchen和proxyconf,因为有代理服务器。

是否有人可以告知可能遗漏的内容并导致此错误发生以及如何解决。

配置&日志文件:

kitchen.yml

driver:
name: vagrant
customize:
natdnshostresolver1: "on"
network:
 - ["forwarded_port", { guest: 81, host: 8082 }]
 - ["forwarded_port", { guest: 80, host: 8087 }]
provisioner:
 chef_omnibus_url: http://www.chef.io/chef/install.sh
 name: chef_zero
 platforms:
 - name: centos-6.7
 suites:
 - name: default
 run_list:
 - recipe[chef-boxtest::default]
 attributes:

Vagrant档案

if Vagrant.has_plugin?("vagrant-proxyconf")
  config.proxy.http = "http://proxy.abc.com:8099"
  config.proxy.https = "https://proxy.abc.com:8099"
  config.proxy.no_proxy = "localhost,127.0.0.1"
end

厨房测试

[SSH] Established
   Vagrant instance <default-centos-67> created.
   Finished creating <default-centos-67> (3m39.40s).
   -----> Converging <default-centos-67>...
   Preparing files for transfer
   Preparing dna.json
   Resolving cookbook dependencies with Berkshelf 4.3.1...
   Removing non-cookbook files before transfer
   Preparing validation.pem
   Preparing client.rb
   -----> Installing Chef Omnibus (install only if missing)
   Downloading http://www.chef.io/chef/install.sh to file /tmp/install.sh
   Trying wget...

厨房-收敛

[SSH] connection failed, retrying in 1 seconds (#<Errno::ECONNREFUSED:   Connection refused - connect(2) for 127.0.0.1:2222>)
[SSH] connection failed, retrying in 1 seconds (#<Errno::ECONNREFUSED: Connection refused - connect(2) for 127.0.0.1:2222>)
$$$$$$ [SSH] connection failed, terminating (#<Errno::ECONNREFUSED: Connection refused - connect(2) for 127.0.0.1:2200>)
>>>>>> Converge failed on instance <default-ubuntu-1204>.

1 个答案:

答案 0 :(得分:1)

我从未在厨房使用过Vagrantfile,因为kitchen-vagrant driver会动态生成Vagrant文​​件。

我建议你删除你的Vagrant文​​件并修改.kitchen.yml文件以包含你需要的代理数据。