前言: 最近開始搗鼓OpenStack了,在用RDO部署OpenStack的時候,發現裝了Redis, 遂決定看看OpenStack哪些地方(能夠)用到Redis。git
/etc/openstack-dashboard/local_settings.
SESSION_ENGINE = 'django.contrib.sessions.backends.cache' CACHES = { "default": { "BACKEND": "redis_cache.cache.RedisCache", "LOCATION": "127.0.0.1:6379:1", "OPTIONS": { "CLIENT_CLASS": "redis_cache.client.DefaultClient", } } }
若是django-redis版本是3.8.0或以上,那麼應該要這樣配置(https://niwinz.github.io/django-redis/latest/#_configure_as_cache_backend):
github
SESSION_ENGINE = 'django.contrib.sessions.backends.cache' CACHES = { 'default': { 'BACKEND': 'django_redis.cache.RedisCache', 'LOCATION': 'redis://127.0.0.1:6379/1', 'OPTIONS': { 'CLIENT_CLASS': 'django_redis.client.DefaultClient', } } }
3. 重啓httpd/apache, 登錄Dashboard,而後查看Redis的key:
redis
[cache] enabled=true expiration_time=600 backend=dogpile.cache.redis backend_argument=url:redis://127.0.0.1:6379/2 [token] caching=true driver = keystone.token.persistence.backends.kvs.Token
3. 重啓keystone(httpd), 查看Redis的key:sql
RDO 安裝後,默認的就是Redis做爲backend, 參看/etc/ceilometer/ceilometer.conf:
apache
[coordination] # # From ceilometer # # The backend URL to use for distributed coordination. If left empty, per- # deployment central agent and per-host compute agent won't do workload # partitioning and will only function correctly if a single instance of that # service is running. (string value) #backend_url = <None> backend_url = redis://9.114.112.108:6379 # Number of seconds between heartbeats for distributed coordination. (floating # point value) #heartbeat = 1.0 # Number of seconds between checks to see if group membership has changed # (floating point value) #check_watchers = 10.0