厨师客户不是从厨师客户食谱 RHEL 6.7 开始的
chef-client not starting with chef-client cookbook RHEL 6.7
我正在使用 4.3.2 chef-client cookbook,chef-client 12.6,我的 运行 列表是 - role chef-client,我的 chef-client 角色如下:
主厨客户
厨师客户端::配置
主厨客户::delete_validation
Link 到食谱 - https://github.com/chef-cookbooks/chef-client
我的 os 是 rhel 6.7
此外,如果重要的话,我正在使用 Packer 在出现此问题时创建图像。
我登录了虚拟机,也无法启动服务。
在 chef-client 运行 期间,会报错如下
'mazon-ebs: ================================================================================
amazon-ebs: Error executing action `start` on resource 'service[chef-client]'
amazon-ebs: ================================================================================
amazon-ebs:
amazon-ebs: Mixlib::ShellOut::ShellCommandFailed
amazon-ebs: ------------------------------------
amazon-ebs: Expected process to exit with [0], but received '6'
amazon-ebs: ---- Begin output of /sbin/service chef-client start ----
amazon-ebs: STDOUT:
amazon-ebs: STDERR:
amazon-ebs: ---- End output of /sbin/service chef-client start ----
amazon-ebs: Ran /sbin/service chef-client start returned 6
amazon-ebs:
amazon-ebs: Resource Declaration:
amazon-ebs: ---------------------
amazon-ebs: # In /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb
amazon-ebs:
amazon-ebs: 32: service 'chef-client' do
amazon-ebs: 33: supports :status => true, :restart => true
amazon-ebs: 34: action [:enable, :start]
amazon-ebs: 35: end
amazon-ebs:
amazon-ebs: Compiled Resource:
amazon-ebs: ------------------
amazon-ebs: # Declared in /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb:32:in `from_file'
amazon-ebs:
amazon-ebs: service("chef-client") do
amazon-ebs: action [:enable, :start]
amazon-ebs: updated true
amazon-ebs: supports {:status=>true, :restart=>true}
amazon-ebs: retries 0
amazon-ebs: retry_delay 2
amazon-ebs: default_guard_interpreter :default
amazon-ebs: service_name "chef-client"
amazon-ebs: enabled true
amazon-ebs: pattern "chef-client"
amazon-ebs: declared_type :service
amazon-ebs: cookbook_name "chef-client"
amazon-ebs: recipe_name "init_service"
amazon-ebs: end
amazon-ebs:
amazon-ebs: [2016-01-20T16:49:04-05:00] INFO: Running queued delayed notifications before re-raising exception
amazon-ebs: [2016-01-20T16:49:04-05:00] INFO: template[/etc/init.d/chef-client] sending restart action to service[chef-client] (delayed)
amazon-ebs: * service[chef-client] action restart[2016-01-20T16:49:04-05:00] INFO: Processing service[chef-client] action restart (chef-client::init_service line 32)
amazon-ebs:
amazon-ebs:
amazon-ebs: ================================================================================
amazon-ebs: Error executing action `restart` on resource 'service[chef-client]'
amazon-ebs: ================================================================================
amazon-ebs:
amazon-ebs: Mixlib::ShellOut::ShellCommandFailed
amazon-ebs: ------------------------------------
amazon-ebs: Expected process to exit with [0], but received '6'
amazon-ebs: ---- Begin output of /sbin/service chef-client restart ----
amazon-ebs: STDOUT: Stopping chef-client: [FAILED]
amazon-ebs: STDERR:
amazon-ebs: ---- End output of /sbin/service chef-client restart ----
amazon-ebs: Ran /sbin/service chef-client restart returned 6
amazon-ebs:
amazon-ebs: Resource Declaration:
amazon-ebs: ---------------------
amazon-ebs: # In /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb
amazon-ebs:
amazon-ebs: 32: service 'chef-client' do
amazon-ebs: 33: supports :status => true, :restart => true
amazon-ebs: 34: action [:enable, :start]
amazon-ebs: 35: end
amazon-ebs:
amazon-ebs: Compiled Resource:
amazon-ebs: ------------------
amazon-ebs: # Declared in /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb:32:in from_file
amazon-ebs:
amazon-ebs: service("chef-client") do
amazon-ebs: action [:enable, :start]
amazon-ebs: updated true
amazon-ebs: supports {:status=>true, :restart=>true}
amazon-ebs: retries 0
amazon-ebs: retry_delay 2
amazon-ebs: default_guard_interpreter :default
amazon-ebs: service_name "chef-client"
amazon-ebs: enabled true
amazon-ebs: pattern "chef-client"
amazon-ebs: declared_type :service
amazon-ebs: cookbook_name "chef-client"
amazon-ebs: recipe_name "init_service"
amazon-ebs: end
amazon-ebs:
amazon-ebs:
使用 chef-client
食谱时,您应该将其放入 运行 列表中:chef-client::config, chef-client:init_service
.
避免在包含 config
之前将 chef-client
放入 运行 列表中,因为 this will create the service before creating the configuration.
因此,从您的 运行 列表中删除 chef-client::default
(又名 chef-client
)。就这样。如果您愿意,可以使用 chef-client::config, chef-client::default, chef-client::delete_validation
。但请记住,配置先行。
我正在使用 4.3.2 chef-client cookbook,chef-client 12.6,我的 运行 列表是 - role chef-client,我的 chef-client 角色如下: 主厨客户 厨师客户端::配置 主厨客户::delete_validation
Link 到食谱 - https://github.com/chef-cookbooks/chef-client
我的 os 是 rhel 6.7
此外,如果重要的话,我正在使用 Packer 在出现此问题时创建图像。
我登录了虚拟机,也无法启动服务。
在 chef-client 运行 期间,会报错如下
'mazon-ebs: ================================================================================
amazon-ebs: Error executing action `start` on resource 'service[chef-client]'
amazon-ebs: ================================================================================
amazon-ebs:
amazon-ebs: Mixlib::ShellOut::ShellCommandFailed
amazon-ebs: ------------------------------------
amazon-ebs: Expected process to exit with [0], but received '6'
amazon-ebs: ---- Begin output of /sbin/service chef-client start ----
amazon-ebs: STDOUT:
amazon-ebs: STDERR:
amazon-ebs: ---- End output of /sbin/service chef-client start ----
amazon-ebs: Ran /sbin/service chef-client start returned 6
amazon-ebs:
amazon-ebs: Resource Declaration:
amazon-ebs: ---------------------
amazon-ebs: # In /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb
amazon-ebs:
amazon-ebs: 32: service 'chef-client' do
amazon-ebs: 33: supports :status => true, :restart => true
amazon-ebs: 34: action [:enable, :start]
amazon-ebs: 35: end
amazon-ebs:
amazon-ebs: Compiled Resource:
amazon-ebs: ------------------
amazon-ebs: # Declared in /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb:32:in `from_file'
amazon-ebs:
amazon-ebs: service("chef-client") do
amazon-ebs: action [:enable, :start]
amazon-ebs: updated true
amazon-ebs: supports {:status=>true, :restart=>true}
amazon-ebs: retries 0
amazon-ebs: retry_delay 2
amazon-ebs: default_guard_interpreter :default
amazon-ebs: service_name "chef-client"
amazon-ebs: enabled true
amazon-ebs: pattern "chef-client"
amazon-ebs: declared_type :service
amazon-ebs: cookbook_name "chef-client"
amazon-ebs: recipe_name "init_service"
amazon-ebs: end
amazon-ebs:
amazon-ebs: [2016-01-20T16:49:04-05:00] INFO: Running queued delayed notifications before re-raising exception
amazon-ebs: [2016-01-20T16:49:04-05:00] INFO: template[/etc/init.d/chef-client] sending restart action to service[chef-client] (delayed)
amazon-ebs: * service[chef-client] action restart[2016-01-20T16:49:04-05:00] INFO: Processing service[chef-client] action restart (chef-client::init_service line 32)
amazon-ebs:
amazon-ebs:
amazon-ebs: ================================================================================
amazon-ebs: Error executing action `restart` on resource 'service[chef-client]'
amazon-ebs: ================================================================================
amazon-ebs:
amazon-ebs: Mixlib::ShellOut::ShellCommandFailed
amazon-ebs: ------------------------------------
amazon-ebs: Expected process to exit with [0], but received '6'
amazon-ebs: ---- Begin output of /sbin/service chef-client restart ----
amazon-ebs: STDOUT: Stopping chef-client: [FAILED]
amazon-ebs: STDERR:
amazon-ebs: ---- End output of /sbin/service chef-client restart ----
amazon-ebs: Ran /sbin/service chef-client restart returned 6
amazon-ebs:
amazon-ebs: Resource Declaration:
amazon-ebs: ---------------------
amazon-ebs: # In /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb
amazon-ebs:
amazon-ebs: 32: service 'chef-client' do
amazon-ebs: 33: supports :status => true, :restart => true
amazon-ebs: 34: action [:enable, :start]
amazon-ebs: 35: end
amazon-ebs:
amazon-ebs: Compiled Resource:
amazon-ebs: ------------------
amazon-ebs: # Declared in /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb:32:in from_file
amazon-ebs:
amazon-ebs: service("chef-client") do
amazon-ebs: action [:enable, :start]
amazon-ebs: updated true
amazon-ebs: supports {:status=>true, :restart=>true}
amazon-ebs: retries 0
amazon-ebs: retry_delay 2
amazon-ebs: default_guard_interpreter :default
amazon-ebs: service_name "chef-client"
amazon-ebs: enabled true
amazon-ebs: pattern "chef-client"
amazon-ebs: declared_type :service
amazon-ebs: cookbook_name "chef-client"
amazon-ebs: recipe_name "init_service"
amazon-ebs: end
amazon-ebs:
amazon-ebs:
使用 chef-client
食谱时,您应该将其放入 运行 列表中:chef-client::config, chef-client:init_service
.
避免在包含 config
之前将 chef-client
放入 运行 列表中,因为 this will create the service before creating the configuration.
因此,从您的 运行 列表中删除 chef-client::default
(又名 chef-client
)。就这样。如果您愿意,可以使用 chef-client::config, chef-client::default, chef-client::delete_validation
。但请记住,配置先行。