diff --git a/packaging/common/rabbitmq-server-ha.ocf b/packaging/common/rabbitmq-server-ha.ocf index 66c640c9f1..223e27f6f4 100755 --- a/packaging/common/rabbitmq-server-ha.ocf +++ b/packaging/common/rabbitmq-server-ha.ocf @@ -13,6 +13,9 @@ # # See usage() function below for more details ... # +# Note that the script uses set_rabbitmq_policy.sh script located in the +# same directory to setup RabbitMQ policies. +# ####################################################################### # Initialization: @@ -92,6 +95,11 @@ UEND } meta_data() { + # The EXTENDED_OCF_PARAMS parameter below does not exist by default + # and hence converted to an empty string unless overridden. It + # could be used by an extention script to add new parameters. For + # example see https://review.openstack.org/#/c/249180/10 + cat < @@ -268,6 +276,8 @@ If too many timeouts happen in a raw, the monitor call will return with error. +$EXTENDED_OCF_PARAMS + @@ -1721,11 +1731,10 @@ action_promote() { ocf_log info "${LH} action end." exit $OCF_FAILED_MASTER fi - ocf_log info "${LH} Setting HA policy for all queues" - ${OCF_RESKEY_ctl} set_policy ha-all "." '{"ha-mode":"all", "ha-sync-mode":"automatic"}' --apply-to all --priority 0 - ${OCF_RESKEY_ctl} set_policy heat_rpc_expire "^heat-engine-listener\\." '{"expires":3600000,"ha-mode":"all","ha-sync-mode":"automatic"}' --apply-to all --priority 1 - ${OCF_RESKEY_ctl} set_policy results_expire "^results\\." '{"expires":3600000,"ha-mode":"all","ha-sync-mode":"automatic"}' --apply-to all --priority 1 - ${OCF_RESKEY_ctl} set_policy tasks_expire "^tasks\\." '{"expires":3600000,"ha-mode":"all","ha-sync-mode":"automatic"}' --apply-to all --priority 1 + + local set_policy_path="$(dirname $0)/set_rabbitmq_policy.sh" + . $set_policy_path + # create timestamp file ocf_log info "${LH} Updating start timestamp" ocf_run crm_attribute -N $THIS_PCMK_NODE -l reboot --name 'rabbit-start-time' --update $(now) diff --git a/scripts/set_rabbitmq_policy.sh b/scripts/set_rabbitmq_policy.sh new file mode 100755 index 0000000000..a88b0c417a --- /dev/null +++ b/scripts/set_rabbitmq_policy.sh @@ -0,0 +1,5 @@ +# This script is called by rabbitmq-server-ha.ocf during RabbitMQ +# cluster start up. It is a convenient place to set your cluster +# policy here, for example: +# ${OCF_RESKEY_ctl} set_policy ha-all "." '{"ha-mode":"all", "ha-sync-mode":"automatic"}' --apply-to all --priority 0 +