diff options
| author | Michael Klishin <michael@novemberain.com> | 2015-12-09 18:51:29 +0300 |
|---|---|---|
| committer | Michael Klishin <michael@novemberain.com> | 2015-12-09 18:51:29 +0300 |
| commit | 06389b4f4a33cb94464d7d72a23ac848c6809082 (patch) | |
| tree | d6ab095f2b9dd192c1e9926b53d93a5c63601651 /packaging | |
| parent | 1be1da575bfdcd01d8c674b7c359f807f1e3e723 (diff) | |
| parent | 7d3055a5052e073c2a7beda3b38b717715f21f10 (diff) | |
| download | rabbitmq-server-git-06389b4f4a33cb94464d7d72a23ac848c6809082.tar.gz | |
Merge pull request #480 from dmitrymex/stable
Allow users to define poliies and parameters in OCF script for HA
Diffstat (limited to 'packaging')
| -rwxr-xr-x | packaging/common/rabbitmq-server-ha.ocf | 19 |
1 files changed, 14 insertions, 5 deletions
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 <<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> @@ -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) |
