Add memcache as the coordinator backend

Both the zone and pool manager daemons require a coordination
backend to be configured when there is more than one worker. There
is almost always more than one worker as the charm user a multiplier
based on the number of cpus to configure the number of workes.

This change adds the coordinator-memcached relation and makes is
compulsory for designate deployments.

Change-Id: Ic1b35e33ba9b6f015b199c35ccff64d626c29582
This commit is contained in:
Liam Young 2017-11-02 13:48:14 +00:00
parent 749c65f7d1
commit 9bee68d19d
9 changed files with 18 additions and 6 deletions

View File

@ -12,6 +12,8 @@ charms:
juju deploy mysql
juju deploy rabbitmq-server
juju deploy keystone
juju deploy memcached
juju add-relation designate memcached
juju add-relation designate mysql
juju add-relation designate rabbitmq-server
juju add-relation designate keystone

View File

@ -1,4 +1,4 @@
includes: ['layer:openstack-api', 'interface:bind-rndc', 'interface:hacluster', 'interface:openstack-ha']
includes: ['layer:openstack-api', 'interface:bind-rndc', 'interface:hacluster', 'interface:openstack-ha', 'interface:memcache']
options:
basic:
use_venv: True

View File

@ -243,6 +243,7 @@ class DesignateAdapters(openstack_adapters.OpenStackAPIRelationAdapters):
'shared_db': DesignateDBAdapter,
'cluster': openstack_adapters.PeerHARelationAdapter,
'dns_backend': BindRNDCRelationAdapter,
'coordinator_memcached': openstack_adapters.MemcacheRelationAdapter,
}
@ -268,7 +269,8 @@ class DesignateCharm(openstack_charm.HAOpenStackCharm):
}
}
required_relations = ['shared-db', 'amqp', 'identity-service', ]
required_relations = ['shared-db', 'amqp', 'identity-service',
'coordinator-memcached']
restart_map = {
'/etc/default/openstack': services,

View File

@ -28,6 +28,8 @@ requires:
ha:
interface: hacluster
scope: container
coordinator-memcached:
interface: memcache
peers:
cluster:
interface: openstack-ha

View File

@ -32,6 +32,7 @@ COMPLETE_INTERFACE_STATES = [
'shared-db.available',
'identity-service.available',
'amqp.available',
'coordinator-memcached.available',
]

View File

@ -377,8 +377,9 @@ connection = {{ shared_db.designate_uri }}
## Coordination
########################
[coordination]
# URL for the coordination backend to use.
#backend_url = kazoo://127.0.0.1/
{% if coordinator_memcached.url -%}
backend_url = {{ coordinator_memcached.url }}
{%- endif %}
########################
## Hook Points

View File

@ -50,7 +50,7 @@ class DesignateBasicDeployment(amulet_deployment.OpenStackAmuletDeployment):
self._deploy()
u.log.info('Waiting on extended status checks...')
exclude_services = ['mongodb']
exclude_services = ['mongodb', 'memcached']
self._auto_wait_for_status(exclude_services=exclude_services)
self.d.sentry.wait()
@ -68,6 +68,7 @@ class DesignateBasicDeployment(amulet_deployment.OpenStackAmuletDeployment):
{'name': 'percona-cluster', 'constraints': {'mem': '3072M'}},
{'name': 'rabbitmq-server'},
{'name': 'keystone'},
{'name': 'memcached', 'location': 'cs:memcached'},
{'name': 'designate-bind'}
]
@ -78,6 +79,7 @@ class DesignateBasicDeployment(amulet_deployment.OpenStackAmuletDeployment):
no_origin = [
'designate-bind',
'memcached',
]
super(DesignateBasicDeployment, self)._add_services(this_service,
@ -93,6 +95,7 @@ class DesignateBasicDeployment(amulet_deployment.OpenStackAmuletDeployment):
'designate:identity-service': 'keystone:identity-service',
'keystone:shared-db': 'percona-cluster:shared-db',
'designate:dns-backend': 'designate-bind:dns-backend',
'designate:coordinator-memcached': 'memcached:cache',
}
super(DesignateBasicDeployment, self)._add_relations(relations)

View File

@ -13,7 +13,7 @@ setenv = VIRTUAL_ENV={envdir}
LAYER_PATH={toxinidir}/layers
INTERFACE_PATH={toxinidir}/interfaces
JUJU_REPOSITORY={toxinidir}/build
passenv = http_proxy https_proxy
passenv = http_proxy https_proxy USER
install_command =
pip install {opts} {packages}
deps =

View File

@ -15,6 +15,7 @@ class TestRegisteredHooks(test_utils.TestRegisteredHooks):
'dns-config.available',
'shared-db.available',
'identity-service.available',
'coordinator-memcached.available',
'amqp.available')
hook_set = {
'when': {