Added health check scripts.
This commit is contained in:
parent
bca591c278
commit
58f00a388a
@ -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 {
|
||||
|
2
revision
2
revision
@ -1 +1 @@
|
||||
212
|
||||
213
|
||||
|
2
scripts/add_to_cluster
Executable file
2
scripts/add_to_cluster
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
crm node online
|
13
scripts/health_checks.d/service_ports_live
Executable file
13
scripts/health_checks.d/service_ports_live
Executable 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
|
13
scripts/health_checks.d/service_running
Executable file
13
scripts/health_checks.d/service_running
Executable 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
2
scripts/remove_from_cluster
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
crm node standby
|
Loading…
x
Reference in New Issue
Block a user