无法在 rpcx 正常适用上 etcd
最近在学rpc,下了rpcx这个框架,mac环境
然后又在github下了etcd,然后用go build生成二进制运行
已经用curl验证过etcd正在运行,测试过put、get命令正常。
curl http://127.0.0.1:2379/version #得到输出 {"etcdserver":"3.5.0-pre","etcdcluster":"3.5.0"}%
但是用rpcx连接etcd时候报错,说不是有效的etcd集群节点。我试过换成错误端口或者没开etcd服务提示请求拒绝的,所以是连接上,但就是报错了。
etcd.go:66: ERROR: cannot create etcd path /rpcx_test: client: response is invalid json. The endpoint is probably not valid etcd cluster endpoint client: response is invalid json. The endpoint is probably not valid etcd cluster endpoint
rpcx所用的代码是官方示例:
网上找到的相似的只是没有把监听地址加进去,不适用于当前情况。
请赐教。
etcd的版本是3.5的,那demo也使用版本3的
https://github.com/rpcx-ecosystem/rpcx-exa...
差别在于第34行代码
r := &serverplugin.EtcdV3RegisterPlugin{