Chef Selenium:rubyzip 无法在 Windows Server 2008 上分配内存问题
Chef Selenium: rubyzip failure to allocate memory issue on Windows Server 2008
在 Windows Server 2008 和 2008R2 上发生以下异常:
================================================================================
Error executing action `install` on resource 'chef_gem[rubyzip]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of C:/opscode/chef/embedded/bin/gem install rubyzip -q --no-rdoc --no-ri -v "1.1.7" ----
STDOUT:
STDERR: [FATAL] failed to allocate memory
---- End output of C:/opscode/chef/embedded/bin/gem install rubyzip -q --no-rdoc --no-ri -v "1.1.7" ----
Ran C:/opscode/chef/embedded/bin/gem install rubyzip -q --no-rdoc --no-ri -v "1.1.7" returned 1
这不会发生在 Windows Server 2012 和 2012 R2 上。
来自https://github.com/chef/knife-windows#nodes:
Chef 和 Ohai gem 安装(在 bootstrap 期间发生)比旧版本 Windows 上每个 shell 默认的 150MB WinRM 分配更多的内存(在 Windows Server 2012 之前)——这会减慢 bootstrap。可选择使用以下命令将内存限制增加到 300MB:
winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}
另请注意:
Windows 2008R2 及更早版本需要额外配置 MaxTimeoutms 以避免 WinRM::WinRMHTTPTransportError: Bad HTTP response error while bootstrapping。它应该至少是 300000.
winrm set winrm/config @{MaxTimeoutms=300000}
调整 winrm 设置未能解决问题。
Rubyzip 似乎是分配了太多对象的问题:
http://blog.huangzhimin.com/2012/10/02/avoid-using-rubyzip/
用 powershell 替换 rubyzip 实现解决了这个问题:
在 Windows Server 2008 和 2008R2 上发生以下异常:
================================================================================
Error executing action `install` on resource 'chef_gem[rubyzip]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of C:/opscode/chef/embedded/bin/gem install rubyzip -q --no-rdoc --no-ri -v "1.1.7" ----
STDOUT:
STDERR: [FATAL] failed to allocate memory
---- End output of C:/opscode/chef/embedded/bin/gem install rubyzip -q --no-rdoc --no-ri -v "1.1.7" ----
Ran C:/opscode/chef/embedded/bin/gem install rubyzip -q --no-rdoc --no-ri -v "1.1.7" returned 1
这不会发生在 Windows Server 2012 和 2012 R2 上。
来自https://github.com/chef/knife-windows#nodes:
Chef 和 Ohai gem 安装(在 bootstrap 期间发生)比旧版本 Windows 上每个 shell 默认的 150MB WinRM 分配更多的内存(在 Windows Server 2012 之前)——这会减慢 bootstrap。可选择使用以下命令将内存限制增加到 300MB:
winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}
另请注意:
Windows 2008R2 及更早版本需要额外配置 MaxTimeoutms 以避免 WinRM::WinRMHTTPTransportError: Bad HTTP response error while bootstrapping。它应该至少是 300000.
winrm set winrm/config @{MaxTimeoutms=300000}
调整 winrm 设置未能解决问题。
Rubyzip 似乎是分配了太多对象的问题: http://blog.huangzhimin.com/2012/10/02/avoid-using-rubyzip/
用 powershell 替换 rubyzip 实现解决了这个问题: