From 4ded514788a296cd338ea9b2c2a5b772e770f840 Mon Sep 17 00:00:00 2001 From: Jan Provaznik Date: Mon, 7 Jul 2014 09:21:27 -0400 Subject: [PATCH] Fix pacemaker cluster configuration * replaces crm with crm_attribute, crm is a separate tool which is not available for redhat distros. crm_attribute should be available in all supported distros. * cluster configuration is done only once on bootstrap host * adds sleep to let pacemaker start up properly Change-Id: Ie14fd68a49d7312d3817c25a305eca7a2aa9c9cf --- elements/pacemaker/element-deps | 1 + .../post-configure.d/15-pacemaker | 6 ++++++ .../post-configure.d/16-base-opts-pacemaker | 14 ++++++++------ 3 files changed, 15 insertions(+), 6 deletions(-) mode change 100644 => 100755 elements/pacemaker/os-refresh-config/post-configure.d/16-base-opts-pacemaker diff --git a/elements/pacemaker/element-deps b/elements/pacemaker/element-deps index 9a3fcd0f7..afeac05a7 100644 --- a/elements/pacemaker/element-deps +++ b/elements/pacemaker/element-deps @@ -1,4 +1,5 @@ corosync os-apply-config +os-is-bootstrap-host os-refresh-config os-svc-install diff --git a/elements/pacemaker/os-refresh-config/post-configure.d/15-pacemaker b/elements/pacemaker/os-refresh-config/post-configure.d/15-pacemaker index 4a9d42e7b..a5f3531e5 100755 --- a/elements/pacemaker/os-refresh-config/post-configure.d/15-pacemaker +++ b/elements/pacemaker/os-refresh-config/post-configure.d/15-pacemaker @@ -4,3 +4,9 @@ set -eux os-svc-enable -n pacemaker os-svc-restart -n pacemaker + +# Give pacemaker some time to boot up, otherwise configuration commands +# time out. The issue is tracked here: +# https://bugzilla.redhat.com/show_bug.cgi?id=1111747 +# This workaround can be removed once the issue above is fixed. +sleep 30 diff --git a/elements/pacemaker/os-refresh-config/post-configure.d/16-base-opts-pacemaker b/elements/pacemaker/os-refresh-config/post-configure.d/16-base-opts-pacemaker old mode 100644 new mode 100755 index fdcf26bb7..b5cc7ce54 --- a/elements/pacemaker/os-refresh-config/post-configure.d/16-base-opts-pacemaker +++ b/elements/pacemaker/os-refresh-config/post-configure.d/16-base-opts-pacemaker @@ -2,10 +2,12 @@ set -eu -QUORUM_POLICY=$(os-apply-config --key pacemaker.quorum_policy --type raw --key-default ignore) -RECHECK_INTERVAL=$(os-apply-config --key pacemaker.recheck_interval --type raw --key-default 5) -STONITH_ENABLED=$(os-apply-config --key pacemaker.stonith_enabled --type raw --key-default false) +if os-is-bootstrap-host; then + QUORUM_POLICY=$(os-apply-config --key pacemaker.quorum_policy --type raw --key-default ignore) + RECHECK_INTERVAL=$(os-apply-config --key pacemaker.recheck_interval --type raw --key-default 5) + STONITH_ENABLED=$(os-apply-config --key pacemaker.stonith_enabled --type raw --key-default false) -crm configure property no-quorum-policy=$QUORUM_POLICY \ - cluster-recheck-interval=$RECHECK_INTERVAL"min" \ - stonith-enabled=$STONITH_ENABLED + crm_attribute -t crm_config -n stonith-enabled -v $STONITH_ENABLED + crm_attribute -t crm_config -n no-quorum-policy -v $QUORUM_POLICY + crm_attribute -t crm_config -n cluster-recheck-interval -v "${RECHECK_INTERVAL}min" +fi