From e8fb5a968dbbd00d9be2274114ccb41e896ac63d Mon Sep 17 00:00:00 2001 From: "chad.smith@canonical.com" <> Date: Fri, 5 Apr 2013 17:34:01 -0400 Subject: [PATCH] - removed health checks - add-to and remove-from cluster a bit more robust for demo --- revision | 2 +- scripts/add_to_cluster | 11 +++++++++++ scripts/health_checks.d/service_ports_live | 13 ------------- scripts/health_checks.d/service_swift_running | 15 --------------- scripts/remove_from_cluster | 2 ++ 5 files changed, 14 insertions(+), 29 deletions(-) delete mode 100755 scripts/health_checks.d/service_ports_live delete mode 100755 scripts/health_checks.d/service_swift_running diff --git a/revision b/revision index 9f54fe3..190a180 100644 --- a/revision +++ b/revision @@ -1 +1 @@ -122 +123 diff --git a/scripts/add_to_cluster b/scripts/add_to_cluster index e50ab01..7bb5046 100755 --- a/scripts/add_to_cluster +++ b/scripts/add_to_cluster @@ -1,2 +1,13 @@ #!/bin/bash +service corosync start || /bin/true +sleep 2 +while ! service pacemaker start; do + echo "Attempting to start pacemaker" + sleep 1; +done; crm node online +sleep 2 +while crm status | egrep -q 'Stopped$'; do + echo "Waiting for nodes to come online" + sleep 1 +done diff --git a/scripts/health_checks.d/service_ports_live b/scripts/health_checks.d/service_ports_live deleted file mode 100755 index 5ad0be0..0000000 --- a/scripts/health_checks.d/service_ports_live +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# Validate that service ports are active -HEALTH_DIR=`dirname $0` -SCRIPTS_DIR=`dirname $HEALTH_DIR` -. $SCRIPTS_DIR/scriptrc -set -e - -# Grab any OPENSTACK_PORT* environment variables -openstack_ports=`env| awk -F '=' '(/OPENSTACK_PORT/){print $2}'` -for port in $openstack_ports -do - netstat -ln | grep -q ":$port " -done diff --git a/scripts/health_checks.d/service_swift_running b/scripts/health_checks.d/service_swift_running deleted file mode 100755 index 781a40b..0000000 --- a/scripts/health_checks.d/service_swift_running +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# Validate that service is running -HEALTH_DIR=`dirname $0` -SCRIPTS_DIR=`dirname $HEALTH_DIR` -. $SCRIPTS_DIR/scriptrc -set -e - -# Grab any OPENSTACK_SWIFT_SERVICE* environment variables -openstack_service_names=`env| awk -F '=' '(/OPENSTACK_SWIFT_SERVICE/){print $2}'` -for service_name in $openstack_service_names -do - # Double-negative: we want to ensure swift-init does not return - # 'No running' - swift-init $service_name status 2>/dev/null | grep -vq "No $service_name running" -done diff --git a/scripts/remove_from_cluster b/scripts/remove_from_cluster index 4fb2aa1..fc2d6f6 100755 --- a/scripts/remove_from_cluster +++ b/scripts/remove_from_cluster @@ -1,2 +1,4 @@ #!/bin/bash crm node standby +service pacemaker stop +service corosync stop