// Start cluster with a single NN and DN
Configuration conf = new Configuration();
MiniDFSCluster cluster = null;
try {
MiniDFSNNTopology topology = new MiniDFSNNTopology()
.addNameservice(new NSConf("ns1").addNN(
new NNConf(null).setIpcPort(nnPort1)))
.setFederation(true);
cluster = new MiniDFSCluster.Builder(conf)
.nnTopology(topology)
.build();