Run mistral services as separate processes

For implemetation of ha gate and ha/destructive scenarios it would
be better to run mistral services in separate processes to easily manage
them.

Change-Id: I85ec81d11a2ecef5a256f93526d8c8498f2ebae0
Partially-implements: blueprint mistral-ha-gate
This commit is contained in:
Anastasia Kuznetsova 2016-03-11 16:00:48 +03:00
parent 2e95865a67
commit 236a7f2f7d
2 changed files with 22 additions and 4 deletions

View File

@ -137,14 +137,24 @@ function install_mistral_pythonclient {
# start_mistral - Start running processes, including screen
function start_mistral {
screen_it mistral "cd $MISTRAL_DIR && $MISTRAL_BIN_DIR/mistral-server --config-file $MISTRAL_CONF_DIR/mistral.conf"
if is_service_enabled mistral-api && is_service_enabled mistral-engine && is_service_enabled mistral-executor ; then
echo_summary "Installing all mistral services in separate processes"
run_process mistral-api "$MISTRAL_BIN_DIR/mistral-server --server api --config-file $MISTRAL_CONF_DIR/mistral.conf"
run_process mistral-engine "$MISTRAL_BIN_DIR/mistral-server --server engine --config-file $MISTRAL_CONF_DIR/mistral.conf"
run_process mistral-executor "$MISTRAL_BIN_DIR/mistral-server --server executor --config-file $MISTRAL_CONF_DIR/mistral.conf"
else
echo_summary "Installing all mistral services in one process"
run_process mistral "$MISTRAL_BIN_DIR/mistral-server --server all --config-file $MISTRAL_CONF_DIR/mistral.conf"
fi
}
# stop_mistral - Stop running processes
function stop_mistral {
# Kill the Mistral screen windows
screen -S $SCREEN_NAME -p mistral -X kill
for serv in mistral mistral-api mistral-engine mistral-executor; do
stop_process $serv
done
}

View File

@ -1,8 +1,16 @@
# Devstack settings
# We have to add Mistral to enabled services for screen_it to work
# We have to add Mistral to enabled services for run_process to work
# "mistral" should be always enabled
# To run services in separate processes and screens need to write:
# enable_service mistral mistral-api mistral-engine mistral-executor
# To run all services in one screen as a one process need to write:
# enable_service mistral
# All other combinations of services like 'mistral mistral-api' or 'mistral mistral-api mistral-engine'
# is an incorrect way to run services and all services by default will run in one screen
enable_service mistral
enable_service mistral mistral-api mistral-engine mistral-executor
# Set up default repos