Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Chef infra 警告:节点<;nodename>;有一个空的运行列表。但我已将运行列表添加到节点?_Chef Infra_Chef Recipe - Fatal编程技术网

Chef infra 警告:节点<;nodename>;有一个空的运行列表。但我已将运行列表添加到节点?

Chef infra 警告:节点<;nodename>;有一个空的运行列表。但我已将运行列表添加到节点?,chef-infra,chef-recipe,Chef Infra,Chef Recipe,作为Chef的新手,我启动了一个示例cookbook,在一个节点上创建一个文件。 下面是我的default.rb文件中的代码 file 'home/ubuntu/sample.txt' do content 'this is test content' mode '0755' end 我将食谱上传到服务器,请查看下面的屏幕截图: 我还将cookbook添加到特定节点下的运行列表中。当我尝试引导节点时,会收到一条警告,说运行列表为空。我无法找出遗漏了什么。下面是我正在使用的引导命令 s

作为Chef的新手,我启动了一个示例cookbook,在一个节点上创建一个文件。 下面是我的default.rb文件中的代码

file 'home/ubuntu/sample.txt' do
  content 'this is test content'
  mode '0755'
end
我将食谱上传到服务器,请查看下面的屏幕截图:

我还将cookbook添加到特定节点下的运行列表中。当我尝试引导节点时,会收到一条警告,说运行列表为空。我无法找出遗漏了什么。下面是我正在使用的引导命令

sudo knife bootstrap xx.xx.xx.xx --ssh-user ubuntu -i /home/ubuntu/keys/keyname.pem --sudo --use-sudo-password <password> -N testnodelatest

您的
刀引导
命令未指定运行列表(
-r
)。随着厨师长跑步的开始,这将作为第一次跑步的跑步列表


我觉得有点奇怪,你已经在“特定节点”下添加了一个运行列表(我想是在你的Chef服务器中吧?)。如果节点已经在Chef服务器上注册,那么就不要使用
bootstrap
命令。相反,只需在节点上运行
chef client

嗨,Stephen,我也尝试过了,但仍然不起作用,它说runlist是空的。我确实在chef服务器的节点下添加了runlist,然后使用
刀节点运行列表集再次指定运行列表。
或在chef服务器中再次启动
chef client
。或者,最后一次使用
knife bootstrap
,并使用
-r“recipe[hello\u world\u test]”
提供运行列表。当我添加-r“recipe[hello\u world\u test]时,它起作用了非常感谢:)。但我想确认一下,在使用刀子时是否也应该提及它?如果将其添加到chef UI控制台上的节点,这还不够吗?
刀子引导程序使用您指定的运行列表,并且chef客户端运行将覆盖chef服务器中的以前设置。因此,是的,永远不要运行
刀子bootstrap
不指定运行列表。
 Starting the first Chef Client run...
54.40.1.69 Starting Chef Client, version 12.18.31
54.40.1.69 resolving cookbooks for run list: []
54.40.1.69 Synchronizing Cookbooks:
54.40.1.69 Installing Cookbook Gems:
54.40.1.69 Compiling Cookbooks...
54.40.1.69 [2017-02-14T01:36:22-05:00] WARN: Node testnodelatest has an empty run list.
54.40.1.69 Converging 0 resources
54.40.1.69
54.40.1.69 Running handlers:
54.40.1.69 Running handlers complete
54.40.1.69 Chef Client finished, 0/0 resources updated in 01 seconds