Watchdog class will not be installed in logstash_worker class anymore
Change-Id: I68b48fd26eae73775d2e5200acd29dc1c375047e
This commit is contained in:
parent
71111e603b
commit
3a484528f5
@ -1,23 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# This is a work around for https://logstash.jira.com/browse/LOGSTASH-1951
|
|
||||||
# Logstash disconnects from the cluster and will not rejoin under
|
|
||||||
# its own power.
|
|
||||||
|
|
||||||
date >> /var/log/logstash/watchdog.log
|
|
||||||
ES_ADDRESS=$1
|
|
||||||
echo "$ES_ADDRESS" >> /var/log/logstash/watchdog.log
|
|
||||||
|
|
||||||
JSON_OUT=$(curl -sf "http://${ES_ADDRESS}:9200/_cluster/nodes/${HOSTNAME}")
|
|
||||||
CURL_RET=$?
|
|
||||||
echo "$JSON_OUT" >> /var/log/logstash/watchdog.log
|
|
||||||
echo "$CURL_RET" >> /var/log/logstash/watchdog.log
|
|
||||||
RESULT=$(echo $JSON_OUT | jq '.nodes == {}')
|
|
||||||
echo "$RESULT" >> /var/log/logstash/watchdog.log
|
|
||||||
|
|
||||||
if [ "$CURL_RET" == "0" ] && [ "$RESULT" == "true" ] ;
|
|
||||||
then
|
|
||||||
echo "restarting" >> /var/log/logstash/watchdog.log
|
|
||||||
/sbin/stop --quiet logstash-indexer
|
|
||||||
/sbin/start --quiet logstash-indexer
|
|
||||||
fi
|
|
@ -1,48 +0,0 @@
|
|||||||
# Copyright 2013 Hewlett-Packard Development Company, L.P.
|
|
||||||
#
|
|
||||||
# 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 a simple watchdog for the logstash-indexer service.
|
|
||||||
# es_api_node is the address to access the elasticsearch api at (should
|
|
||||||
# be a 'host:port' string).
|
|
||||||
|
|
||||||
class logstash::watchdog (
|
|
||||||
$cron_ensure = 'present',
|
|
||||||
$es_api_node = 'localhost'
|
|
||||||
) {
|
|
||||||
package { 'jq':
|
|
||||||
ensure => present,
|
|
||||||
}
|
|
||||||
if ! defined(Package['curl']) {
|
|
||||||
package { 'curl':
|
|
||||||
ensure => present,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
file { '/usr/local/bin/logstash-watchdog':
|
|
||||||
ensure => present,
|
|
||||||
source => 'puppet:///modules/logstash/logstash-watchdog.sh',
|
|
||||||
replace => true,
|
|
||||||
owner => 'root',
|
|
||||||
group => 'root',
|
|
||||||
mode => '0555',
|
|
||||||
}
|
|
||||||
|
|
||||||
cron { 'logstash-watchdog':
|
|
||||||
ensure => $cron_ensure,
|
|
||||||
minute => '*/10',
|
|
||||||
environment => 'PATH=/bin:/usr/bin:/usr/local/bin',
|
|
||||||
command => "sleep $((RANDOM\%60)) && /usr/local/bin/logstash-watchdog ${es_api_node}",
|
|
||||||
require => Service['logstash-indexer']
|
|
||||||
}
|
|
||||||
}
|
|
@ -40,11 +40,6 @@ class openstack_project::logstash_worker (
|
|||||||
conf_template => 'openstack_project/logstash/indexer.conf.erb',
|
conf_template => 'openstack_project/logstash/indexer.conf.erb',
|
||||||
}
|
}
|
||||||
|
|
||||||
class { 'logstash::watchdog':
|
|
||||||
cron_ensure => 'absent',
|
|
||||||
es_api_node => $discover_node,
|
|
||||||
}
|
|
||||||
|
|
||||||
include log_processor
|
include log_processor
|
||||||
log_processor::worker { 'A':
|
log_processor::worker { 'A':
|
||||||
config_file => 'puppet:///modules/openstack_project/logstash/jenkins-log-worker.yaml',
|
config_file => 'puppet:///modules/openstack_project/logstash/jenkins-log-worker.yaml',
|
||||||
|
Loading…
Reference in New Issue
Block a user