예제 #1
0
 /// <exception cref="System.Exception"/>
 internal virtual void Start()
 {
     bkthread.Start();
     if (!LocalBookKeeper.WaitForServerUp(zkEnsemble, 10000))
     {
         throw new Exception("Error starting zookeeper/bookkeeper");
     }
     NUnit.Framework.Assert.AreEqual("Not all bookies started", numBookies, CheckBookiesUp
                                         (numBookies, 10));
 }
예제 #2
0
 public override void Run()
 {
     try
     {
         string[] args = new string[1];
         args[0] = numBookies.ToString();
         Org.Apache.Hadoop.Contrib.Bkjournal.BKJMUtil.Log.Info("Starting bk");
         LocalBookKeeper.Main(args);
     }
     catch (Exception)
     {
     }
     catch (Exception e)
     {
         // go away quietly
         Org.Apache.Hadoop.Contrib.Bkjournal.BKJMUtil.Log.Error("Error starting local bk",
                                                                e);
     }
 }
예제 #3
0
        public static void SetupZooKeeper()
        {
            Log.Info("Starting ZK server");
            zkTmpDir = FilePath.CreateTempFile("zookeeper", "test");
            zkTmpDir.Delete();
            zkTmpDir.Mkdir();
            try
            {
                zks           = new ZooKeeperServer(zkTmpDir, zkTmpDir, ZooKeeperDefaultPort);
                serverFactory = new NIOServerCnxnFactory();
                serverFactory.Configure(new IPEndPoint(ZooKeeperDefaultPort), 10);
                serverFactory.Startup(zks);
            }
            catch (Exception e)
            {
                Log.Error("Exception while instantiating ZooKeeper", e);
            }
            bool b = LocalBookKeeper.WaitForServerUp(Hostport, ConnectionTimeout);

            Log.Debug("ZooKeeper server up: " + b);
        }