private void Deploy(bool startInstances)
        {
            ZooKeeperDeployer.DeployInstances(Instances);

            if (startInstances)
            {
                Start();
            }
        }
        public void Dispose()
        {
            if (isDisposed.TrySetTrue())
            {
                Stop();

                log.Info("Cleaning directories...");

                ZooKeeperDeployer.CleanupInstances(Instances);

                log.Info("Cleaned directories successfully.");
            }
        }
        private void Deploy(bool startInstances)
        {
            try
            {
                ZooKeeperDeployer.DeployInstances(Instances);

                if (startInstances)
                {
                    Start();
                }
            }
            catch (Exception error)
            {
                log.Error(error, "Error in starting. Will try to stop.");
                Dispose();
                throw;
            }
        }