diff options
| author | Michael Klishin <michael@clojurewerkz.org> | 2015-12-09 18:58:34 +0300 |
|---|---|---|
| committer | Michael Klishin <michael@clojurewerkz.org> | 2015-12-09 18:58:34 +0300 |
| commit | 497ad281afc4af593e5bfacf53100e3da6cb1c76 (patch) | |
| tree | b8d74ffdd8df460ae4a089657871b4cc15fd2fb5 | |
| parent | b264ef744d3d26ea4b2bf16fdab0cbb46f00b783 (diff) | |
| parent | 06389b4f4a33cb94464d7d72a23ac848c6809082 (diff) | |
| download | rabbitmq-server-git-497ad281afc4af593e5bfacf53100e3da6cb1c76.tar.gz | |
Merge branch 'stable'
| -rwxr-xr-x | scripts/rabbitmq-server-ha.ocf | 19 | ||||
| -rwxr-xr-x | scripts/set_rabbitmq_policy.sh | 5 |
2 files changed, 19 insertions, 5 deletions
diff --git a/scripts/rabbitmq-server-ha.ocf b/scripts/rabbitmq-server-ha.ocf index 1e4ebd0f1e..376c661a45 100755 --- a/scripts/rabbitmq-server-ha.ocf +++ b/scripts/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 <<END <?xml version="1.0"?> <!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd"> @@ -268,6 +276,8 @@ If too many timeouts happen in a raw, the monitor call will return with error. <content type="string" default="${OCF_RESKEY_max_rabbitmqctl_timeouts_default}" /> </parameter> +$EXTENDED_OCF_PARAMS + </parameters> <actions> @@ -1734,11 +1744,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 + |
