2014-12-29 48 views
2

我已經建立了廚師服務器和工作站之前,配置節點,運行食譜和廚師工作。但最近我一直在面對這個問題,這幾天一直困擾着我。廚師工作站錯誤

當我運行了設置工作站

knife configure -i

的提示,要求我們輸入的PEM文件和服務器FQDN位置的細節等

下面是命令錯誤:

[[email protected] .chef]# knife configure -i 
Overwrite /root/.chef/knife.rb? (Y/N) Y 
Please enter the chef server URL: [https://myserver.example.com:443] 
Please enter a name for the new user: [root] anyuser 
Please enter the existing admin name: [admin] 
Please enter the location of the existing admin's private key: [/etc/chef-server/admin.pem] ~/.chef/admin.pem 
Please enter the validation clientname: [chef-validator] 
Please enter the location of the validation key: [/etc/chef-server/chef-validator.pem] ~/.chef/chef-validator.pem 
Please enter the path to a chef repository (or leave blank): 
Creating initial API user... 
Please enter a password for the new user: 
ERROR: Service temporarily unavailable 
/opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:325:in `stream_check': undefined method `closed?' for nil:NilClass (NoMethodError) 
     from /opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:199:in `read_body' 
     from /opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:226:in `body' 
     from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:502:in `rescue in format_rest_error' 
     from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:500:in `format_rest_error' 
     from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:480:in `humanize_http_exception' 
     from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:430:in `humanize_exception' 
     from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:421:in `rescue in run_with_pretty_exceptions' 
     from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:412:in `run_with_pretty_exceptions' 
     from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:213:in `run' 
     from /opt/chef/embedded/apps/chef/lib/chef/application/knife.rb:139:in `run' 
     from /opt/chef/embedded/apps/chef/bin/knife:25:in `<top (required)>' 
     from /usr/bin/knife:40:in `load' 
     from /usr/bin/knife:40:in `<main>' 

這是痕跡。 謝謝。

+0

如果這是你應該_really_使用廚師服務器12,並且值得注意的是刀配置新的服務器廚師是不是大廚服務器12 – coderanger

+0

@coderanger兼容:[鏈接](HTTP ://stackoverflow.com/questions/28191009/chef-server-does-not-generate-admin-pem)請檢查鏈接,我一直使用廚師12 facinf問題。 – ripevik

回答

0

你使用什麼版本的廚師?我想知道您是否遇到CHEF-4010這是註冊新用戶時遇到的問題。 (刀命令的「-i」參數)。

作爲廚師服務器11的解決方案,我可以建議在您的廚師服務器上使用預配置的「管理員」用戶。請參閱:

+0

非常感謝,幫助,但我想知道這個錯誤是什麼,什麼解決了這個問題。而不是由knife提示的參數,我們使用了我們自己的參數。我不知道它是如何不提示passwd造成問題的。 – ripevik

+0

@vikramiyer「-i」參數在廚師服務器上創建一個新用戶。這就是爲什麼我問你使用什麼版本的廚師(在版本11.6.0修復CHEF-4010)。我建議的解決方法是使用所有新廚師服務器上存在的「admin」用戶,解釋爲什麼沒有提示您輸入密碼。 –

+0

很好解釋! :)現在,當我試圖向服務器註冊一個節點(客戶端)時,它會引發以下錯誤。 [鏈接](http://stackoverflow.com/questions/27689327/chef-node-not-registering-with-server) – ripevik

5

因爲代理有時會出現此錯誤。
只需取消設置代理:

unset http_proxy 
unset https_proxy