From 3a484528f50c534a476c10752accde770735fb8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isaias=20Pi=C3=B1a?= Date: Thu, 4 Sep 2014 20:39:51 -0500 Subject: [PATCH] Watchdog class will not be installed in logstash_worker class anymore Change-Id: I68b48fd26eae73775d2e5200acd29dc1c375047e --- modules/logstash/files/logstash-watchdog.sh | 23 --------- modules/logstash/manifests/watchdog.pp | 48 ------------------- .../manifests/logstash_worker.pp | 5 -- 3 files changed, 76 deletions(-) delete mode 100644 modules/logstash/files/logstash-watchdog.sh delete mode 100644 modules/logstash/manifests/watchdog.pp diff --git a/modules/logstash/files/logstash-watchdog.sh b/modules/logstash/files/logstash-watchdog.sh deleted file mode 100644 index fb524b1302..0000000000 --- a/modules/logstash/files/logstash-watchdog.sh +++ /dev/null @@ -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 diff --git a/modules/logstash/manifests/watchdog.pp b/modules/logstash/manifests/watchdog.pp deleted file mode 100644 index 48aa575a95..0000000000 --- a/modules/logstash/manifests/watchdog.pp +++ /dev/null @@ -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'] - } -} diff --git a/modules/openstack_project/manifests/logstash_worker.pp b/modules/openstack_project/manifests/logstash_worker.pp index 6d30b5f274..17fc6933ea 100644 --- a/modules/openstack_project/manifests/logstash_worker.pp +++ b/modules/openstack_project/manifests/logstash_worker.pp @@ -40,11 +40,6 @@ class openstack_project::logstash_worker ( conf_template => 'openstack_project/logstash/indexer.conf.erb', } - class { 'logstash::watchdog': - cron_ensure => 'absent', - es_api_node => $discover_node, - } - include log_processor log_processor::worker { 'A': config_file => 'puppet:///modules/openstack_project/logstash/jenkins-log-worker.yaml',