int zkPort = 2199;
final String zkAddress = "localhost:" + zkPort;
server = new ZkServer(dataDir, logDir, defaultNameSpace, zkPort);
server.start();
ClusterSetup setup = new ClusterSetup(zkAddress);
final String clusterName = "file-store-test";
setup.deleteCluster(clusterName);
setup.addCluster(clusterName, true);
setup.addInstanceToCluster(clusterName, "localhost", 12001);
setup.addInstanceToCluster(clusterName, "localhost", 12002);
setup.addInstanceToCluster(clusterName, "localhost", 12003);
setup.addResourceToCluster(clusterName, "repository", 1, "MasterSlave");
setup.reblanceResource(clusterName, "repository", 3);
// Set the configuration
final String instanceName1 = "localhost_12001";
addConfiguration(setup, baseDir, clusterName, instanceName1);
final String instanceName2 = "localhost_12002";
addConfiguration(setup, baseDir, clusterName, instanceName2);