Browse Source

Add alarms and notification agents coordination

In this patch next features have been implemented:

1. Set a notification workload_partitioning to True, for turning on
notification agents partitioning
2. Change alarm evaluator resource configuration in pacemaker to run
it on each controller node

Change-Id: Id74094d64b6c24aa4c4f4ff5d9a5cd2610425c60
Ilya Tyaptin 3 years ago
parent
commit
5adb4d407b
1 changed files with 61 additions and 2 deletions
  1. 61
    2
      deployment_scripts/puppet/modules/redis/manifests/main.pp

+ 61
- 2
deployment_scripts/puppet/modules/redis/manifests/main.pp View File

@@ -116,6 +116,7 @@ class redis::main (
116 116
     'coordination/backend_url'    : value => redis_backend_url($redis_hosts, $redis_sentinel_port, $timeout);
117 117
     'coordination/heartbeat'      : value => '1.0';
118 118
     'coordination/check_watchers' : value => $timeout;
119
+    'notification/workload_partitioning': value => true
119 120
   }
120 121
 
121 122
   if $primary_controller {
@@ -125,7 +126,14 @@ class redis::main (
125 126
       onlyif  => 'pcs resource show p_ceilometer-agent-central > /dev/null 2>&1',
126 127
     }
127 128
 
129
+    exec {'remove_old_resource_alarm_evaluator':
130
+      path => '/usr/sbin:/usr/bin:/sbin:/bin',
131
+      command => 'pcs resource delete p_ceilometer-alarm-evaluator --wait=120',
132
+      onlyif  => 'pcs resource show p_ceilometer-alarm-evaluator > /dev/null 2>&1',
133
+    }
134
+
128 135
     Exec['remove_old_resource_central_agent'] -> Cluster::Corosync::Cs_service["$::ceilometer::params::agent_central_service_name"]
136
+    Exec['remove_old_resource_alarm_evaluator'] -> Cluster::Corosync::Cs_service["$::ceilometer::params::alarm_evaluator_service_name"]
129 137
   }
130 138
 
131 139
   file {'redis_ocf_script':
@@ -152,6 +160,22 @@ class redis::main (
152 160
     hasrestart          => false,
153 161
   }
154 162
 
163
+  cluster::corosync::cs_service { "$::ceilometer::params::alarm_evaluator_service_name":
164
+    ocf_script          => 'ceilometer-alarm-evaluator',
165
+    csr_parameters      => {},
166
+    csr_metadata        => undef,
167
+    csr_complex_type    => 'clone',
168
+    csr_ms_metadata     => { 'interleave' => true },
169
+    csr_mon_intr        => '20',
170
+    csr_mon_timeout     => '10',
171
+    csr_timeout         => '60',
172
+    service_name        => $::ceilometer::params::alarm_evaluator_service_name,
173
+    package_name        => $::ceilometer::params::alarm_evaluator_package_name,
174
+    service_title       => 'ceilometer-alarm-evaluator',
175
+    primary             => $primary_controller,
176
+    hasrestart          => false,
177
+  }
178
+
155 179
   cluster::corosync::cs_service { 'redis':
156 180
     ocf_script          => 'redis-server',
157 181
     csr_parameters      => {},
@@ -172,7 +196,8 @@ class redis::main (
172 196
   File['redis_ocf_script'] ->
173 197
   Cluster::Corosync::Cs_service['redis'] ->
174 198
   Ceilometer_config <||> ->
175
-  Cluster::Corosync::Cs_service["$::ceilometer::params::agent_central_service_name"]
199
+  Cluster::Corosync::Cs_service["$::ceilometer::params::agent_central_service_name"] ->
200
+  Cluster::Corosync::Cs_service["$::ceilometer::params::alarm_evaluator_service_name"]
176 201
 
177 202
   if !$primary_controller {
178 203
     exec {'waiting-for-agent-up-on-primary':
@@ -182,6 +207,13 @@ class redis::main (
182 207
       path      => '/usr/sbin:/usr/bin:/sbin:/bin',
183 208
     }
184 209
 
210
+    exec {'waiting-for-evaluator-up-on-primary':
211
+      tries     => 10,
212
+      try_sleep => 30,
213
+      command   => "pcs resource | grep -A 1 p_${::ceilometer::params::alarm_evaluator_service_name} | grep Started > /dev/null 2>&1",
214
+      path      => '/usr/sbin:/usr/bin:/sbin:/bin',
215
+    }
216
+
185 217
     exec {'waiting-for-redis-up-on-primary':
186 218
       tries     => 10,
187 219
       try_sleep => 30,
@@ -197,6 +229,14 @@ class redis::main (
197 229
       provider   => 'pacemaker',
198 230
     }
199 231
 
232
+    service {"p_${::ceilometer::params::alarm_evaluator_service_name}":
233
+      enable     => true,
234
+      ensure     => 'running',
235
+      hasstatus  => true,
236
+      hasrestart => true,
237
+      provider   => 'pacemaker',
238
+    }
239
+
200 240
     service {"p_${::redis::params::service}":
201 241
       enable     => true,
202 242
       ensure     => 'running',
@@ -210,7 +250,9 @@ class redis::main (
210 250
     Cluster::Corosync::Cs_service['redis'] ->
211 251
     Exec['waiting-for-agent-up-on-primary'] ->
212 252
     Ceilometer_config <||> ->
213
-    Cluster::Corosync::Cs_service["$::ceilometer::params::agent_central_service_name"]
253
+    Cluster::Corosync::Cs_service["$::ceilometer::params::agent_central_service_name"] ->
254
+    Exec['waiting-for-evaluator-up-on-primary'] ->
255
+    Cluster::Corosync::Cs_service["$::ceilometer::params::alarm_evaluator_service_name"]
214 256
   }
215 257
 
216 258
   service { 'ceilometer-agent-central':
@@ -218,4 +260,21 @@ class redis::main (
218 260
     name    => $::ceilometer::params::agent_central_service_name,
219 261
     enable  => false,
220 262
   }
263
+
264
+  service { 'ceilometer-alarm-evaluator':
265
+    ensure  => 'stopped',
266
+    name    => $::ceilometer::params::alarm_evaluator_service_name,
267
+    enable  => false,
268
+  }
269
+
270
+  service { 'ceilometer-agent-notification':
271
+    ensure     => 'running',
272
+    name       => $::ceilometer::params::agent_notification_service_name,
273
+    enable     => true,
274
+    hasstatus  => true,
275
+    hasrestart => true,
276
+  }
277
+
278
+  Ceilometer_config <||> ~> Service['ceilometer-agent-notification']
279
+
221 280
 }

Loading…
Cancel
Save