Chef infra SSH::使用刀子连接超时

Chef infra SSH::使用刀子连接超时,chef-infra,knife-solo,Chef Infra,Knife Solo,我正在尝试使用刀独奏和流浪汉测试厨师烹饪书 使用vagrant ssh config提供的信息,我可以按如下方式连接到我的vagrant主机: ssh -p 3774 -i /path/to/.vagrant/machines/default/virtualbox/private_key vagrant@localhost 我打电话给刀子独奏: knife solo prepare -p 3774 -i /path/to/.vagrant/machines/default/virtualbox

我正在尝试使用
刀独奏
流浪汉
测试厨师烹饪书

使用
vagrant ssh config
提供的信息,我可以按如下方式连接到我的vagrant主机:

ssh -p 3774 -i /path/to/.vagrant/machines/default/virtualbox/private_key vagrant@localhost
我打电话给刀子独奏:

knife solo prepare -p 3774 -i /path/to/.vagrant/machines/default/virtualbox/private_key vagrant@localhost -VV
这引发了一个例外:

ERROR: Net::SSH::ConnectionTimeout: Net::SSH::ConnectionTimeout
堆栈跟踪:

Bootstrapping Chef...
/usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/session.rb:90:in `rescue in initialize': Net::SSH::ConnectionTimeout (Net::SSH::ConnectionTimeout)
    from /usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/session.rb:57:in `initialize'
    from /usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-3.2.0/lib/net/ssh.rb:232:in `new'
    from /usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-3.2.0/lib/net/ssh.rb:232:in `start'
    from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/knife-solo/ssh_connection.rb:42:in `session'
    from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/knife-solo/ssh_command.rb:153:in `try_connection'
    from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/knife-solo/ssh_command.rb:194:in `detect_authentication_method'
    from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/knife-solo/ssh_command.rb:290:in `run_command'
    from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/chef/knife/solo_prepare.rb:71:in `operating_system'
    from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/chef/knife/solo_prepare.rb:67:in `bootstrap'
    from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/chef/knife/solo_prepare.rb:57:in `run'
    from /usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:442:in `block in run_with_pretty_exceptions'
    from /usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/local_mode.rb:44:in `with_server_connectivity'
    from /usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:441:in `run_with_pretty_exceptions'
    from /usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:219:in `run'
    from /usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application/knife.rb:156:in `run'
    from /usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/bin/knife:25:in `<top (required)>'
    from /usr/local/bin/knife:22:in `load'
    from /usr/local/bin/knife:22:in `<main>'
Bootstrapping Chef。。。
/usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/session.rb:90:“初始化中的救援”:net::ssh::ConnectionTimeout(net::ssh::ConnectionTimeout)
来自/usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/session.rb:57:在“初始化”中
from/usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-3.2.0/lib/net/ssh.rb:232:in'new'
from/usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-3.2.0/lib/net/ssh.rb:232:in'start'
来自/usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/knife-solo/ssh_connection.rb:42:在“会话”中
来自/usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/knife-solo/ssh_命令。rb:153:in“try_连接”
来自/usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/knife-solo/ssh_命令。rb:194:in“detect_authentication_方法”
from/usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/knife-solo/ssh_命令。rb:290:in“run_命令”
from/usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/chef/knife/solo\u prepare.rb:71:in“操作系统”
from/usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/chef/knife/solo_prepare.rb:67:in“bootstrap”
from/usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/chef/knife/solo_prepare.rb:57:in'run'
from/usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:442:in'block in run_与_pretty_异常'
从/usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/local\u mode.rb:44:“与服务器连接”
from/usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:441:in'run_with_pretty_exceptions'
from/usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:219:in'run'
from/usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application/knife.rb:156:in'run'
from/usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/bin/knife:25:in`'
from/usr/local/bin/DOVE:22:in“装载”
from/usr/local/bin/knife:22:in`'
不确定什么可能导致
刀索洛
失败。我还尝试指定了
-P
流浪者密码,而不是身份文件,效果相同

如何连接本地主机


谢谢你的帮助

如果安装了chefdk,请尝试使用以下方法隔离ssh问题:
shove ssh localhost--ssh端口3774'sudo chef client'--手动列表--ssh user vagrant--identity file/path/to/.vagrant/machines/default/virtualbox/private_key
。。。它可能不会运行
chef-client
进程(如果节点尚未启动),但应该让您知道ssh连接是否正常。我已经有一年多的时间遇到同样的问题,并且它已经结束了我对chef的使用。FWIW我旋转了两个VBox,看看是否有任何改进,但没有。此外,
knife-ssh
连接可以正常工作。如果安装了chefdk,请尝试使用以下方法隔离ssh问题:
knife-ssh-localhost--ssh端口3774'sudo-chef-client'--手动列表--ssh-user-vagrant--identity-file/path/to/.vagrant/machines/default/virtualbox/private\u-key
。。。它可能不会运行
chef-client
进程(如果节点尚未启动),但应该让您知道ssh连接是否正常。我已经有一年多的时间遇到同样的问题,并且它已经结束了我对chef的使用。FWIW我旋转了两个VBox,看看是否有任何改进,但没有。此外,
ssh
连接可以正常工作。