You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
client.balancer=newHealthBalancer(cfg.Endpoints, cfg.DialTimeout, func(epstring) (bool, error) {
returngrpcHealthCheck(client, ep)
})
// use Endpoints[0] so that for https:// without any tls config given, then// grpc will assume the certificate server name is the endpoint host.conn, err:=client.dial(cfg.Endpoints[0], grpc.WithBalancer(client.balancer))
iferr!=nil {
client.cancel()
client.balancer.Close()
returnnil, err
}
client.conn=conn
client.balancer=newHealthBalancer(cfg.Endpoints, cfg.DialTimeout, func(epstring) (bool, error) {
returngrpcHealthCheck(client, ep)
})
// use Endpoints[0] so that for https:// without any tls config given, then// grpc will assume the certificate server name is the endpoint host.conn, err:=client.dial(cfg.Endpoints[0], grpc.WithBalancer(client.balancer))
iferr!=nil {
client.cancel()
client.balancer.Close()
returnnil, err
}
client.conn=conn
clientv3.New(config)
源码etcd客户端源码只对于
endpoints[0]
,也就是第一个配置的节点进行连接,如果连接失败就直接返回异常了,这个是不是需要在gaea层面在获取etcd连接的时候进行额外判断,依次获取配置的每个节点的连接,直到获得可用连接为止呢?The text was updated successfully, but these errors were encountered: