summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMichael Klishin <michael@clojurewerkz.org>2016-01-19 16:50:50 +0300
committerMichael Klishin <michael@clojurewerkz.org>2016-01-19 16:50:50 +0300
commit0e5362d0cbf31eaf520c8f62fd23d3ab0fd40e5d (patch)
tree1807d37b3cdeecf32b0802d5ce4296421f7d9427 /scripts
parentb693e911b81477a49111c2e8baf1073362998a31 (diff)
parent6f6825a07440f7272f37bbd47dd445de631c9787 (diff)
downloadrabbitmq-server-git-0e5362d0cbf31eaf520c8f62fd23d3ab0fd40e5d.tar.gz
Merge branch 'stable'
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/rabbitmq-server-ha.ocf21
1 files changed, 17 insertions, 4 deletions
diff --git a/scripts/rabbitmq-server-ha.ocf b/scripts/rabbitmq-server-ha.ocf
index ae5f1978ad..84dae25cf1 100755
--- a/scripts/rabbitmq-server-ha.ocf
+++ b/scripts/rabbitmq-server-ha.ocf
@@ -44,6 +44,7 @@ OCF_RESKEY_node_port_default=5672
OCF_RESKEY_erlang_cookie_default=false
OCF_RESKEY_erlang_cookie_file_default="/var/lib/rabbitmq/.erlang.cookie"
OCF_RESKEY_use_fqdn_default=false
+OCF_RESKEY_fqdn_prefix_default=""
OCF_RESKEY_max_rabbitmqctl_timeouts_default=1
: ${HA_LOGTAG="lrmd"}
@@ -63,6 +64,7 @@ OCF_RESKEY_max_rabbitmqctl_timeouts_default=1
: ${OCF_RESKEY_erlang_cookie=${OCF_RESKEY_erlang_cookie_default}}
: ${OCF_RESKEY_erlang_cookie_file=${OCF_RESKEY_erlang_cookie_file_default}}
: ${OCF_RESKEY_use_fqdn=${OCF_RESKEY_use_fqdn_default}}
+: ${OCF_RESKEY_fqdn_prefix=${OCF_RESKEY_fqdn_prefix_default}}
: ${OCF_RESKEY_max_rabbitmqctl_timeouts=${OCF_RESKEY_max_rabbitmqctl_timeouts_default}}
#######################################################################
@@ -266,6 +268,16 @@ Either to use FQDN or a shortname for the rabbitmq node
<content type="boolean" default="${OCF_RESKEY_use_fqdn_default}" />
</parameter>
+<parameter name="fqdn_prefix" unique="0" required="0">
+<longdesc lang="en">
+Optional FQDN prefix for RabbitMQ nodes in cluster.
+FQDN prefix can be specified to host multiple RabbitMQ instances on a node or
+in case of RabbitMQ running in dedicated network/interface.
+</longdesc>
+<shortdesc lang="en">FQDN prefix</shortdesc>
+<content type="string" default="${OCF_RESKEY_fqdn_prefix_default}" />
+</parameter>
+
<parameter name="max_rabbitmqctl_timeouts" unique="0" required="0">
<longdesc lang="en">
If during monitor call rabbitmqctl times out, the timeout is ignored
@@ -512,12 +524,13 @@ get_hostname() {
fi
}
-# Strip the FQDN to the shortname, if OCF_RESKEY_use_fqdn was set
+# Strip the FQDN to the shortname, if OCF_RESKEY_use_fqdn was set;
+# Prepend prefix to the hostname
process_fqdn() {
if [ "${OCF_RESKEY_use_fqdn}" = 'false' ] ; then
- echo "$1" | awk -F. '{print $1}'
+ echo "${OCF_RESKEY_fqdn_prefix}$1" | awk -F. '{print $1}'
else
- echo "$1"
+ echo "${OCF_RESKEY_fqdn_prefix}$1"
fi
}
@@ -530,7 +543,7 @@ my_host() {
local rc=10
local LH="${LL} my_host():"
- hostname=$(get_hostname)
+ hostname=$(process_fqdn $(get_hostname))
ocf_log info "${LH} hostlist is: $hostlist"
for host in $hostlist ; do
hn=$(process_fqdn "${host}")