From b83ad728ce18373960c3f23cc90dcf344332cce7 Mon Sep 17 00:00:00 2001 From: Eric MacDonald Date: Wed, 2 Jan 2019 10:13:24 -0500 Subject: [PATCH] Make collectd startup dependent on networking Anchor Starting collectd too early in the manifest apply is seen to occasionally fail due to a dependency configuration on hostname resolution in FQDNLookup not being complete. This is fixed by making collectd startup have a hard dependency on platform::networking by-way of a manifest require Anchor. As well, to handle the DOR case when controller manifest is not executed, this update also ensures that collectd and influxdb services are enabled in its manifest base class so these processes are auto started by init. Since influxdb is a controller only service it is removed from non controller load types. This issue is fixed by the following multi-git changes. stx-metal: Filter influxdb out of storage and compute only loads. No real inter git merge dependency stx-integ: Add startup Before=pmond dependency stx-config: This Update. Move collectd config and startup to manifest apply post stage Move influxdb config and startup to manifest apply post stage Test Plan: PASS: Build iso PASS: Verify install storage system and collectd startup PASS: Verify influxdb and extensions excluded in non-controller loads PASS: Verify collectd starts properly on all nodes (CC,DOR,UNLOCK) PASS: Verify influxdb starts properly on controller nodes (CC,DOR,UNLOCK) PASS: Verify collectd pmond process monitoring and recovery PASS: Verify influxdb pmond process monitoring and recovery PASS: Verify collectd statistics storage and fetch to/from influxdb PASS: Verify Install AIO DX and verify collectd and influxdb startup PASS: Verify Storage system DOR PASS: Verify AIO DX DOR Change-Id: Idff6382d835289f5986e98e3b4ee6e9c7a960287 Closes-Bug: 1797909 Signed-off-by: Eric MacDonald --- puppet-manifests/centos/build_srpm.data | 2 +- .../src/modules/platform/manifests/collectd.pp | 12 ++++++++---- .../src/modules/platform/manifests/influxdb.pp | 7 +++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/puppet-manifests/centos/build_srpm.data b/puppet-manifests/centos/build_srpm.data index 5610037e43..8521910bff 100644 --- a/puppet-manifests/centos/build_srpm.data +++ b/puppet-manifests/centos/build_srpm.data @@ -1,2 +1,2 @@ SRC_DIR="src" -TIS_PATCH_VER=74 +TIS_PATCH_VER=75 diff --git a/puppet-manifests/src/modules/platform/manifests/collectd.pp b/puppet-manifests/src/modules/platform/manifests/collectd.pp index f3fef419aa..c8edabb973 100644 --- a/puppet-manifests/src/modules/platform/manifests/collectd.pp +++ b/puppet-manifests/src/modules/platform/manifests/collectd.pp @@ -29,11 +29,16 @@ class platform::collectd content => template('platform/collectd.conf.erb'), } # now start collectd + -> exec { 'collectd-enable': + command => 'systemctl enable collectd', + unless => 'systemctl is-enabled collectd' + } + # ensure that collectd is running -> service { 'collectd': ensure => running, - enable => true, - provider => 'systemd' + provider => 'systemd', + require => Anchor['platform::networking'], } # now get pmond to monitor the process # ensure pmon soft link for process monitoring @@ -54,7 +59,6 @@ class platform::collectd::runtime { class platform::collectd::restart { include ::platform::collectd exec { 'collectd-restart': - command => '/usr/local/sbin/pmon-restart collect' + command => '/usr/local/sbin/pmon-restart collectd' } } - diff --git a/puppet-manifests/src/modules/platform/manifests/influxdb.pp b/puppet-manifests/src/modules/platform/manifests/influxdb.pp index cbdbe9d64a..752ada3c02 100644 --- a/puppet-manifests/src/modules/platform/manifests/influxdb.pp +++ b/puppet-manifests/src/modules/platform/manifests/influxdb.pp @@ -44,6 +44,11 @@ class platform::influxdb content => template('platform/influxdb.conf.erb'), } # now make sure that influxdb is started + -> exec { 'influxdb-enable': + command => 'systemctl enable influxdb', + unless => 'systemctl is-enabled influxdb' + } + # ensure that influxdb is running -> service { 'influxdb': ensure => running, @@ -61,12 +66,10 @@ class platform::influxdb } } - class platform::influxdb::runtime { include ::platform::influxdb } - class platform::influxdb::logrotate::params ( $log_file_name = undef, $log_file_size = undef,