go-zero
go-zero copied to clipboard
How to specify rpc endpoints in API services?
API服务和RPC服务都是多节点, 使用etcd做节点发现, RPC服务使用grpc的双向流, API服务如何连接指定的RPC节点
Endpoints in yaml.
Endpoints in yaml.
感谢回复, 我想在API服运行起来之后, 根据参数动态的去连接RPC服, 目前只知道RPC的名字, 但不知道有几个RPC节点, 是不是需要自己来监听etcd呢? 还是说zero有接口可以获得当前有几个rpc节点?
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Endpoints in yaml.
Thanks for the reply, I want to dynamically connect to the RPC server according to the parameters after the API server is running. At present, I only know the name of the RPC, but I don't know how many RPC nodes there are. Do I need to monitor etcd by myself? The interface can get how many rpc nodes there are currently?
Etcd in yaml.
Go-zero has implemented ETCD's automatic service discovery capability, you can check https://github.com/zeromicro/zero-examples/blob/main/rpc/client/lb/main.go#L30
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.