zeromicro / go-zero

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

etcd in the gateway configuration cannot inherit the defined #3925

Open eyjian opened 7 months ago

eyjian commented 7 months ago

Do not configure Hosts in Upstreams:

Etcd:
  Hosts:
    - 127.0.0.1:2379

Login: # Login service client conf
  Prefix: /v1
  Etcd:
    Key: mooonlogin.rpc

Auth: # Authentication service client conf
  Prefix: /v2
  Etcd:
    Key: mooonauth.rpc

Upstreams: # upstreams
  - Grpc:
      Etcd:
        #Hosts:
        #  - 127.0.0.1:2379
        Key: mooonlogin.rpc

Error when running:

config file etc/gateway.yaml, type mismatch for field "Upstreams[0].Grpc.etcd.Hosts"
Guvanchhojamov commented 4 months ago

Hi @eyjian, Why you comment this part:

# Hosts:
   #  - 127.0.0.1:2379

Have you tried without comments? And you can see gateway docs: https://github.com/zeromicro/go-zero/blob/master/gateway/readme.md