无法CHEF引导Windows EC2实例,Winrm错误

时间:2015-08-04 07:29:18

标签: amazon-ec2 chef winrm

我正在使用CHEF 12并尝试从我的工作站引导EC2实例(Win server 2012 R2)。但是,我收到以下错误。

> Waiting for remote response before
> bootstrap.....................ERROR: No response received from remote
> node after 2.08 minutes, giving up. ERROR: Network Error: No
> connection could be made because the target machine actively refused
> it. - connect(2) (http://52.76.1.57:5985) Check your knife
> configuration and network settings

我有两台CHEF服务器(托管和内部部署);我尝试使用其中的每一个来引导EC2实例,但得到相同的结果。

通过power-shell发布的Chef bootstrap命令:

PS ~\chef-repo> knife bootstrap windows winrm 52.76.1.57 --winrm-user Administrator --winrm-password '******' --node-name node_145 --run-list 'recipe[ie::esc],recipe[install_iis]'

据我研究,这是因为我无法建立从工作站到Ec2实例的WINRM连接。然而,我能够连接到办公室网络中的另一台Win 2012服务器并成功引导。

  • 已经远程登录到EC2实例并从powershell运行winrm quickconfig。
  • 已将管理员密码设置为所需的密码。
  • 已在端口5985和5986
  • 上打开WIndows远程管理的入站防火墙规则
  • 为AWS
  • 上的端口5985和5986设置setcurity组并允许入站自定义TCP规则

2 个答案:

答案 0 :(得分:1)

你为此采取了所有必要的步骤,是否有可能被防火墙过滤(例如公司防火墙)?

fyi,我设法通过以下步骤来引导机器:

# configure winrm for using knife winrm
winrm set winrm/config/service/auth '@{Basic="true"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
set-item WSMan:\localhost\Client\allowunencrypted $true
#turn off firewall
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False
编辑:总结下面的评论,问题是阻止流量的公司防火墙

答案 1 :(得分:0)

Windows 2012 R2介绍了WinRM安全性中的更改,这些更改提供了一些旧文章/自述文件示例,说明knife-ecknife-windows的使用情况无法使用。

本文http://blog.coderinserepeat.com/2015/07/15/chef-knife-ec2-and-knife-windows/几乎总结了如何在最近版本的刀插件中处理这个问题。