Merge "Add options to configure cache in nova" into stable/stein

This commit is contained in:
Zuul 2019-08-22 16:36:41 +00:00 committed by Gerrit Code Review
commit 98d65f87b3
3 changed files with 20 additions and 5 deletions

View File

@ -131,6 +131,9 @@ KEYSTONE_UNIQUE_LAST_PASSWORD_COUNT=${KEYSTONE_UNIQUE_LAST_PASSWORD_COUNT:-2}
# however may not be suitable for real production. # however may not be suitable for real production.
KEYSTONE_PASSWORD_HASH_ROUNDS=${KEYSTONE_PASSWORD_HASH_ROUNDS:-4} KEYSTONE_PASSWORD_HASH_ROUNDS=${KEYSTONE_PASSWORD_HASH_ROUNDS:-4}
# Cache settings
KEYSTONE_ENABLE_CACHE=${KEYSTONE_ENABLE_CACHE:-True}
# Functions # Functions
# --------- # ---------
@ -213,9 +216,9 @@ function configure_keystone {
iniset $KEYSTONE_CONF resource driver "$KEYSTONE_RESOURCE_BACKEND" iniset $KEYSTONE_CONF resource driver "$KEYSTONE_RESOURCE_BACKEND"
# Enable caching # Enable caching
iniset $KEYSTONE_CONF cache enabled "True" iniset $KEYSTONE_CONF cache enabled $KEYSTONE_ENABLE_CACHE
iniset $KEYSTONE_CONF cache backend "dogpile.cache.memcached" iniset $KEYSTONE_CONF cache backend $CACHE_BACKEND
iniset $KEYSTONE_CONF cache memcache_servers localhost:11211 iniset $KEYSTONE_CONF cache memcache_servers $MEMCACHE_SERVERS
iniset_rpc_backend keystone $KEYSTONE_CONF oslo_messaging_notifications iniset_rpc_backend keystone $KEYSTONE_CONF oslo_messaging_notifications

View File

@ -94,6 +94,7 @@ NOVA_SERVICE_PROTOCOL=${NOVA_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
NOVA_SERVICE_LOCAL_HOST=${NOVA_SERVICE_LOCAL_HOST:-$SERVICE_LOCAL_HOST} NOVA_SERVICE_LOCAL_HOST=${NOVA_SERVICE_LOCAL_HOST:-$SERVICE_LOCAL_HOST}
NOVA_SERVICE_LISTEN_ADDRESS=${NOVA_SERVICE_LISTEN_ADDRESS:-$(ipv6_unquote $SERVICE_LISTEN_ADDRESS)} NOVA_SERVICE_LISTEN_ADDRESS=${NOVA_SERVICE_LISTEN_ADDRESS:-$(ipv6_unquote $SERVICE_LISTEN_ADDRESS)}
METADATA_SERVICE_PORT=${METADATA_SERVICE_PORT:-8775} METADATA_SERVICE_PORT=${METADATA_SERVICE_PORT:-8775}
NOVA_ENABLE_CACHE=${NOVA_ENABLE_CACHE:-True}
# Option to enable/disable config drive # Option to enable/disable config drive
# NOTE: Set ``FORCE_CONFIG_DRIVE="False"`` to turn OFF config drive # NOTE: Set ``FORCE_CONFIG_DRIVE="False"`` to turn OFF config drive
@ -443,8 +444,8 @@ function create_nova_conf {
iniset $NOVA_CONF DEFAULT bindir "/usr/bin" iniset $NOVA_CONF DEFAULT bindir "/usr/bin"
fi fi
# only setup database connections if there are services that # only setup database connections and cache backend if there are services
# require them running on the host. The ensures that n-cpu doesn't # that require them running on the host. The ensures that n-cpu doesn't
# leak a need to use the db in a multinode scenario. # leak a need to use the db in a multinode scenario.
if is_service_enabled n-api n-cond n-sched; then if is_service_enabled n-api n-cond n-sched; then
# If we're in multi-tier cells mode, we want our control services pointing # If we're in multi-tier cells mode, we want our control services pointing
@ -461,6 +462,13 @@ function create_nova_conf {
iniset $NOVA_CONF database connection `database_connection_url $db` iniset $NOVA_CONF database connection `database_connection_url $db`
iniset $NOVA_CONF api_database connection `database_connection_url nova_api` iniset $NOVA_CONF api_database connection `database_connection_url nova_api`
# Cache related settings
# Those settings aren't really needed in n-cpu thus it is configured
# only on nodes which runs controller services
iniset $NOVA_CONF cache enabled $NOVA_ENABLE_CACHE
iniset $NOVA_CONF cache backend $CACHE_BACKEND
iniset $NOVA_CONF cache memcache_servers $MEMCACHE_SERVERS
fi fi
if is_service_enabled n-api; then if is_service_enabled n-api; then

View File

@ -774,6 +774,10 @@ ETCD_DOWNLOAD_LOCATION=$ETCD_DOWNLOAD_URL/$ETCD_VERSION/$ETCD_DOWNLOAD_FILE
# etcd is always required, so place it into list of pre-cached downloads # etcd is always required, so place it into list of pre-cached downloads
EXTRA_CACHE_URLS+=",$ETCD_DOWNLOAD_LOCATION" EXTRA_CACHE_URLS+=",$ETCD_DOWNLOAD_LOCATION"
# Cache settings
CACHE_BACKEND=${CACHE_BACKEND:-"dogpile.cache.memcached"}
MEMCACHE_SERVERS=${MEMCACHE_SERVERS:-"localhost:11211"}
# Detect duplicate values in IMAGE_URLS # Detect duplicate values in IMAGE_URLS
for image_url in ${IMAGE_URLS//,/ }; do for image_url in ${IMAGE_URLS//,/ }; do
if [ $(echo "$IMAGE_URLS" | grep -o -F "$image_url" | wc -l) -gt 1 ]; then if [ $(echo "$IMAGE_URLS" | grep -o -F "$image_url" | wc -l) -gt 1 ]; then