Ejemplo n.º 1
0
        public virtual void TestMoverCliWithFederationHA()
        {
            MiniDFSCluster cluster = new MiniDFSCluster.Builder(new HdfsConfiguration()).NnTopology
                                         (MiniDFSNNTopology.SimpleHAFederatedTopology(3)).NumDataNodes(0).Build();
            Configuration conf = new HdfsConfiguration();

            DFSTestUtil.SetFederatedHAConfiguration(cluster, conf);
            try
            {
                ICollection <URI> namenodes = DFSUtil.GetNsServiceRpcUris(conf);
                NUnit.Framework.Assert.AreEqual(3, namenodes.Count);
                IEnumerator <URI> iter = namenodes.GetEnumerator();
                URI nn1 = iter.Next();
                URI nn2 = iter.Next();
                URI nn3 = iter.Next();
                IDictionary <URI, IList <Path> > movePaths = Mover.Cli.GetNameNodePathsToMove(conf,
                                                                                              "-p", nn1 + "/foo", nn1 + "/bar", nn2 + "/foo/bar", nn3 + "/foobar");
                NUnit.Framework.Assert.AreEqual(3, movePaths.Count);
                CheckMovePaths(movePaths[nn1], new Path("/foo"), new Path("/bar"));
                CheckMovePaths(movePaths[nn2], new Path("/foo/bar"));
                CheckMovePaths(movePaths[nn3], new Path("/foobar"));
            }
            finally
            {
                cluster.Shutdown();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Tests manual failover back and forth between two NameNodes
        /// for federation cluster with two namespaces.
        /// </summary>
        /// <exception cref="System.Exception"/>
        public virtual void TestManualFailoverFailbackFederationHA()
        {
            Configuration  conf    = new Configuration();
            MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).NnTopology(MiniDFSNNTopology
                                                                                 .SimpleHAFederatedTopology(2)).NumDataNodes(1).Build();

            try
            {
                cluster.WaitActive();
                // test for namespace 0
                TestManualFailoverFailback(cluster, conf, 0);
                // test for namespace 1
                TestManualFailoverFailback(cluster, conf, 1);
            }
            finally
            {
                cluster.Shutdown();
            }
        }