安装Chef Server时出错

时间:2015-01-12 13:11:19

标签: chef

我正在尝试在我的Linux机器上安装开源厨师服务器。使用此命令下载并配置服务器后。 sudo chef-server-ctl reconfigure。 它没有正确配置并出现此错误。

execute[/opt/chef-server/embedded/bin/chpst -u chef_server -U chef_server /opt/chef-server/embedded/bin/rabbitmqctl wait /var/opt/chef-server/rabbitmq/db/rabbit@localhost.pid] action run
================================================================================
Error executing action `run` on resource 'execute[/opt/chef-server/embedded/bin/chpst -u chef_server -U chef_server /opt/chef-server/embedded/bin/rabbitmqctl wait /var/opt/chef-server/rabbitmq/db/rabbit@localhost.pid]'
================================================================================


Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '2'
---- Begin output of /opt/chef-server/embedded/bin/chpst -u chef_server -U chef_server /opt/chef-server/embedded/bin/rabbitmqctl wait /var/opt/chef-server/rabbitmq/db/rabbit@localhost.pid ----
STDOUT: Waiting for rabbit@localhost ...
pid is 10404 ...
STDERR: Error: process_not_running
---- End output of /opt/chef-server/embedded/bin/chpst -u chef_server -U chef_server /opt/chef-server/embedded/bin/rabbitmqctl wait /var/opt/chef-server/rabbitmq/db/rabbit@localhost.pid ----
Ran /opt/chef-server/embedded/bin/chpst -u chef_server -U chef_server /opt/chef-server/embedded/bin/rabbitmqctl wait /var/opt/chef-server/rabbitmq/db/rabbit@localhost.pid returned 2


Resource Declaration:
---------------------
# In /opt/chef-server/embedded/cookbooks/chef-server/recipes/rabbitmq.rb

 80:   execute "/opt/chef-server/embedded/bin/chpst -u #{node["chef_server"]["user"]["username"]} -U #{node["chef_server"]["user"]["username"]} /opt/chef-server/embedded/bin/rabbitmqctl wait #{rabbitmq_data_dir}/rabbit@localhost.pid" do
 81:     retries 10
 82:   end
 83: 



Compiled Resource:
------------------
# Declared in /opt/chef-server/embedded/cookbooks/chef-server/recipes/rabbitmq.rb:80:in `from_file'

execute("/opt/chef-server/embedded/bin/chpst -u chef_server -U chef_server /opt/chef-server/embedded/bin/rabbitmqctl wait /var/opt/chef-server/rabbitmq/db/rabbit@localhost.pid") do
  action "run"
  retries 0
  retry_delay 2
  guard_interpreter :default
  command "/opt/chef-server/embedded/bin/chpst -u chef_server -U chef_server /opt/chef-server/embedded/bin/rabbitmqctl wait /var/opt/chef-server/rabbitmq/db/rabbit@localhost.pid"
  backup 5
  returns 0
  cookbook_name :"chef-server"
  recipe_name "rabbitmq"
end




    Running handlers:
    [2015-01-12T18:32:00+05:30] ERROR: Running exception handlers
    Running handlers complete

    [2015-01-12T18:32:00+05:30] ERROR: Exception handlers complete
    [2015-01-12T18:32:00+05:30] FATAL: Stacktrace dumped to /opt/chef-server/embedded/cookbooks/cache/chef-stacktrace.out
    Chef Client failed. 19 resources updated in 53.22000489 seconds
    [2015-01-12T18:32:00+05:30] ERROR: execute[/opt/chef-server/embedded/bin/chpst -u chef_server -U chef_server /opt/chef-server/embedded/bin/rabbitmqctl wait /var/opt/chef-server/rabbitmq/db/rabbit@localhost.pid] (chef-server::rabbitmq line 80) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'
    ---- Begin output of /opt/chef-server/embedded/bin/chpst -u chef_server -U chef_server /opt/chef-server/embedded/bin/rabbitmqctl wait /var/opt/chef-server/rabbitmq/db/rabbit@localhost.pid ----
    STDOUT: Waiting for rabbit@localhost ...
    pid is 10404 ...
    STDERR: Error: process_not_running
    ---- End output of /opt/chef-server/embedded/bin/chpst -u chef_server -U chef_server /opt/chef-server/embedded/bin/rabbitmqctl wait /var/opt/chef-server/rabbitmq/db/rabbit@localhost.pid ----
    Ran /opt/chef-server/embedded/bin/chpst -u chef_server -U chef_server /opt/chef-server/embedded/bin/rabbitmqctl wait /var/opt/chef-server/rabbitmq/db/rabbit@localhost.pid returned 2
    [2015-01-12T18:32:00+05:30] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

3 个答案:

答案 0 :(得分:3)

此错误是由于未遵循Chef Server先决条件之一(“Apache Qid”部分)引起的:http://docs.chef.io/server/install_server_pre.html

解决方案:

service qpidd stop

chkconfig --del qpidd

答案 1 :(得分:1)

这通常意味着您的服务器没有有效且可解析的FQDN。这往往会让RabbitMQ感到不快。

答案 2 :(得分:-1)

我为这个问题做了很多尝试。我做了很多谷歌搜索。最后我得到了一个解决方案。

RabbitMQ服务在5672端口上运行。但是这个端口被其他一些服务使用。所以我运行检查是否使用以下命令在5672端口上运行任何服务:

netstat -nltp | grep 5672

我使用以下命令终止了具有端口5672的服务:

sudo kill `sudo lsof -t -i:5672`

然后我再次运行sudo chef-server-ctl reconfigure,它按预期工作。