Clark Boylan e24b23bc51 Run fewer es queries with elastic_recheck.
Currently elastic-recheck is hammering the ElasticSearch cluster every
15 minutes, basically bringing everything else to a halt while these
queries are processed. Spread elastic-recheck periodic queries out, run
each once an hour and 20 minutes after the previous set of queries.

Also, remove the auto triggering when files change, instead we wait for
the hour to roll over and give us new data.

Change-Id: Ibf5dad1071f65f8d676e8b9a0ec4331bada9943f
2014-02-10 16:25:24 -08:00

54 lines
1.9 KiB
Puppet

# Copyright 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2014 Samsung Electronics
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# Class to install and configure an instance of the elastic-recheck
# service.
#
class elastic_recheck::cron () {
$er_state_path = $::elastic_recheck::recheck_state_dir
$graph_all_cmd = $::elastic_recheck::graph_all_cmd
$graph_gate_cmd = $::elastic_recheck::graph_gate_cmd
$uncat_cmd = $::elastic_recheck::uncat_cmd
cron { 'elastic-recheck-all':
user => 'recheck',
minute => '0',
hour => '*',
command => "cd ${er_state_path} && er_safe_run.sh ${graph_all_cmd}",
environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin',
require => Class['elastic_recheck']
}
cron { 'elastic-recheck-gate':
user => 'recheck',
minute => '20',
hour => '*',
command => "cd ${er_state_path} && er_safe_run.sh ${graph_gate_cmd}",
environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin',
require => Class['elastic_recheck']
}
cron { 'elastic-recheck-uncat':
user => 'recheck',
minute => '40',
hour => '*',
command => "cd ${er_state_path} && er_safe_run.sh ${uncat_cmd}",
environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin',
require => Class['elastic_recheck']
}
}