supply a list of memcache servers rather than the load balancer IP

addresses #373
This commit is contained in:
Darren Birkett 2014-10-23 15:43:54 +01:00
parent 039834337a
commit 1ff2659112
10 changed files with 21 additions and 18 deletions

View File

@ -63,7 +63,8 @@ admin_tenant_name = {{ service_admin_tenant_name }}
admin_user = {{ service_admin_username }}
admin_password = {{ service_admin_password }}
memcached_servers = {{ internal_vip_address }}:{{ memcached_port }}
memcached_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['container_address'] }}:{{ memcached_port|default('11211') }}{% if not loop.last %},{% endif %}{% endfor %}
token_cache_time = 300
revocation_cache_time = 60

View File

@ -63,7 +63,8 @@ admin_tenant_name = {{ service_admin_tenant_name }}
admin_user = {{ service_admin_username }}
admin_password = {{ service_admin_password }}
memcached_servers = {{ internal_vip_address }}:{{ memcached_port }}
memcached_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['container_address'] }}:{{ memcached_port|default('11211') }}{% if not loop.last %},{% endif %}{% endfor %}
token_cache_time = 300
revocation_cache_time = 60

View File

@ -18,7 +18,8 @@ admin_tenant_name = {{ service_admin_tenant_name }}
admin_user = {{ service_admin_username }}
admin_password = {{ service_admin_password }}
memcached_servers = {{ internal_vip_address }}:{{ memcached_port }}
memcached_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['container_address'] }}:{{ memcached_port|default('11211') }}{% if not loop.last %},{% endif %}{% endfor %}
token_cache_time = 300
revocation_cache_time = 60

View File

@ -88,7 +88,8 @@ admin_tenant_name = {{ service_admin_tenant_name }}
admin_user = {{ service_admin_username }}
admin_password = {{ service_admin_password }}
memcached_servers = {{ internal_vip_address }}:{{ memcached_port }}
memcached_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['container_address'] }}:{{ memcached_port|default('11211') }}{% if not loop.last %},{% endif %}{% endfor %}
token_cache_time = 300
revocation_cache_time = 60

View File

@ -103,7 +103,10 @@ SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.se
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '{{ internal_vip_address }}:{{ memcached_port }}',
'LOCATION': [
{% for host in groups['memcached'] %}'{{ hostvars[host]['container_address'] }}:{{ memcached_port|default('11211') }}'{% if not loop.last %},{% endif %}{% endfor %}
]
}
}

View File

@ -17,7 +17,8 @@ rabbit_password = {{ rabbit_password }}
rpc_backend = {{ rpc_backend }}
[memcache]
servers = {{ internal_vip_address }}:{{ memcached_port }}
servers = {% for host in groups['memcached'] %}{{ hostvars[host]['container_address'] }}:{{ memcached_port|default('11211') }}{% if not loop.last %},{% endif %}{% endfor %}
max_compare_and_set_retry = 16
[cache]
@ -102,4 +103,4 @@ revocation_cache_time = 3600
expiration = 43200
caching = true
cache_time = 5400
provider = {{ token_provider }}
provider = {{ token_provider }}

View File

@ -92,7 +92,8 @@ admin_tenant_name = {{ service_admin_tenant_name }}
admin_user = {{ service_admin_username }}
admin_password = {{ service_admin_password }}
memcached_servers = {{ internal_vip_address }}:{{ memcached_port }}
memcached_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['container_address'] }}:{{ memcached_port|default('11211') }}{% if not loop.last %},{% endif %}{% endfor %}
token_cache_time = 300
revocation_cache_time = 60

View File

@ -87,7 +87,7 @@ force_config_drive = always
max_age = {{ nova_max_age }}
# Common
memcached_servers = {{ internal_vip_address }}:{{ memcached_port }}
memcached_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['container_address'] }}:{{ memcached_port|default('11211') }}{% if not loop.last %},{% endif %}{% endfor %}
# Cinder
[cinder]
@ -139,7 +139,8 @@ admin_password = {{ service_admin_password }}
admin_user = {{ service_admin_username }}
admin_tenant_name = {{ service_admin_tenant_name }}
memcached_servers = {{ internal_vip_address }}:{{ memcached_port }}
memcached_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['container_address'] }}:{{ memcached_port|default('11211') }}{% if not loop.last %},{% endif %}{% endfor %}
token_cache_time = 300
revocation_cache_time = 60

View File

@ -316,7 +316,7 @@ use = egg:swift#memcache
# memcache.conf (see memcache.conf-sample) or lacking that file, it will
# default to the value below. You can specify multiple servers separated with
# commas, as in: 10.1.2.3:11211,10.1.2.4:11211
memcache_servers = {{ internal_vip_address }}:{{ memcached_port }}
memcache_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['container_address'] }}:{{ memcached_port|default('11211') }}{% if not loop.last %},{% endif %}{% endfor %}
#
# Sets how memcache values are serialized and deserialized:
# 0 = older, insecure pickle serialization

View File

@ -147,13 +147,6 @@ haproxy_config:
hap_backend_alg: source
hap_backend_options:
- "ssl-hello-chk"
- service:
hap_service_name: memcached
hap_backend_nodes: "{{ [groups['memcached'][0]] }}" # list expected
hap_backup_nodes: "{{ groups['memcached'][1:] }}"
hap_port: 11211
hap_balance_type: tcp
hap_whitelist_hosts: true
- service:
hap_service_name: elasticsearch
hap_backend_nodes: "{{ [groups['elasticsearch'][0]] }}"