Start ceilometer resource agents

* Ceilometer agent central and ceilometer alarm evaluator
   now start as resource agents of pacemaker;
 * Disable upstart for this two services.

Change-Id: Ic15a3bfb6238e4281b06aae0a3f9fe4abf96590d
Closes-bug: #1418984
Closes-bug: #1422403
This commit is contained in:
dtrishkin 2015-02-10 10:12:35 +03:00 committed by Daniil Trishkin
parent 4810409326
commit 8daf024982
5 changed files with 57 additions and 74 deletions

View File

@ -0,0 +1,20 @@
class ceilometer_ha::agent::central inherits ceilometer::agent::central {
pacemaker_wrappers::service { $::ceilometer::params::agent_central_service_name :
primitive_type => 'ceilometer-agent-central',
metadata => { 'resource-stickiness' => '1' },
parameters => { 'user' => 'ceilometer' },
operations => {
'monitor' => {
'interval' => '20',
'timeout' => '30',
},
'start' => {
'timeout' => '360',
},
'stop' => {
'timeout' => '360',
},
},
ocf_script_file => 'cluster/ocf/ceilometer-agent-central',
}
}

View File

@ -0,0 +1,20 @@
class ceilometer_ha::alarm::evaluator inherits ceilometer::alarm::evaluator {
pacemaker_wrappers::service { $::ceilometer::params::alarm_evaluator_service_name :
primitive_type => 'ceilometer-alarm-evaluator',
metadata => { 'resource-stickiness' => '1' },
parameters => { 'user' => 'ceilometer' },
operations => {
'monitor' => {
'interval' => '20',
'timeout' => '30',
},
'start' => {
'timeout' => '360',
},
'stop' => {
'timeout' => '360',
},
},
ocf_script_file => 'cluster/ocf/ceilometer-alarm-evaluator',
}
}

View File

@ -114,88 +114,31 @@ class openstack::ceilometer (
}
if $ha_mode {
$ceilometer_agent_res_name = "p_${::ceilometer::params::agent_central_service_name}"
include ceilometer_ha::agent::central
Package['ceilometer-common'] -> File['ceilometer-agent-central-ocf']
Package['ceilometer-agent-central'] -> File['ceilometer-agent-central-ocf']
file {'ceilometer-agent-central-ocf':
path => '/usr/lib/ocf/resource.d/fuel/ceilometer-agent-central',
mode => '0755',
owner => root,
group => root,
source => 'puppet:///modules/ceilometer/ocf/ceilometer-agent-central',
}
if $primary_controller {
cs_resource { $ceilometer_agent_res_name:
ensure => present,
primitive_class => 'ocf',
provided_by => 'fuel',
primitive_type => 'ceilometer-agent-central',
metadata => { 'target-role' => 'stopped', 'resource-stickiness' => '1' },
parameters => { 'user' => 'ceilometer' },
operations => {
'monitor' => {
'interval' => '20',
'timeout' => '30'
},
'start' => {
'timeout' => '360'
},
'stop' => {
'timeout' => '360'
},
},
}
File['ceilometer-agent-central-ocf'] -> Cs_resource[$ceilometer_agent_res_name] -> Service['ceilometer-agent-central']
} else {
File['ceilometer-agent-central-ocf'] -> Service['ceilometer-agent-central']
}
} else {
Package['ceilometer-common'] -> Service['ceilometer-agent-central']
Package['ceilometer-agent-central'] -> Service['ceilometer-agent-central']
Package[$::ceilometer::params::common_package_name] -> Class['ceilometer_ha::agent::central']
Package[$::ceilometer::params::agent_central_package_name] -> Class['ceilometer_ha::agent::central']
}
else {
Package[$::ceilometer::params::common_package_name] -> Service[$agent_central_service_name]
Package[$::ceilometer::params::agent_central_package_name] -> Service[$agent_central_service_name]
}
}
if $ha_mode {
include ceilometer_ha::alarm::evaluator
$ceilometer_alarm_res_name = "p_${::ceilometer::params::alarm_evaluator_service_name}"
Package['ceilometer-common'] -> File['ceilometer-alarm-evaluator-ocf']
Package[$::ceilometer::params::alarm_package_name] -> File['ceilometer-alarm-evaluator-ocf']
file {'ceilometer-alarm-evaluator-ocf':
path => '/usr/lib/ocf/resource.d/fuel/ceilometer-alarm-evaluator',
mode => '0755',
owner => root,
group => root,
source => 'puppet:///modules/ceilometer/ocf/ceilometer-alarm-evaluator',
}
if $primary_controller {
cs_resource { $ceilometer_alarm_res_name:
ensure => present,
primitive_class => 'ocf',
provided_by => 'fuel',
primitive_type => 'ceilometer-alarm-evaluator',
metadata => { 'target-role' => 'stopped' },
parameters => { 'user' => 'ceilometer' },
operations => {
'monitor' => {
'interval' => '20',
'timeout' => '30'
},
'start' => {
'timeout' => '360'
},
'stop' => {
'timeout' => '360'
},
},
case $::osfamily {
'RedHat': {
$alarm_package = $::ceilometer::params::alarm_package_name[0]
}
'Debian': {
$alarm_package = $::ceilometer::params::alarm_package_name[1]
}
File['ceilometer-alarm-evaluator-ocf'] -> Cs_resource[$ceilometer_alarm_res_name] -> Service['ceilometer-alarm-evaluator']
}
File['ceilometer-alarm-evaluator-ocf'] -> Service['ceilometer-alarm-evaluator']
Package[$::ceilometer::params::common_package_name] -> Class['ceilometer_ha::alarm::evaluator']
Package[$alarm_package] -> Class['ceilometer_ha::alarm::evaluator']
}
if ($swift_rados_backend) {