use of org.platformlayer.service.memcache.model.MemcacheServer in project platformlayer by platformlayer.
the class ITMemcacheService method testCreateAndDeleteItem.
@Test
public void testCreateAndDeleteItem() throws Exception {
String id = random.randomAlphanumericString(8);
MemcacheServer memcache = new MemcacheServer();
memcache.dnsName = id + ".test.platformlayer.org";
memcache = putItem(id, memcache);
memcache = waitForHealthy(memcache);
InetSocketAddress socketAddress = getUniqueEndpoint(memcache);
Assert.assertFalse(isPortOpen(socketAddress));
openFirewall(memcache, MemcacheServerController.MEMCACHE_PORT);
testMemcache(socketAddress);
}
use of org.platformlayer.service.memcache.model.MemcacheServer in project platformlayer by platformlayer.
the class MemcacheServerController method addChildren.
@Override
protected void addChildren() throws OpsException {
MemcacheServer model = OpsContext.get().getInstance(MemcacheServer.class);
InstanceBuilder instance = InstanceBuilder.build(model.dnsName, this, model.getTags());
// TODO: Memory _really_ needs to be configurable here!
instance.publicPorts.add(MEMCACHE_PORT);
instance.minimumMemoryMb = 1024;
instance.hostPolicy.allowRunInContainer = true;
addChild(instance);
instance.addChild(PackageDependency.build("memcached"));
MemcacheTemplateModel template = injected(MemcacheTemplateModel.class);
instance.addChild(TemplatedFile.build(template, new File("/etc/memcached.conf")));
// Collectd not restarting correctly (doesn't appear to be hostname problems??)
// instance.addChild(CollectdCollector.build());
{
PublicEndpoint endpoint = injected(PublicEndpoint.class);
// endpoint.network = null;
endpoint.publicPort = MEMCACHE_PORT;
endpoint.backendPort = MEMCACHE_PORT;
endpoint.dnsName = model.dnsName;
endpoint.tagItem = model.getKey();
endpoint.parentItem = model.getKey();
instance.addChild(endpoint);
}
instance.addChild(ManagedService.build("memcached"));
}
Aggregations