aboutsummaryrefslogtreecommitdiffstats
path: root/manifests
diff options
context:
space:
mode:
authorMichele Baldessari <michele@acksyn.org>2017-04-26 10:12:50 +0200
committerMichele Baldessari <michele@acksyn.org>2017-04-26 10:24:54 +0200
commitc504d6a8591bcf12e31d97a62222d7611941b136 (patch)
tree22dd94d377ffefe82c67cb0fcf44537f57042a25 /manifests
parentbaecff6c3ca47400ace7fb6ef5a83cd0a206041a (diff)
Add a flag to rabbitmq so that we can deploy with ha-mode: all again
In change Ib62001c03e1e08f58cf0c6e0ba07a8879a584084 we switched the rabbitmq queues HA mode from ha-all to ha-exactly. While this gives us a nice performance boost with rabbitmq, it makes rabbit less resilient to network glitches as we painfully found out via https://bugzilla.redhat.com/show_bug.cgi?id=1441635. Will propose another THT change to actually change the default to -1 so we get this ha-mode:all by default. Change-Id: I9a90e71094b8d8d58b5be0a45a2979701b0ac21c Partial-Bug: #1686337 Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com> Co-Authored-By: John Eckersberg <jeckersb@redhat.com>
Diffstat (limited to 'manifests')
-rw-r--r--manifests/profile/pacemaker/rabbitmq.pp8
1 files changed, 6 insertions, 2 deletions
diff --git a/manifests/profile/pacemaker/rabbitmq.pp b/manifests/profile/pacemaker/rabbitmq.pp
index f4b679a..bf6a38d 100644
--- a/manifests/profile/pacemaker/rabbitmq.pp
+++ b/manifests/profile/pacemaker/rabbitmq.pp
@@ -30,7 +30,7 @@
# (Optional) The number of HA queues in to be configured in rabbitmq
# Defaults to hiera('rabbitmq::nr_ha_queues'), which is usually 0 meaning
# that the queues number will be CEIL(N/2) where N is the number of rabbitmq
-# nodes.
+# nodes. The special value of -1 represents the mode 'ha-mode: all'
#
# [*rabbit_nodes*]
# (Optional) The list of rabbitmq nodes names
@@ -90,12 +90,16 @@ class tripleo::profile::pacemaker::rabbitmq (
if $user_ha_queues == 0 {
$nr_rabbit_nodes = size($rabbit_nodes)
$nr_ha_queues = $nr_rabbit_nodes / 2 + ($nr_rabbit_nodes % 2)
+ $params = "set_policy='ha-all ^(?!amq\\.).* {\"ha-mode\":\"exactly\",\"ha-params\":${nr_ha_queues}}'"
+ } elsif $user_ha_queues == -1 {
+ $params = 'set_policy=\'ha-all ^(?!amq\.).* {"ha-mode":"all"}\''
} else {
$nr_ha_queues = $user_ha_queues
+ $params = "set_policy='ha-all ^(?!amq\\.).* {\"ha-mode\":\"exactly\",\"ha-params\":${nr_ha_queues}}'"
}
pacemaker::resource::ocf { 'rabbitmq':
ocf_agent_name => 'heartbeat:rabbitmq-cluster',
- resource_params => "set_policy='ha-all ^(?!amq\\.).* {\"ha-mode\":\"exactly\",\"ha-params\":${nr_ha_queues}}'",
+ resource_params => $params,
clone_params => 'ordered=true interleave=true',
meta_params => 'notify=true',
op_params => 'start timeout=200s stop timeout=200s',