官术网_书友最值得收藏!

Running the agent from cron

There is an alternative way to operate the agent. We covered starting one long-running puppet agent process that does its work in set intervals and then goes back to sleep. However, it is also possible to have cron launch a discrete agent process in the same interval. This agent will contact the master once, run the received catalog, and then terminate. This has several advantages, as follows:

  • The agent operating system saves resources
  • The interval is precise and not subject to skew (when running the background agent, deviations result from the time that elapses during the catalog run), and distributed interval skew can lead to thundering herd effects
  • Any agent crash or an inadvertent termination is not fatal

Setting Puppet to run the agent from cron is also very easy to do with Puppet! You can use a manifest like the following:

service { 'puppet': enable => false, }
cron { 'puppet-agent-run':
user => 'root',
command => 'puppet agent --no-daemonize --onetime --logdest=syslog',
minute => fqdn_rand(60),
hour => absent,
}

The fqdn_rand function computes a distinct minute for each of your agents. Setting the hour property to absent means that the job should run every hour.

主站蜘蛛池模板: 丰顺县| 荆州市| 武义县| 孟连| 桐庐县| 连城县| 墨竹工卡县| 绥滨县| 铅山县| 西峡县| 扎鲁特旗| 徐水县| 平江县| 昆明市| 荣昌县| 五大连池市| 五台县| 北辰区| 仙桃市| 嘉义市| 玉山县| 尖扎县| 平湖市| 云浮市| 金门县| 贵南县| 固安县| 洪洞县| 纳雍县| 吴桥县| 大余县| 化德县| 南木林县| 原平市| 达尔| 萨嘎县| 铅山县| 郧西县| 荆州市| 元阳县| 锡林郭勒盟|