/// <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)); }
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); } }
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); }