From 2aa359889363664691ff4a669531acca3e443b75 Mon Sep 17 00:00:00 2001 From: Andy McCrae Date: Tue, 9 Feb 2016 16:13:51 +0000 Subject: [PATCH] Move swift memcache conf into separate file The memcache configuration was only setup for the proxy-server.conf within Swift, and was not set for the object and container reconcilers which both use memcache. This patch moves the memcache settings into a separate memcache.conf file which is then configured on all swift hosts, removing the specific conf from the proxy-server.conf file. Change-Id: I047b2d1178de43c694c30280f6ed9fe8511341fd Closes-Bug: #1542121 --- defaults/main.yml | 1 + tasks/swift_post_install.yml | 4 ++++ templates/proxy-server.conf.j2 | 2 -- templates/swift-memcache.conf.j2 | 30 ++++++++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 templates/swift-memcache.conf.j2 diff --git a/defaults/main.yml b/defaults/main.yml index 8e705ec0..3147e2da 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -256,3 +256,4 @@ swift_container_server_replicator_conf_overrides: {} swift_object_server_conf_overrides: {} swift_object_expirer_conf_overrides: {} swift_object_server_replicator_conf_overrides: {} +swift_memcache_conf_overrides: {} diff --git a/tasks/swift_post_install.yml b/tasks/swift_post_install.yml index ab6c389c..d00203c7 100644 --- a/tasks/swift_post_install.yml +++ b/tasks/swift_post_install.yml @@ -31,6 +31,10 @@ dest: "/etc/swift/dispersion.conf" config_overrides: "{{ swift_swift_dispersion_conf_overrides }}" config_type: "ini" + - src: "swift-memcache.conf.j2" + dest: "/etc/swift/memcache.conf" + config_overrides: "{{ swift_memcache_conf_overrides }}" + config_type: "ini" notify: - Restart swift account services - Restart swift container services diff --git a/templates/proxy-server.conf.j2 b/templates/proxy-server.conf.j2 index 111fd6c6..b1d0d197 100644 --- a/templates/proxy-server.conf.j2 +++ b/templates/proxy-server.conf.j2 @@ -114,8 +114,6 @@ use = egg:swift#healthcheck [filter:cache] use = egg:swift#memcache -memcache_servers = {{ memcached_servers }} -memcache_serialization_support = 2 [filter:ratelimit] use = egg:swift#ratelimit diff --git a/templates/swift-memcache.conf.j2 b/templates/swift-memcache.conf.j2 new file mode 100644 index 00000000..a823791c --- /dev/null +++ b/templates/swift-memcache.conf.j2 @@ -0,0 +1,30 @@ +[memcache] +# You can use this single conf file instead of having memcache_servers set in +# several other conf files under [filter:cache] for example. You can specify +# multiple servers separated with commas, as in: 10.1.2.3:11211,10.1.2.4:11211 +# (IPv6 addresses must follow rfc3986 section-3.2.2, i.e. [::1]:11211) +# memcache_servers = 127.0.0.1:11211 +memcache_servers = {{ memcached_servers }} +# +# Sets how memcache values are serialized and deserialized: +# 0 = older, insecure pickle serialization +# 1 = json serialization but pickles can still be read (still insecure) +# 2 = json serialization only (secure and the default) +# To avoid an instant full cache flush, existing installations should +# upgrade with 0, then set to 1 and reload, then after some time (24 hours) +# set to 2 and reload. +# In the future, the ability to use pickle serialization will be removed. +# memcache_serialization_support = 2 +memcache_serialization_support = 2 +# +# Sets the maximum number of connections to each memcached server per worker +# memcache_max_connections = 2 +# +# Timeout for connection +# connect_timeout = 0.3 +# Timeout for pooled connection +# pool_timeout = 1.0 +# number of servers to retry on failures getting a pooled connection +# tries = 3 +# Timeout for read and writes +# io_timeout = 2.0