zeromicro / go-zero

A cloud-native Go microservices framework with cli tool for productivity.
https://go-zero.dev
MIT License
29.31k stars 3.96k forks source link

how to set etcd username and password in gateway #3818

Open yunduansing opened 10 months ago

yunduansing commented 10 months ago

I use the gateway feature of go-zero to implement the mapping from HTTP to gRPC, and use etcd as the RPC service discovery. However, when I set the username and password for etcd, the etcd client reports: "etcdserver: permission denied".

go code: gc.Upstreams[i].Grpc.Etcd.Hosts = config.Conf.EtcdAddress gc.Upstreams[i].Grpc.Etcd.User = config.Conf.EtcdUser gc.Upstreams[i].Grpc.Etcd.Pass = config.Conf.EtcdSecret

xxx.yaml

Upstreams:

kevwan commented 10 months ago

Verify you're setting correct username/password.