Revert "Revert "devstack config for dogpile cache""

This reverts commit a0bb0f16b1.

Closes-Bug: #1519477
Co-Authored-By: Chris Dent <cdent@anticdent.org>
Change-Id: I34aa352c39d80692d7c3aa71eb108f0257d36484
This commit is contained in:
gordon chung 2015-12-09 22:07:47 +00:00
parent f15e952895
commit c410ff9e82
2 changed files with 24 additions and 1 deletions

View File

@ -126,7 +126,7 @@ function _ceilometer_config_apache_wsgi {
function _ceilometer_prepare_coordination {
if echo $CEILOMETER_COORDINATION_URL | grep -q '^memcached:'; then
install_package memcached
elif echo $CEILOMETER_COORDINATION_URL | grep -q '^redis:'; then
elif [[ "${CEILOMETER_COORDINATOR_URL%%:*}" == "redis" || "${CEILOMETER_CACHE_BACKEND##*.}" == "redis" ]]; then
_ceilometer_install_redis
fi
}
@ -218,6 +218,20 @@ function cleanup_ceilometer {
fi
}
# Set configuraiton for cache backend.
# NOTE(cdent): This currently only works for redis. Still working
# out how to express the other backends.
function _ceilometer_configure_cache_backend {
iniset $CEILOMETER_CONF cache backend $CEILOMETER_CACHE_BACKEND
iniset $CEILOMETER_CONF cache backend_argument url:$CEILOMETER_CACHE_URL
iniadd_literal $CEILOMETER_CONF cache backend_argument distributed_lock:True
if [[ "${CEILOMETER_CACHE_BACKEND##*.}" == "redis" ]]; then
iniadd_literal $CEILOMETER_CONF cache backend_argument db:0
iniadd_literal $CEILOMETER_CONF cache backend_argument redis_expiration_time:600
fi
}
# Set configuration for storage backend.
function _ceilometer_configure_storage_backend {
if [ "$CEILOMETER_BACKEND" = 'mysql' ] || [ "$CEILOMETER_BACKEND" = 'postgresql' ] ; then
@ -253,6 +267,10 @@ function configure_ceilometer {
iniset $CEILOMETER_CONF compute workload_partitioning True
fi
if [[ -n "$CEILOMETER_CACHE_BACKEND" ]]; then
_ceilometer_configure_cache_backend
fi
# Install the policy file and declarative configuration files to
# the conf dir.
# NOTE(cdent): Do not make this a glob as it will conflict

View File

@ -32,6 +32,11 @@ CEILOMETER_EVENTS=${CEILOMETER_EVENTS:-True}
CEILOMETER_COORDINATION_URL=${CEILOMETER_COORDINATION_URL:-}
CEILOMETER_PIPELINE_INTERVAL=${CEILOMETER_PIPELINE_INTERVAL:-}
# Cache Options
# NOTE(cdent): These are incomplete and specific for this testing.
CEILOMETER_CACHE_BACKEND=${CEILOMETER_CACHE_BACKEND:-dogpile.cache.redis}
CEILOMETER_CACHE_URL=${CEILOMETER_CACHE_URL:-redis://localhost:6379}
CEILOMETER_EVENT_ALARM=${CEILOMETER_EVENT_ALARM:-False}
# Tell Tempest this project is present