summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Tyaptin <ityaptin@mirantis.com>2016-01-26 16:45:17 +0300
committerIlya Tyaptin <ityaptin@mirantis.com>2016-01-29 10:38:08 +0000
commit5adb4d407b665d0ac4fc660e68b9c9f8022ab803 (patch)
treeaa0b87cc38c5565944a4b58969b8da390ead58c5
parentb67616510246a83c2f58f38c0967371f8b1e8e3f (diff)
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
Notes
Notes (review): Code-Review+2: Ivan Berezovskiy <iberezovskiy@mirantis.com> Code-Review+1: Igor Degtiarov <idegtiarov@mirantis.com> Code-Review+1: Vitaly Gusev <vgusev@mirantis.com> Code-Review+1: Nadya Shakhat <nprivalova@mirantis.com> Workflow+1: Ilya Tyaptin <ityaptin@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Wed, 03 Feb 2016 10:49:11 +0000 Reviewed-on: https://review.openstack.org/272548 Project: openstack/fuel-plugin-ceilometer-redis Branch: refs/heads/master
-rw-r--r--deployment_scripts/puppet/modules/redis/manifests/main.pp63
1 files changed, 61 insertions, 2 deletions
diff --git a/deployment_scripts/puppet/modules/redis/manifests/main.pp b/deployment_scripts/puppet/modules/redis/manifests/main.pp
index baa84ba..1212343 100644
--- a/deployment_scripts/puppet/modules/redis/manifests/main.pp
+++ b/deployment_scripts/puppet/modules/redis/manifests/main.pp
@@ -116,6 +116,7 @@ class redis::main (
116 'coordination/backend_url' : value => redis_backend_url($redis_hosts, $redis_sentinel_port, $timeout); 116 'coordination/backend_url' : value => redis_backend_url($redis_hosts, $redis_sentinel_port, $timeout);
117 'coordination/heartbeat' : value => '1.0'; 117 'coordination/heartbeat' : value => '1.0';
118 'coordination/check_watchers' : value => $timeout; 118 'coordination/check_watchers' : value => $timeout;
119 'notification/workload_partitioning': value => true
119 } 120 }
120 121
121 if $primary_controller { 122 if $primary_controller {
@@ -125,7 +126,14 @@ class redis::main (
125 onlyif => 'pcs resource show p_ceilometer-agent-central > /dev/null 2>&1', 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 Exec['remove_old_resource_central_agent'] -> Cluster::Corosync::Cs_service["$::ceilometer::params::agent_central_service_name"] 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 file {'redis_ocf_script': 139 file {'redis_ocf_script':
@@ -152,6 +160,22 @@ class redis::main (
152 hasrestart => false, 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 cluster::corosync::cs_service { 'redis': 179 cluster::corosync::cs_service { 'redis':
156 ocf_script => 'redis-server', 180 ocf_script => 'redis-server',
157 csr_parameters => {}, 181 csr_parameters => {},
@@ -172,7 +196,8 @@ class redis::main (
172 File['redis_ocf_script'] -> 196 File['redis_ocf_script'] ->
173 Cluster::Corosync::Cs_service['redis'] -> 197 Cluster::Corosync::Cs_service['redis'] ->
174 Ceilometer_config <||> -> 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 if !$primary_controller { 202 if !$primary_controller {
178 exec {'waiting-for-agent-up-on-primary': 203 exec {'waiting-for-agent-up-on-primary':
@@ -182,6 +207,13 @@ class redis::main (
182 path => '/usr/sbin:/usr/bin:/sbin:/bin', 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 exec {'waiting-for-redis-up-on-primary': 217 exec {'waiting-for-redis-up-on-primary':
186 tries => 10, 218 tries => 10,
187 try_sleep => 30, 219 try_sleep => 30,
@@ -197,6 +229,14 @@ class redis::main (
197 provider => 'pacemaker', 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 service {"p_${::redis::params::service}": 240 service {"p_${::redis::params::service}":
201 enable => true, 241 enable => true,
202 ensure => 'running', 242 ensure => 'running',
@@ -210,7 +250,9 @@ class redis::main (
210 Cluster::Corosync::Cs_service['redis'] -> 250 Cluster::Corosync::Cs_service['redis'] ->
211 Exec['waiting-for-agent-up-on-primary'] -> 251 Exec['waiting-for-agent-up-on-primary'] ->
212 Ceilometer_config <||> -> 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 service { 'ceilometer-agent-central': 258 service { 'ceilometer-agent-central':
@@ -218,4 +260,21 @@ class redis::main (
218 name => $::ceilometer::params::agent_central_service_name, 260 name => $::ceilometer::params::agent_central_service_name,
219 enable => false, 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}