Added health check scripts.

This commit is contained in:
Jerry Seutter 2013-03-04 17:02:41 -07:00
parent bca591c278
commit 58f00a388a
6 changed files with 42 additions and 1 deletions

View File

@ -77,6 +77,17 @@ function config_changed {
determine_services
service_ctl all restart
# Save our scriptrc env variables for health checks
declare -a env_vars=(
"OPENSTACK_PORT_MCASTPORT=$(config-get ha-mcastport)"
'OPENSTACK_SERVICE_API_EC2=nova-api-ec2'
'OPENSTACK_SERVICE_API_OS_COMPUTE=nova-api-os-compute'
'OPENSTACK_SERVICE_CERT=nova-cert'
'OPENSTACK_SERVICE_CONDUCTOR=nova-conductor'
'OPENSTACK_SERVICE_OBJECTSTORE=nova-objectstore'
'OPENSTACK_SERVICE_SCHEDULER=nova-scheduler'
save_script_rc ${env_vars[@]}
}
function amqp_joined {

View File

@ -1 +1 @@
212
213

2
scripts/add_to_cluster Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
crm node online

View File

@ -0,0 +1,13 @@
#!/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

View File

@ -0,0 +1,13 @@
#!/bin/bash
# Validate that service is running
HEALTH_DIR=`dirname $0`
SCRIPTS_DIR=`dirname $HEALTH_DIR`
. $SCRIPTS_DIR/scriptrc
set -e
# Grab any OPENSTACK_SERVICE* environment variables
openstack_service_names=`env| awk -F '=' '(/OPENSTACK_SERVICE/){print $2}'`
for service_name in $openstack_service_names
do
service $service_name status 2>/dev/null | grep -q running
done

2
scripts/remove_from_cluster Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
crm node standby