use of org.apache.hadoop.registry.server.services.MicroZookeeperService in project hadoop by apache.
the class AbstractZKRegistryTest method createZKServer.
@BeforeClass
public static void createZKServer() throws Exception {
File zkDir = new File("target/zookeeper");
FileUtils.deleteDirectory(zkDir);
assertTrue(zkDir.mkdirs());
zookeeper = new MicroZookeeperService("InMemoryZKService");
YarnConfiguration conf = new YarnConfiguration();
conf.set(MicroZookeeperServiceKeys.KEY_ZKSERVICE_DIR, zkDir.getAbsolutePath());
zookeeper.init(conf);
zookeeper.start();
addToTeardown(zookeeper);
}
use of org.apache.hadoop.registry.server.services.MicroZookeeperService in project hadoop by apache.
the class AbstractSecureRegistryTest method createSecureZKInstance.
/**
* Create a secure instance
* @param name instance name
* @return the instance
* @throws Exception
*/
protected static MicroZookeeperService createSecureZKInstance(String name) throws Exception {
String context = ZOOKEEPER_SERVER_CONTEXT;
Configuration conf = new Configuration();
File testdir = new File(System.getProperty("test.dir", "target"));
File workDir = new File(testdir, name);
if (!workDir.mkdirs()) {
assertTrue(workDir.isDirectory());
}
System.setProperty(ZookeeperConfigOptions.PROP_ZK_SERVER_MAINTAIN_CONNECTION_DESPITE_SASL_FAILURE, "false");
RegistrySecurity.validateContext(context);
conf.set(MicroZookeeperServiceKeys.KEY_REGISTRY_ZKSERVICE_JAAS_CONTEXT, context);
MicroZookeeperService secureZK = new MicroZookeeperService(name);
secureZK.init(conf);
LOG.info(secureZK.getDiagnostics());
return secureZK;
}
use of org.apache.hadoop.registry.server.services.MicroZookeeperService in project hadoop by apache.
the class TestMicroZookeeperService method testTempDirSupport.
@Test
public void testTempDirSupport() throws Throwable {
YarnConfiguration conf = new YarnConfiguration();
zookeeper = new MicroZookeeperService("t1");
zookeeper.init(conf);
zookeeper.start();
zookeeper.stop();
}
Aggregations