Make the cluster-check property configurable

This change will make the global cluster-check property configurable
and will pick a lower default (60s) in case a pacemaker remote node
is deployed.

The cluster-recheck-interval is set to default to 15minutes by
pacemaker. This value is too high when a pacemaker remote service
is deployed. With this default value a reboot of a pacemaker remote
node will be reported as offline by pacemaker for up to 15minutes.

With this change we do the following:
1) Do nothing in case pacemaker remote is not deployed
2) When pacemaker remote is deployed and the operator has not
   specified otherwise, we set the recheck interval to 60s.
3) When the operator specifies the recheck interval we set that.

Change-Id: I900952b33317b7998a1f26a65f4d70c1726df19c
Closes-Bug: #1679753
This commit is contained in:
Michele Baldessari 2017-04-04 18:15:06 +02:00
parent 32620c52c8
commit f464e9f703
1 changed files with 25 additions and 0 deletions

View File

@ -55,6 +55,14 @@
# (Optional) Number of seconds to sleep between remote creation tries
# Defaults to hiera('pacemaker_remote_try_sleep', 60)
#
# [*cluster_recheck_interval*]
# (Optional) Set the cluster-wide cluster-recheck-interval property
# If the hiera key does not exist or if it is set to undef, the property
# won't be changed from its default value when there are no pacemaker_remote
# nodes. In presence of pacemaker_remote nodes and an undef value it will
# be set to 60s.
# Defaults to hiera('pacemaker_cluster_recheck_interval', undef)
#
class tripleo::profile::base::pacemaker (
$step = hiera('step'),
$pcs_tries = hiera('pcs_tries', 20),
@ -65,6 +73,7 @@ class tripleo::profile::base::pacemaker (
$remote_monitor_interval = hiera('pacemaker_remote_monitor_interval', 20),
$remote_tries = hiera('pacemaker_remote_tries', 5),
$remote_try_sleep = hiera('pacemaker_remote_try_sleep', 60),
$cluster_recheck_interval = hiera('pacemaker_cluster_recheck_interval', undef),
) {
if count($remote_short_node_names) != count($remote_node_ips) {
@ -136,6 +145,22 @@ class tripleo::profile::base::pacemaker (
if $step >= 2 {
if $pacemaker_master {
include ::pacemaker::resource_defaults
# When we have a non-zero number of pacemaker remote nodes we
# want to set the cluster-recheck-interval property to something
# lower (unless the operator has explicitely set a value)
if count($remote_short_node_names) > 0 and $cluster_recheck_interval == undef {
pacemaker::property{ 'cluster-recheck-interval-property':
property => 'cluster-recheck-interval',
value => '60s',
tries => $pcs_tries,
}
} elsif $cluster_recheck_interval != undef {
pacemaker::property{ 'cluster-recheck-interval-property':
property => 'cluster-recheck-interval',
value => $cluster_recheck_interval,
tries => $pcs_tries,
}
}
}
}