コード例 #1
0
        public virtual void TestZookeeperCanWrite()
        {
            Runtime.SetProperty("curator-log-events", "true");
            StartSecureZK();
            CuratorService curator = null;
            LoginContext   login   = Login(ZookeeperLocalhost, ZookeeperClientContext, keytab_zk);

            try
            {
                LogLoginDetails(Zookeeper, login);
                RegistrySecurity.SetZKSaslClientProperties(Zookeeper, ZookeeperClientContext);
                curator = StartCuratorServiceInstance("ZK", true);
                Log.Info(curator.ToString());
                AddToTeardown(curator);
                curator.ZkMkPath("/", CreateMode.Persistent, false, RegistrySecurity.WorldReadWriteACL
                                 );
                curator.ZkList("/");
                curator.ZkMkPath("/zookeeper", CreateMode.Persistent, false, RegistrySecurity.WorldReadWriteACL
                                 );
            }
            finally
            {
                Logout(login);
                ServiceOperations.Stop(curator);
            }
        }
コード例 #2
0
        public virtual void TestInsecureClientToZK()
        {
            StartSecureZK();
            UserZookeeperToCreateRoot();
            RegistrySecurity.ClearZKSaslClientProperties();
            CuratorService curatorService = StartCuratorServiceInstance("insecure client", false
                                                                        );

            curatorService.ZkList("/");
            curatorService.ZkMkPath(string.Empty, CreateMode.Persistent, false, RegistrySecurity
                                    .WorldReadWriteACL);
        }
コード例 #3
0
 /// <exception cref="System.IO.IOException"/>
 private void MkPath(string path, CreateMode mode)
 {
     curatorService.ZkMkPath(path, mode, false, RegistrySecurity.WorldReadWriteACL);
 }