Chef融合失败并显示错误:无法确定节点名称:配置node_name或配置系统的主机名和fqdn [英] Chef convergence fails with ERROR: Unable to determine node name: configure node_name or configure the system's hostname and fqdn

查看:179
本文介绍了Chef融合失败并显示错误:无法确定节点名称:配置node_name或配置系统的主机名和fqdn的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的服务器无法与以下消息融合。我无法弄清楚这个错误的出处。

My server fails to converge with the following messages. I am unable to figure where this error is coming from.

我在下面的client.log消息之后复制并粘贴厨师stacktrace:

I am copying and pasting the chef stacktrace AFTER the client.log messages below:

奇怪的是,此框中甚至不存在client.rb文件所引用的stacktrace。

Weird thing is that the client.rb file stacktrace is refering to does not even exist on this box.

任何帮助将不胜感激!

[root@xyz chef]# tail client.log

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

[2016-04-21T11:47:24-06:00] INFO: *** Chef 11.12.8 ***
[2016-04-21T11:47:24-06:00] INFO: Chef-client pid: 7309
[2016-04-21T11:47:24-06:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2016-04-21T11:47:24-06:00] ERROR: Unable to determine node name: configure node_name or configure the system's hostname and fqdn
[2016-04-21T11:47:24-06:00] ERROR: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
[2016-04-21T11:47:24-06:00] ERROR: Sleeping for 3600 seconds before trying again
[2016-04-21T11:51:10-06:00] INFO: SIGTERM received, exiting gracefully






堆栈跟踪:


STACK TRACE:

cat /var/chef/cache/chef-stacktrace.out
Generated at 2016-04-21 11:47:24 -0600
Chef::Exceptions::CannotDetermineNodeName: Unable to determine node name:    configure node_name or configure the system's hostname and fqdn
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-  11.12.8/lib/chef/client.rb:299:in `node_name'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:313:in `register'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:416:in `do_run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:213:in `block in run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in `fork'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:217:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/client.rb:328:in `block in run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/client.rb:317:in `loop'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/client.rb:317:in `run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:67:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/bin/chef-client:26:in `<top (required)>'
/usr/bin/chef-client:23:in `load'
/usr/bin/chef-client:23:in `<main>'[root@xyz chef]# 


推荐答案

您需要在 / etc / chef /中配置 node_name client.rb 。有时候,Ohai可以自己解决这个问题,但您的情况似乎并非如此。检查主机名主机名-f / etc / hostname 文件以查看服务器的配置。

You need to configure a node_name in your /etc/chef/client.rb. Sometimes Ohai can figure this out on its own, but it doesn't seem like it in your case. check hostname, hostname -f, and the /etc/hostname file to see what your servers are configured for.

我个人总是在厨师中定义 node_name ,然后然后使用节点名来设置主机名和fqdn ...并非像Chef博士所建议的那样,取决于您的设置。

I personally always define my node_name in chef, and then use the node name to set the hostname and fqdn... not the other way around as the Chef doc's recommend, depends on your setup.

例如,我的 client.rb 看起来像:

chef_server_url "..."
client_fork true
log_location "/var/log/chef/client.log"
validation_client_name "...-validator"
verify_api_cert true # you might not want this one unless you have a valid cert
node_name "my_node_name" # Add this line
...

从厨师 client.rb 文档


node_name
节点的名称。确定应应用哪种配置并设置client_name,这是在对Chef服务器进行身份验证时使用的名称。默认值是Ohai检测到的Chef客户端的FQDN。通常,Chef建议您将此设置保留为空白,并让Ohai在每次运行Chef-client期间将节点的FQDN分配为node_name。

node_name The name of the node. Determines which configuration should be applied and sets the client_name, which is the name used when authenticating to a Chef server. The default value is the FQDN of the chef-client, as detected by Ohai. In general, Chef recommends that you leave this setting blank and let Ohai assign the FQDN of the node as the node_name during each chef-client run.

这篇关于Chef融合失败并显示错误:无法确定节点名称:配置node_name或配置系统的主机名和fqdn的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆