/// <summary>
        /// 注册服务
        /// </summary>
        /// <param name="client">客户端</param>
        /// <param name="systemName">系统名称(默认:Agent)</param>
        /// <param name="registration">注册信息</param>
        /// <returns></returns>
        public static async Task <bool> RegisterAsync(this EtcdClient client, AgentServiceRegistration registration, string systemName = "Agent")
        {
            try
            {
                // /系统/Services/srvname/srvid
                ServiceEntry entry = new ServiceEntry()
                {
                    Host    = registration.Address,
                    Port    = registration.Port,
                    Name    = registration.Name,
                    Id      = registration.ID,
                    Tags    = registration.Tags,
                    Version = registration.Version
                };
                if (registration.Checks == null || registration.Checks.Length == 0)
                {
                    registration.Checks             = new AgentServiceCheck[1];
                    registration.Checks[0]          = new AgentServiceCheck();
                    registration.Checks[0].Interval = new TimeSpan(0, 0, 5);
                }
                var               val   = JsonConvert.SerializeObject(entry);
                string            key   = "/" + systemName + "/Services/" + entry.Name + "/" + entry.Id;
                CancellationToken token = new CancellationToken();

                if (!string.IsNullOrEmpty(Utiletcd.Sinlgeton.Password) || !string.IsNullOrEmpty(Utiletcd.Sinlgeton.Username))
                {
                    await client.AuthenticateAsync(new AuthenticateRequest()
                    {
                        Name     = Utiletcd.Sinlgeton.Username,
                        Password = Utiletcd.Sinlgeton.Password
                    });
                }

                //申请TTL的ID
                var lease = await client.LeaseGrantAsync(new LeaseGrantRequest()
                {
                    ID = 0, TTL = (long)registration.Checks[0].Interval.TotalSeconds
                });

                //加入节点
                var rsp = await client.PutAsync(new PutRequest()
                {
                    Key = key.ToGoogleString(), Value = val.ToGoogleString(), Lease = lease.ID
                });

                //保持激活
                await client.LeaseKeepAlive(new LeaseKeepAliveRequest()
                {
                    ID = lease.ID
                }, Watch, token);

                //添加配置
                await AddConfigAsync(client, systemName, registration);

                //服务加入更新列表
                await Utiletcd.Sinlgeton.AddKeepAliveAsync(client, key, (long)registration.Checks[0].Interval.TotalSeconds, lease.ID);

                Init(client, key);
                return(true);
            }catch (Exception ex)
            {
                return(false);
            }
        }