我正在尝试按照这些说明在Ubuntu 12.04上安装chef-server。
http://docs.opscode.com/install_server.html
我的研究表明,通常当这个错误表明它是自我时,这是因为主机名
以下是我的主机设置:
root@dutches:/home/mrrc# cat /etc/hosts
127.0.0.1 chef.dutches.com dutches localhost localhost.localdomain
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
root@dutches:/home/mrrc# cat /etc/hostname
chef.dutches.com
root@dutches:/home/mrrc# hostname -f
chef.dutches.com
root@dutches:/home/mrrc# ping chef.dutches.com
PING chef.dutches.com (127.0.0.1) 56(84) bytes of data.
64 bytes from chef.dutches.com (127.0.0.1): icmp_req=1 ttl=64 time=1.97 ms
64 bytes from chef.dutches.com (127.0.0.1): icmp_req=2 ttl=64 time=0.098 ms
64 bytes from chef.dutches.com (127.0.0.1): icmp_req=3 ttl=64 time=0.079 ms
64 bytes from chef.dutches.com (127.0.0.1): icmp_req=4 ttl=64 time=0.074 ms
^C
--- chef.dutches.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3002ms
rtt min/avg/max/mdev = 0.074/0.557/1.979/0.821 ms
然而,当我尝试配置厨师时,我总是会收到此错误:
Recipe: chef-server::bootstrap
* execute[verify-system-status] action run
================================================================================
Error executing action `run` on resource 'execute[verify-system-status]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '22'
---- Begin output of curl -sf http://127.0.0.1:8000/_status ----
STDOUT:
STDERR:
---- End output of curl -sf http://127.0.0.1:8000/_status ----
Ran curl -sf http://127.0.0.1:8000/_status returned 22
Resource Declaration:
---------------------
# In /opt/chef-server/embedded/cookbooks/chef-server/recipes/bootstrap.rb
24: execute "verify-system-status" do
25: command "curl -sf #{erchef_status_url}"
26: retries 20
27: not_if { File.exists?(bootstrap_status_file) }
28: end
29:
Compiled Resource:
------------------
# Declared in /opt/chef-server/embedded/cookbooks/chef-server/recipes/bootstrap.rb:24:in `from_file'
execute("verify-system-status") do
action "run"
retries 0
retry_delay 2
guard_interpreter :default
command "curl -sf http://127.0.0.1:8000/_status"
backup 5
returns 0
cookbook_name :"chef-server"
recipe_name "bootstrap"
not_if { #code block }
end
Running handlers:
[2014-07-17T17:01:09-04:00] ERROR: Running exception handlers
Running handlers complete
[2014-07-17T17:01:09-04:00] ERROR: Exception handlers complete
[2014-07-17T17:01:09-04:00] FATAL: Stacktrace dumped to /opt/chef-server/embedded/cookbooks/cache/chef-stacktrace.out
Chef Client failed. 10 resources updated in 70.5072942 seconds
[2014-07-17T17:01:09-04:00] ERROR: execute[verify-system-status] (chef-server::bootstrap line 24) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '22'
---- Begin output of curl -sf http://127.0.0.1:8000/_status ----
STDOUT:
STDERR:
---- End output of curl -sf http://127.0.0.1:8000/_status ----
Ran curl -sf http://127.0.0.1:8000/_status returned 22
[2014-07-17T17:01:10-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
比我做的:
root@dutches:/home/mrrc# curl http://127.0.0.1:8000/_status
{"status":"fail","upstreams":{"chef_solr":"fail","chef_sql":"pong"}}
是不是因为我实际上并不拥有dutches.com域名?即使我的主机文件在本地路由它?我想通过IP访问服务器。
答案 0 :(得分:2)
Chef服务器安装需要有效的域名(出于各种原因)。您无法通过IP地址访问它。