Merge "[devstack] fmManager process launch"
This commit is contained in:
commit
f227d03aad
@ -31,6 +31,7 @@ STX_FAULT_DIR=${GITDIR[$STX_FAULT_NAME]}
|
|||||||
STX_FAULT_CONF_DIR=/etc/fm
|
STX_FAULT_CONF_DIR=/etc/fm
|
||||||
FM_RESTAPI_CONF=$STX_FAULT_CONF_DIR/fm.conf
|
FM_RESTAPI_CONF=$STX_FAULT_CONF_DIR/fm.conf
|
||||||
FM_RESTAPI_PASTE_INI=$STX_FAULT_CONF_DIR/api-paste.ini
|
FM_RESTAPI_PASTE_INI=$STX_FAULT_CONF_DIR/api-paste.ini
|
||||||
|
FM_EVENT_YAML=$STX_FAULT_CONF_DIR/events.yaml
|
||||||
FM_RESTAPI_AUTH_CACHE_DIR=${FM_RESTAPI_AUTH_CACHE_DIR:-/var/cache/fault}
|
FM_RESTAPI_AUTH_CACHE_DIR=${FM_RESTAPI_AUTH_CACHE_DIR:-/var/cache/fault}
|
||||||
|
|
||||||
FM_RESTAPI_DIR=$STX_FAULT_DIR/fm-rest-api/fm
|
FM_RESTAPI_DIR=$STX_FAULT_DIR/fm-rest-api/fm
|
||||||
@ -108,15 +109,29 @@ function build_fm_mgr {
|
|||||||
function cleanup_fault {
|
function cleanup_fault {
|
||||||
stop_fault
|
stop_fault
|
||||||
|
|
||||||
|
if is_service_enabled fm-client || is_service_enabled fm-common; then
|
||||||
|
cleanup_fm_client
|
||||||
|
fi
|
||||||
|
if is_service_enabled fm-api; then
|
||||||
|
cleanup_fm_api
|
||||||
|
fi
|
||||||
if is_service_enabled fm-mgr; then
|
if is_service_enabled fm-mgr; then
|
||||||
cleanup_fm_mgr
|
cleanup_fm_mgr
|
||||||
fi
|
fi
|
||||||
if is_service_enabled fm-common; then
|
|
||||||
cleanup_fm_common
|
|
||||||
fi
|
|
||||||
if is_service_enabled fm-rest-api; then
|
if is_service_enabled fm-rest-api; then
|
||||||
cleanup_fm_rest_api
|
cleanup_fm_rest_api
|
||||||
fi
|
fi
|
||||||
|
if is_service_enabled fm-common; then
|
||||||
|
cleanup_fm_common
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function cleanup_fm_api {
|
||||||
|
sudo pip uninstall -y fm_api
|
||||||
|
}
|
||||||
|
|
||||||
|
function cleanup_fm_client {
|
||||||
|
sudo pip uninstall -y fmclient
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanup_fm_common {
|
function cleanup_fm_common {
|
||||||
@ -128,6 +143,7 @@ function cleanup_fm_common {
|
|||||||
local minor=${version##*.}
|
local minor=${version##*.}
|
||||||
|
|
||||||
sudo rm /etc/ld.so.conf.d/stx-fault.conf
|
sudo rm /etc/ld.so.conf.d/stx-fault.conf
|
||||||
|
sudo pip uninstall -y fm-core
|
||||||
|
|
||||||
pushd $STX_FAULT_DIR/fm-common/sources
|
pushd $STX_FAULT_DIR/fm-common/sources
|
||||||
|
|
||||||
@ -168,7 +184,10 @@ function cleanup_fm_mgr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanup_fm_rest_api {
|
function cleanup_fm_rest_api {
|
||||||
sudo rm -rf $FM_RESTAPI_AUTH_CACHE_DIR $FM_RESTAPI_CONF
|
sudo pip uninstall -y fm
|
||||||
|
|
||||||
|
sudo rm -rf $FM_RESTAPI_AUTH_CACHE_DIR $FM_RESTAPI_CONF $FM_RESTAPI_PASTE_INI $FM_EVENT_YAML
|
||||||
|
dropdb -h 127.0.0.1 -Uroot fm
|
||||||
}
|
}
|
||||||
|
|
||||||
function configure_fault {
|
function configure_fault {
|
||||||
@ -183,6 +202,7 @@ function configure_fm_rest_api {
|
|||||||
sudo install -d -o $STACK_USER -m 755 $STX_FAULT_CONF_DIR
|
sudo install -d -o $STACK_USER -m 755 $STX_FAULT_CONF_DIR
|
||||||
|
|
||||||
cp -p $STX_FAULT_DIR/devstack/files/api-paste.ini $FM_RESTAPI_PASTE_INI
|
cp -p $STX_FAULT_DIR/devstack/files/api-paste.ini $FM_RESTAPI_PASTE_INI
|
||||||
|
cp -p $STX_FAULT_DIR/fm-doc/fm_doc/events.yaml $FM_EVENT_YAML
|
||||||
|
|
||||||
configure_auth_token_middleware $FM_RESTAPI_CONF fm $FM_RESTAPI_AUTH_CACHE_DIR
|
configure_auth_token_middleware $FM_RESTAPI_CONF fm $FM_RESTAPI_AUTH_CACHE_DIR
|
||||||
|
|
||||||
@ -204,6 +224,7 @@ function configure_fm_rest_api {
|
|||||||
iniset $FM_RESTAPI_CONF DEFAULT region_name RegionOne
|
iniset $FM_RESTAPI_CONF DEFAULT region_name RegionOne
|
||||||
iniset $FM_RESTAPI_CONF DEFAULT event_log_max_size 4000
|
iniset $FM_RESTAPI_CONF DEFAULT event_log_max_size 4000
|
||||||
iniset $FM_RESTAPI_CONF DEFAULT system_name $(hostname)
|
iniset $FM_RESTAPI_CONF DEFAULT system_name $(hostname)
|
||||||
|
iniset $FM_RESTAPI_CONF DEFAULT sql_connection $(database_connection_url fm)
|
||||||
iniset $FM_RESTAPI_CONF database idle_timeout 60
|
iniset $FM_RESTAPI_CONF database idle_timeout 60
|
||||||
iniset $FM_RESTAPI_CONF database max_pool_size 1
|
iniset $FM_RESTAPI_CONF database max_pool_size 1
|
||||||
iniset $FM_RESTAPI_CONF database max_overflow 20
|
iniset $FM_RESTAPI_CONF database max_overflow 20
|
||||||
@ -235,6 +256,16 @@ function create_fault_user_group {
|
|||||||
|
|
||||||
function init_fault {
|
function init_fault {
|
||||||
create_fault_cache_dir
|
create_fault_cache_dir
|
||||||
|
|
||||||
|
if is_service_enabled fm-rest-api && is_service_enabled stx-config; then
|
||||||
|
init_rest_api
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function init_rest_api {
|
||||||
|
# create db for fm
|
||||||
|
createdb -h 127.0.0.1 -Uroot -l C -T template0 -E utf8 fm
|
||||||
|
fm-dbsync --config-file $FM_RESTAPI_CONF
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_fault {
|
function install_fault {
|
||||||
@ -318,6 +349,12 @@ function install_fm_common {
|
|||||||
# TODO: this should be managed better
|
# TODO: this should be managed better
|
||||||
echo $STX_INST_DIR/lib | sudo tee /etc/ld.so.conf.d/stx-fault.conf
|
echo $STX_INST_DIR/lib | sudo tee /etc/ld.so.conf.d/stx-fault.conf
|
||||||
sudo ldconfig
|
sudo ldconfig
|
||||||
|
|
||||||
|
# in fm-common/sources/fmMsgServer.cpp,requst get "getaddrinfo(host.c_str(),"
|
||||||
|
# hostname "controller" ip, so change hosname to controller
|
||||||
|
ADD_LINE="$HOST_IP controller"
|
||||||
|
grep "$ADD_LINE" /etc/hosts || sudo sed -i "/127.0.0.1 */a$ADD_LINE" /etc/hosts
|
||||||
|
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -353,11 +390,17 @@ function start_fault {
|
|||||||
if is_service_enabled fm-rest-api; then
|
if is_service_enabled fm-rest-api; then
|
||||||
run_process fm-api "$STX_BIN_DIR/fm-api --config-file $FM_RESTAPI_CONF"
|
run_process fm-api "$STX_BIN_DIR/fm-api --config-file $FM_RESTAPI_CONF"
|
||||||
fi
|
fi
|
||||||
|
if is_service_enabled fm-mgr; then
|
||||||
|
run_process fm-mgr "$STX_BIN_DIR/fmManager start -c $FM_RESTAPI_CONF"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop_fault {
|
function stop_fault {
|
||||||
if is_service_enabled fm-rest-api; then
|
if is_service_enabled fm-rest-api; then
|
||||||
stop_process fm_api
|
stop_process fm-api
|
||||||
|
fi
|
||||||
|
if is_service_enabled fm-mgr; then
|
||||||
|
stop_process fm-mgr
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user