我刚开始与 Chef 合作,对 DevOps 领域还很陌生。
我安装了 Chef Server,它运行良好,然后我开始使用 Knife 并添加了两个客户端——我的 MacBook(OS X)和一个我不管理自己的 Ubuntu 10.04 服务器,所以我不得不请一个系统管理员来将 chef-client 安装到这台机器上。我创建了一本测试食谱并将其添加到每个客户端的运行列表中。但是,当我尝试在它们两个上运行 chef-client 时,在我的 Mac OS X 机器上一切正常,而 Ubuntu 10.04 运行抛出错误:
$ sudo chef-client
[Wed, 17 Apr 2013 16:32:26 +0200] INFO: Starting Chef Run (Version 0.9.18)
[Wed, 17 Apr 2013 16:32:27 +0200] ERROR: Running exception handlers
[Wed, 17 Apr 2013 16:32:27 +0200] ERROR: Exception handlers complete
/usr/lib/ruby/1.8/net/http.rb:2101:in `error!': 404 "Object Not Found" (Net::HTTPServerException)
from /usr/lib/ruby/1.8/chef/rest.rb:234:in `api_request'
from /usr/lib/ruby/1.8/chef/rest.rb:285:in `retriable_rest_request'
from /usr/lib/ruby/1.8/chef/rest.rb:215:in `api_request'
from /usr/lib/ruby/1.8/chef/rest.rb:226:in `api_request'
from /usr/lib/ruby/1.8/chef/rest.rb:335:in `follow_redirect'
from /usr/lib/ruby/1.8/chef/rest.rb:226:in `api_request'
from /usr/lib/ruby/1.8/chef/rest.rb:285:in `retriable_rest_request'
from /usr/lib/ruby/1.8/chef/rest.rb:215:in `api_request'
from /usr/lib/ruby/1.8/chef/rest.rb:111:in `get_rest'
from /usr/lib/ruby/1.8/chef/client.rb:252:in `sync_cookbooks'
from /usr/lib/ruby/1.8/chef/client.rb:165:in `run'
from /usr/lib/ruby/1.8/chef/application/client.rb:222:in `run_application'
from /usr/lib/ruby/1.8/chef/application/client.rb:212:in `loop'
from /usr/lib/ruby/1.8/chef/application/client.rb:212:in `run_application'
from /usr/lib/ruby/1.8/chef/application.rb:62:in `run'
from /usr/bin/chef-client:26
该错误看起来很普遍,因此找出原因并没有太大帮助。