我正在使用knife-ec2来启动实例并引导节点。该实例启动得很好,它可以通过SSH进入,但是一旦它运行了chef-client init_service配方,它就会在这条线上消失
service 'chef-client' do
我正在运行的命令
knife ec2 server create -I ami-c2a818aa -f t2.micro --subnet {{subnet}} --server-connect-attribute public_ip_address -i {{key.pem}} -r "role[webserver]"
这是我的输出,关于无法找到家庭环境,但我的家存在。
0.0.0.0 Recipe: chef-client::init_service
0.0.0.0 * template[/etc/init.d/chef-client] action create (up to date)
0.0.0.0 * template[/etc/sysconfig/chef-client] action create (up to date)
0.0.0.0 * service[chef-client] action enable
0.0.0.0 - enable service service[chef-client]
0.0.0.0 * service[chef-client] action start
0.0.0.0
0.0.0.0 ================================================================================
0.0.0.0 Error executing action `start` on resource 'service[chef-client]'
0.0.0.0 ================================================================================
0.0.0.0
0.0.0.0 Mixlib::ShellOut::ShellCommandFailed
0.0.0.0 ------------------------------------
0.0.0.0 Expected process to exit with [0], but received '1'
0.0.0.0 ---- Begin output of /sbin/service chef-client start ----
0.0.0.0 STDOUT: Starting chef-client: [FAILED]
0.0.0.0 STDERR: /opt/chef/embedded/apps/chef/lib/chef/util/path_helper.rb:199:in `home': couldn't find HOME environment -- expanding `~' (ArgumentError)
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef/util/path_helper.rb:199:in `all_homes'
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef/util/path_helper.rb:161:in `home'
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef/provider/service/macosx.rb:36:in `gather_plist_dirs'
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef/provider/service/macosx.rb:40:in `<class:Macosx>'
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef/provider/service/macosx.rb:27:in `<class:Service>'
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef/provider/service/macosx.rb:26:in `<class:Provider>'
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef/provider/service/macosx.rb:25:in `<class:Chef>'
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef/provider/service/macosx.rb:24:in `<top (required)>'
0.0.0.0 from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
0.0.0.0 from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef/providers.rb:93:in `<top (required)>'
0.0.0.0 from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
0.0.0.0 from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef.rb:25:in `<top (required)>'
0.0.0.0 from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
0.0.0.0 from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
0.0.0.0 from /opt/chef/embedded/apps/chef/bin/chef-client:23:in `<top (required)>'
0.0.0.0 from /usr/bin/chef-client:51:in `load'
0.0.0.0 from /usr/bin/chef-client:51:in `<main>'
0.0.0.0 ---- End output of /sbin/service chef-client start ----
0.0.0.0 Ran /sbin/service chef-client start returned 1
0.0.0.0
0.0.0.0 Resource Declaration:
0.0.0.0 ---------------------
0.0.0.0 # In /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb
0.0.0.0
0.0.0.0 32: service 'chef-client' do
0.0.0.0 33: supports :status => true, :restart => true
0.0.0.0 34: action [:enable, :start]
0.0.0.0 35: end
0.0.0.0
0.0.0.0 Compiled Resource:
0.0.0.0 ------------------
0.0.0.0 # Declared in /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb:32:in `from_file'
0.0.0.0
0.0.0.0 service("chef-client") do
0.0.0.0 action [:enable, :start]
0.0.0.0 updated true
0.0.0.0 supports {:status=>true, :restart=>true}
0.0.0.0 retries 0
0.0.0.0 retry_delay 2
0.0.0.0 default_guard_interpreter :default
0.0.0.0 service_name "chef-client"
0.0.0.0 enabled true
0.0.0.0 pattern "chef-client"
0.0.0.0 declared_type :service
0.0.0.0 cookbook_name "chef-client"
0.0.0.0 recipe_name "init_service"
0.0.0.0 end
0.0.0.0
0.0.0.0 * service[chef-client] action restart
0.0.0.0
0.0.0.0 ================================================================================
0.0.0.0 Error executing action `restart` on resource 'service[chef-client]'
0.0.0.0 ================================================================================
0.0.0.0
0.0.0.0 Mixlib::ShellOut::ShellCommandFailed
0.0.0.0 ------------------------------------
0.0.0.0 Expected process to exit with [0], but received '1'
0.0.0.0 ---- Begin output of /sbin/service chef-client restart ----
0.0.0.0 STDOUT: Stopping chef-client: [FAILED]
0.0.0.0 Starting chef-client: [FAILED]
0.0.0.0 STDERR: /opt/chef/embedded/apps/chef/lib/chef/util/path_helper.rb:199:in `home': couldn't find HOME environment -- expanding `~' (ArgumentError)
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef/util/path_helper.rb:199:in `all_homes'
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef/util/path_helper.rb:161:in `home'
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef/provider/service/macosx.rb:36:in `gather_plist_dirs'
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef/provider/service/macosx.rb:40:in `<class:Macosx>'
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef/provider/service/macosx.rb:27:in `<class:Service>'
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef/provider/service/macosx.rb:26:in `<class:Provider>'
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef/provider/service/macosx.rb:25:in `<class:Chef>'
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef/provider/service/macosx.rb:24:in `<top (required)>'
0.0.0.0 from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
0.0.0.0 from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef/providers.rb:93:in `<top (required)>'
0.0.0.0 from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
0.0.0.0 from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
0.0.0.0 from /opt/chef/embedded/apps/chef/lib/chef.rb:25:in `<top (required)>'
0.0.0.0 from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
0.0.0.0 from /opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
0.0.0.0 from /opt/chef/embedded/apps/chef/bin/chef-client:23:in `<top (required)>'
0.0.0.0 from /usr/bin/chef-client:51:in `load'
0.0.0.0 from /usr/bin/chef-client:51:in `<main>'
0.0.0.0 ---- End output of /sbin/service chef-client restart ----
0.0.0.0 Ran /sbin/service chef-client restart returned 1
0.0.0.0
0.0.0.0 Resource Declaration:
0.0.0.0 ---------------------
0.0.0.0 # In /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb
0.0.0.0
0.0.0.0 32: service 'chef-client' do
0.0.0.0 33: supports :status => true, :restart => true
0.0.0.0 34: action [:enable, :start]
0.0.0.0 35: end
0.0.0.0
0.0.0.0 Compiled Resource:
0.0.0.0 ------------------
0.0.0.0 # Declared in /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb:32:in `from_file'
0.0.0.0
0.0.0.0 service("chef-client") do
0.0.0.0 action [:enable, :start]
0.0.0.0 updated true
0.0.0.0 supports {:status=>true, :restart=>true}
0.0.0.0 retries 0
0.0.0.0 retry_delay 2
0.0.0.0 default_guard_interpreter :default
0.0.0.0 service_name "chef-client"
0.0.0.0 enabled true
0.0.0.0 pattern "chef-client"
0.0.0.0 declared_type :service
0.0.0.0 cookbook_name "chef-client"
0.0.0.0 recipe_name "init_service"
0.0.0.0 end
0.0.0.0