由Chef处理多个节点 [英] Handling multiple node by Chef

查看:51
本文介绍了由Chef处理多个节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我有1个配方文件,5个目标节点。如何将配方文件应用于所有目标节点?
我需要使用任何命令或?我的目的不是要进入每个目标节点来运行Chef-client,我的目标可能只是通过单个命令或使用其他方法来完成此操作。

Example, I have 1 recipe file, 5 target nodes. How do I apply the recipe file to all the target node? Any commands I need to use or ? I'm not aiming to go into each and every target node to run the chef-client, my aim is to maybe by just single command or using other methods to get this done.

如果您知道如何做,也要发表评论并给出一些参考答案。

If you know how, do comment and give some reference answer as well.

谢谢。

推荐答案

您可以通过如下刀ssh命令在多个节点上运行Chef-client:

You can run chef-client on multiple nodes via knife ssh command like:

knife ssh "role:app" "sudo chef-client" -x myuser -p 22

更多信息关于刀ssh,您可以在此处查找

More info about knife ssh you can find here.

有关搜索语法的更多信息,您可以在此处查找

More info about search syntax you can find here.

另一种方法是让cron作业每N分钟运行一次 chef-client ,然后在您将更改上载到Chef服务器时将更新您的节点

Another approach is to have cron job that would run chef-client every N minutes, and then your nodes will be updated when you upload changes to chef server.

这篇关于由Chef处理多个节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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