Add memcached to api server

This commit adds installing and configuring memcached to the api
server. It then configures the api server to use memcached for it's
local response cache. This is needed to enable the async worker from
openstack-health change I0fd29839c72ca2fdfb4c4724bb3da7e283e3d27d.

Change-Id: I3057e7f9f920550a12c12c1bfeb643a713c5f696
This commit is contained in:
Matthew Treinish 2016-05-25 17:31:25 -04:00
parent a5c17a8719
commit 814b6585e5
No known key found for this signature in database
GPG Key ID: FD12A0F214C9E177
3 changed files with 18 additions and 3 deletions

View File

@ -50,6 +50,11 @@ class openstack_health::api(
version => 'system',
}
class { '::memcached':
max_memory => '60%',
listen_ip => '127.0.0.1',
}
vcsrepo { $elastic_recheck_dir :
ensure => latest,
owner => 'openstack_health',
@ -95,9 +100,16 @@ class openstack_health::api(
ensure => present,
}
package {'libmemcached-dev':
ensure => present,
}
exec { 'requirements':
command => "${virtualenv_dir}/bin/pip install -U -r ${source_dir}/requirements.txt",
require => Python::Virtualenv[$virtualenv_dir],
command => "${virtualenv_dir}/bin/pip install -U -r ${source_dir}/requirements.txt pylibmc",
require => [
Python::Virtualenv[$virtualenv_dir],
Package['libmemcached-dev'],
],
subscribe => Vcsrepo[$source_dir],
refreshonly => true,
timeout => 1800,

View File

@ -19,6 +19,7 @@
}
],
"dependencies": [
{"name":"openstackinfra/vcsrepo","version_requirement":">= 0.0.8"}
{"name":"openstackinfra/vcsrepo","version_requirement":">= 0.0.8"},
{"name":"saz/memcached","version_requirement":">= 2.8.1"}
]
}

View File

@ -1,6 +1,8 @@
[default]
query_dir = <%= @elastic_recheck_dir %>/queries
cache_expiration = <%= @cache_expiration %>
cache_backend = dogpile.cache.pylibmc
cache_url = 127.0.0.1
db_uri = <%= scope.lookupvar("openstack_health::api::db_uri") %>
<% if @ignored_keys.length > 0 -%>
ignored_run_metadata_keys =