From 236a7f2f7dc274d33bcc195c5344865639ccd032 Mon Sep 17 00:00:00 2001 From: Anastasia Kuznetsova Date: Fri, 11 Mar 2016 16:00:48 +0300 Subject: [PATCH] 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 --- devstack/plugin.sh | 14 ++++++++++++-- devstack/settings | 12 ++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 797cedd36..d3bd485cd 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -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 } diff --git a/devstack/settings b/devstack/settings index 168f68ff3..ddeb3109a 100644 --- a/devstack/settings +++ b/devstack/settings @@ -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