Use common helper to generate uwsgi setting
... to reduce own logic in our devstack plugin. Note that this adds apache web server in front of aodh-api run by uwsgi, following the standard architecture in devstack. Change-Id: Id7c67ab692105383ad46a5663aff05710485192d
This commit is contained in:
parent
19369bda05
commit
97e7362624
@ -28,7 +28,7 @@ function is_aodh_enabled {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function aodh_service_url {
|
function aodh_service_url {
|
||||||
echo "$AODH_SERVICE_PROTOCOL://$AODH_SERVICE_HOST:$AODH_SERVICE_PORT"
|
echo "$AODH_SERVICE_PROTOCOL://$AODH_SERVICE_HOST/alarming"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -61,13 +61,8 @@ function _aodh_create_accounts {
|
|||||||
|
|
||||||
create_service_user "aodh" "admin"
|
create_service_user "aodh" "admin"
|
||||||
|
|
||||||
local aodh_service=$(get_or_create_service "aodh" \
|
get_or_create_service "aodh" "alarming" "OpenStack Alarming Service"
|
||||||
"alarming" "OpenStack Alarming Service")
|
get_or_create_endpoint 'alarming' "$REGION_NAME" "$(aodh_service_url)"
|
||||||
get_or_create_endpoint $aodh_service \
|
|
||||||
"$REGION_NAME" \
|
|
||||||
"$(aodh_service_url)" \
|
|
||||||
"$(aodh_service_url)" \
|
|
||||||
"$(aodh_service_url)"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,7 +79,7 @@ function preinstall_aodh {
|
|||||||
# cleanup_aodh() - Remove residual data files, anything left over
|
# cleanup_aodh() - Remove residual data files, anything left over
|
||||||
# from previous runs that a clean run would need to clean up
|
# from previous runs that a clean run would need to clean up
|
||||||
function cleanup_aodh {
|
function cleanup_aodh {
|
||||||
:
|
remove_uwsgi_config "$AODH_UWSGI_CONF" "aodh"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set configuration for storage backend.
|
# Set configuration for storage backend.
|
||||||
@ -132,28 +127,7 @@ function configure_aodh {
|
|||||||
# call cleanup_aodh which will wipe the WSGI config.
|
# call cleanup_aodh which will wipe the WSGI config.
|
||||||
|
|
||||||
# iniset creates these files when it's called if they don't exist.
|
# iniset creates these files when it's called if they don't exist.
|
||||||
AODH_UWSGI_FILE=$AODH_CONF_DIR/aodh-uwsgi.ini
|
write_uwsgi_config "$AODH_UWSGI_CONF" "$AODH_UWSGI" "/alarming" "" "aodh"
|
||||||
|
|
||||||
rm -f "$AODH_UWSGI_FILE"
|
|
||||||
|
|
||||||
iniset "$AODH_UWSGI_FILE" uwsgi http $AODH_SERVICE_HOST:$AODH_SERVICE_PORT
|
|
||||||
iniset "$AODH_UWSGI_FILE" uwsgi wsgi-file "$AODH_DIR/aodh/api/app.wsgi"
|
|
||||||
# This is running standalone
|
|
||||||
iniset "$AODH_UWSGI_FILE" uwsgi master true
|
|
||||||
# Set die-on-term & exit-on-reload so that uwsgi shuts down
|
|
||||||
iniset "$AODH_UWSGI_FILE" uwsgi die-on-term true
|
|
||||||
iniset "$AODH_UWSGI_FILE" uwsgi exit-on-reload true
|
|
||||||
iniset "$AODH_UWSGI_FILE" uwsgi threads 10
|
|
||||||
iniset "$AODH_UWSGI_FILE" uwsgi processes $API_WORKERS
|
|
||||||
iniset "$AODH_UWSGI_FILE" uwsgi enable-threads true
|
|
||||||
iniset "$AODH_UWSGI_FILE" uwsgi plugins python
|
|
||||||
iniset "$AODH_UWSGI_FILE" uwsgi lazy-apps true
|
|
||||||
# uwsgi recommends this to prevent thundering herd on accept.
|
|
||||||
iniset "$AODH_UWSGI_FILE" uwsgi thunder-lock true
|
|
||||||
# Override the default size for headers from the 4k default.
|
|
||||||
iniset "$AODH_UWSGI_FILE" uwsgi buffer-size 65535
|
|
||||||
# Make sure the client doesn't try to re-use the connection.
|
|
||||||
iniset "$AODH_UWSGI_FILE" uwsgi add-header "Connection: close"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# init_aodh() - Initialize etc.
|
# init_aodh() - Initialize etc.
|
||||||
@ -196,7 +170,7 @@ function install_aodhclient {
|
|||||||
|
|
||||||
# start_aodh() - Start running processes, including screen
|
# start_aodh() - Start running processes, including screen
|
||||||
function start_aodh {
|
function start_aodh {
|
||||||
run_process aodh-api "$AODH_BIN_DIR/uwsgi $AODH_UWSGI_FILE"
|
run_process aodh-api "$AODH_BIN_DIR/uwsgi --ini $AODH_UWSGI_CONF"
|
||||||
|
|
||||||
# Only die on API if it was actually intended to be turned on
|
# Only die on API if it was actually intended to be turned on
|
||||||
if is_service_enabled aodh-api; then
|
if is_service_enabled aodh-api; then
|
||||||
|
@ -10,6 +10,8 @@ enable_service aodh-listener
|
|||||||
AODH_DIR=$DEST/aodh
|
AODH_DIR=$DEST/aodh
|
||||||
AODH_CONF_DIR=/etc/aodh
|
AODH_CONF_DIR=/etc/aodh
|
||||||
AODH_CONF=$AODH_CONF_DIR/aodh.conf
|
AODH_CONF=$AODH_CONF_DIR/aodh.conf
|
||||||
|
AODH_UWSGI_CONF=$AODH_CONF_DIR/aodh-uwsgi.ini
|
||||||
|
AODH_UWSGI=$AODH_DIR/aodh/api/app.wsgi
|
||||||
|
|
||||||
# Set up database backend
|
# Set up database backend
|
||||||
AODH_BACKEND=${AODH_BACKEND:-mysql}
|
AODH_BACKEND=${AODH_BACKEND:-mysql}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user