linux使用go连接etcd集群时报错:

# github.com/coreos/etcd/clientv3/balancer/resolver/endpoint
/root/go/pkg/mod/github.com/coreos/etcd@v3.3.27+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:87: undefined: resolver.BuildOption
/root/go/pkg/mod/github.com/coreos/etcd@v3.3.27+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:115:16: target.Authority undefined (type resolver.Target has no field or method Authority)
/root/go/pkg/mod/github.com/coreos/etcd@v3.3.27+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:118:15: target.Authority undefined (type resolver.Target has no field or method Authority)
/root/go/pkg/mod/github.com/coreos/etcd@v3.3.27+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:40: undefined: resolver.ResolveNowOption
# github.com/coreos/etcd/clientv3/balancer/picker
/root/go/pkg/mod/github.com/coreos/etcd@v3.3.27+incompatible/clientv3/balancer/picker/err.go:37:53: undefined: balancer.PickOptions
/root/go/pkg/mod/github.com/coreos/etcd@v3.3.27+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:63: undefined: balancer.PickOptions

解决方法:

修改go.mod中grpc的版本为v1.26.0

google.golang.org/grpc v1.26.0 // indirect

再执行下面的命令就可以了

go mod edit -require=google.golang.org/grpc@v1.26.0
go get -u -x google.golang.org/grpc@v1.26.0

# github.com/coreos/etcd/clientv3/balancer/resolver/endpoint的更多相关文章

  1. webserver Etcd Cluster / CoreOS etcd / macOS etcd

    s https://coreos.com/etcd/ https://coreos.com/etcd/docs/latest/ macOS mojave etcd 003deMac-mini:~ ma ...

  2. quay.io/coreos/etcd 基于Docker镜像的集群搭建

    etcd是一个高可用的键值存储系统,主要用于共享配置和服务发现.etcd是由CoreOS开发并维护的,灵感来自于 ZooKeeper 和 Doozer,它使用Go语言编写,并通过Raft一致性算法处理 ...

  3. worker 启动时向 etcd 注册自己的信息,并设置一个带 TTL 的租约,每隔一段时间更新这个 TTL,如果该 worker 挂掉了,这个 TTL 就会 expire 并删除相应的 key。

    1.通过etcd中的选主机制,我们实现了服务的高可用.同时利用systemd对etcd本身进行了保活,只要etcd服务所在的机器没有宕机,进程就具备了容灾性. https://mp.weixin.qq ...

  4. Go语言学习之12 etcd、contex、kafka消费实例、logagent

    本节内容:    1. etcd介绍与使用    2. ElastcSearch介绍与使用 1. etcd介绍与使用    概念:高可用的分布式key-value存储,可以使用配置共享和服务发现    ...

  5. 搭建日志收集系统时使用客户端连接etcd遇到的问题

    问题: 在做日志收集系统时使用到etcd,其中server端在linux上,首先安装第三方包(windows)(安装过程可能会有问题,我遇到的是连接谷歌官网请求超时,如果已经出现下面的两个文件夹并且文 ...

  6. go etcd

    etcd介绍 GitHub:https://github.com/coreos/etcd 官网:https://coreos.com/etcd/ 下载:https://github.com/coreo ...

  7. Golang etcd服务注册与发现

    //sevice.go package discovery import ( "context" "errors" "sync" " ...

  8. Go etcd初探

    1.etcd集群的配置 SET IP1_2380=http://127.0.0.1:2380 SET IP1_2379=http://127.0.0.1:2379 SET IP2_2380=http: ...

  9. [GO]go使用etcd

    package main import ( "go.etcd.io/etcd/clientv3" //笔者在使用clientv3的时间曾经使用过github.com/coreos/ ...

  10. [Golang] ETCD键值监听器

    0x0 需求 我们所有的服务启动后都以lease形式注册入ETCD,现要把这些服务监控起来. 0x1 ETCD key监听器实现 可动态增删要监听的键值对 https://github.com/bai ...

随机推荐

  1. vue-router钩子执行顺序

    Vue的路由在执行跳转时,根据源码可知,调用了router中定义的navigate函数 function push(to: RouteLocationRaw) { return pushWithRed ...

  2. JAVA学习week2

    这周:根据老师在群里面推荐的JAV学习路线,初步规划了一下学习方案 并找到了相关的视频,目前来说在学习SE.学习内容:环境变量的配置和简单的hello world程序书写的注意点 下周:打算进行简单的 ...

  3. 【Javaweb】servlet二

    servlet程序常见错误 1.url-pattern路径没有以 / 打头 2.servlet-name配置的值不存在 3.servlet-class标签的全类名配置错误 servlet-url地址如 ...

  4. Springboot的Container Images,docker加springboot

    Spring Boot应用程序可以使用Dockerfiles容器化,或者使用Cloud Native Buildpacks来创建优化的docker兼容的容器映像,您可以在任何地方运行. 1. Effi ...

  5. 吉特日化MES & HttpClient基础连接已经关闭: 连接被意外关闭

    在吉特日化MES调用某公司AGV平台下发任务的时候,使用HttpClient 进行POST请求,出现如下异常: HttpClient基础连接已经关闭: 连接被意外关闭  , 之前已经使用HTTPCli ...

  6. [gym104542F] Interesting String Problem

    Since you are a good friend of Jaber and Eyad, they are asking for your help to solve this problem. ...

  7. [ABC264G] String Fair

    Problem Statement In a string fair, they determine the beauty of a non-empty string $S$ consisting o ...

  8. 数字孪生结合GIS系统为物流行业带来的改变

    随着全球物流业务不断扩张和发展,数字化转型成为当今物流行业的主要趋势.在这个数字化时代,数字孪生技术和地理信息系统(GIS)的结合,为物流行业带来了前所未有的机遇和挑战.这种融合将为物流企业提供更高效 ...

  9. 数字孪生与GIS的结合:创新灾害预防管理的未来

    近年来,全球频发的自然灾害给人们的生命和财产安全带来了巨大威胁,灾害预防管理成为当务之急.然而,随着数字孪生技术和GIS的迅猛发展,一种全新的解决方案正在崭露头角.数字孪生与GIS的结合,为灾害预防管 ...

  10. 一文读懂Spring框架中Bean的生命周期

    我们先来聊聊bean的生命周期: bean的生命周期图: AbstractAutowireCapableBeanFactory的docreateBean()方法(简单描述):  1.可以根据源码的时候 ...