Beispiel #1
0
        public static string registerCRMAPIHostPort(string zooKeeperURL, string ip = "")
        {
            if (string.IsNullOrWhiteSpace(ip))
            {
                ip = IPUtil.GetLocalIP();
            }
            if (string.IsNullOrWhiteSpace(ip))
            {
                ip = IPUtil.GetLocalIPDebug();
            }
            Register zk = new Register(zooKeeperURL);

            return(zk.createAsync($"/{NodeName.CRM}", ip, NodeName.CRMPort, new CRMAPIWatcher(zooKeeperURL)).Result);
        }
Beispiel #2
0
        public static string registerAuthAPIHostPort(string zooKeeperURL, string ip = "")
        {
            if (string.IsNullOrWhiteSpace(ip))
            {
                ip = IPUtil.GetLocalIP();
            }
            if (string.IsNullOrWhiteSpace(ip))
            {
                ip = IPUtil.GetLocalIPDebug();
            }
            Register zk = getRegister(zooKeeperURL);

            return(zk.createAsync($"/{NodeName.AuthAdmin}", ip, NodeName.AuthAdminPort, getWatcher(zooKeeperURL)).Result); //getWatcher(zooKeeperURL)
        }
Beispiel #3
0
        public static string registerTokenAuthHostPort(string zooKeeperURL, string ip = "")
        {
            if (string.IsNullOrWhiteSpace(ip))
            {
                ip = IPUtil.GetLocalIP();
            }
            if (string.IsNullOrWhiteSpace(ip))
            {
                ip = IPUtil.GetLocalIPDebug();
            }
            Register zk  = getRegister(zooKeeperURL);
            string   res = zk.createAsync($"/{NodeName.TokenAuth}", ip, NodeName.TokenAuthPort, getWatcher(zooKeeperURL)).Result;//getWatcher(zooKeeperURL)

            return(res);
        }