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

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.

主站蜘蛛池模板: 沙湾县| 临海市| 永善县| 临夏市| 罗山县| 呼图壁县| 高邮市| 元朗区| 沽源县| 潼南县| 临沧市| 丰镇市| 利津县| 尼玛县| 永胜县| 金沙县| 福贡县| 海原县| 离岛区| 应用必备| 新河县| 长春市| 淄博市| 康保县| 临潭县| 阳东县| 从江县| 蚌埠市| 宁晋县| 沧州市| 青川县| 大田县| 滦南县| 弥勒县| 上饶市| 宣威市| 鄂托克前旗| 湘西| 大埔区| 桓台县| 岗巴县|