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
I would like to use grpclb load balancing in my go client. I have a custom loadbalancer implementing grpclb protocol, and everything works for Java clients (it is easy to enable it by simple option -Dio.grpc.internal.DnsNameResolverProvider.enable_grpclb=true, and then I can create a channel with .forTarget("hello.mimgrpc.me")).
How to enable it in go client? By default, if I will use my domain with proper SRV records as my endpoint, I get something like this:
INFO: 2019/06/05 20:20:14 parsed scheme: ""
INFO: 2019/06/05 20:20:14 scheme "" not registered, fallback to default scheme
INFO: 2019/06/05 20:20:14 ccResolverWrapper: sending update to cc: {[{hello.mimgrpc.me 0 }] }
INFO: 2019/06/05 20:20:14 ClientConn switching balancer to "pick_first"
WARNING: 2019/06/05 20:20:14 grpc: addrConn.createTransport failed to connect to {offers-api.core.creativecdn.net 0 }. Err :connection error: desc = "transport: Error while dialing dial tcp: address hello.mimgrpc.me: missing port in address". Reconnecting...
INFO: 2019/06/05 20:20:14 pickfirstBalancer: HandleSubConnStateChange: 0xc000150010, CONNECTING
INFO: 2019/06/05 20:20:14 pickfirstBalancer: HandleSubConnStateChange: 0xc000150010, TRANSIENT_FAILURE
I tried to add a grpc.DialOption: grpc.WithBalancerName(roundrobin.Name) or grpc.WithBalancerName("grpclb"), but I get either compilation (undefined: grpclb) or runtime (panic: grpc.WithBalancerName: no balancer is registered for name grpclb) errors.
I also tried to import "google.golang.org/grpc/balancer/grpclb", but it doesn't help.
It has to be something very simple, but I can't make it work - could you help?
The text was updated successfully, but these errors were encountered:
Sorry for the delay. Yes, it helped, consider adding this information to documentation about grpclb or somewhere else, to make this easier to find.
I've got another problem while trying to run this; I will write about it, because it might be helpful for someone. Because I am running my Go application as a Docker container, I have to add --dns 8.8.8.8 flag to ther docker run command. Without it, I got:
grpc: failed dns SRV record lookup due to lookup hello.mimgrpc.me on 127.0.0.53:53: cannot unmarshal DNS message.
I would like to use grpclb load balancing in my go client. I have a custom loadbalancer implementing grpclb protocol, and everything works for Java clients (it is easy to enable it by simple option -Dio.grpc.internal.DnsNameResolverProvider.enable_grpclb=true, and then I can create a channel with .forTarget("hello.mimgrpc.me")).
How to enable it in go client? By default, if I will use my domain with proper SRV records as my endpoint, I get something like this:
I tried to add a grpc.DialOption: grpc.WithBalancerName(roundrobin.Name) or grpc.WithBalancerName("grpclb"), but I get either compilation (undefined: grpclb) or runtime (panic: grpc.WithBalancerName: no balancer is registered for name grpclb) errors.
I also tried to import "google.golang.org/grpc/balancer/grpclb", but it doesn't help.
It has to be something very simple, but I can't make it work - could you help?
The text was updated successfully, but these errors were encountered: