Puppet Class: mha::node::purge_relay_logs

Defined in:
manifests/node/purge_relay_logs.pp

Overview

  • ‘hour`

The hour at which to run the cron job. Default to ‘2-23/6’.

Parameters:

  • ensure (String) (defaults to: $mha::node::cron_ensure)
  • user (String) (defaults to: $mha::node::cron_user)
  • minute (String) (defaults to: $mha::node::cron_minute)
  • hour (String) (defaults to: $mha::node::cron_hour)


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'manifests/node/purge_relay_logs.pp', line 19

class mha::node::purge_relay_logs (
  String $ensure = $mha::node::cron_ensure,
  String $user   = $mha::node::cron_user,
  String $minute = $mha::node::cron_minute,
  String $hour   = $mha::node::cron_hour,
) {

  $cmd = "/usr/bin/purge_relay_logs --host localhost --user=${mha::node::user} --password=${mha::node::password} --disable_relay_log_purge"

  # ref: https://code.google.com/p/mysql-master-ha/wiki/Requirements#Schedule_to_run_purge_relay_logs_script
  cron { 'purge relay logs for MHA':
    ensure  => $ensure,
    command => "sleep \$((\$RANDOM\\%60)) && ${cmd} >> /var/log/masterha/purge_relay_logs.log 2>&1",
    user    => $user,
    minute  => $minute,
    hour    => $hour,
  }

}