| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| } | ||
|
|
||
| public RpcClient createClient() { | ||
| return new RpcClient(new Endpoint( |
There was a problem hiding this comment.
这个client感觉应该保存在Peer里,两个client名称上区分下,分别是用于raft内部通信client、提供给application去写入的client。
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
当客户端向集群发起写入请求时,会根据 brpc 的负载均衡策略选取一个节点进行写入,如果被选中的节点不是 Leader 节点,而是从节点,就会报 com.baidu.brpc.exceptions.RpcException: serviceInterface must not be set repeatedly, please use another RpcClient 异常,原因是此时从节点需要向 Leader 发起操作,但是拿到的 rpcClient 已经绑定其它服务接口。