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. 聊聊分布式 SQL 数据库Doris(八)

    稀疏索引 密集索引:文件中的每个搜索码值都对应一个索引值,就是叶子节点保存了整行. 稀疏索引:文件只为索引码的某些值建立索引项. 稀疏索引的创建过程包括将集合中的元素分段,并给每个分段中的最小元素创建 ...

  2. C#中的并行处理、并行查询的方法你用对了吗?

    Parallel.ForEach Parallel.ForEach 是一个用于在集合上并行执行迭代操作的强大工具.它通过有效地利用多核处理器的能力来提高性能.Parallel.ForEach 不仅能够 ...

  3. 基于 Webpack5 Module Federation 的业务解耦实践

    我们是袋鼠云数栈 UED 团队,致力于打造优秀的一站式数据中台产品.我们始终保持工匠精神,探索前端道路,为社区积累并传播经验价值. 本文作者:贝儿 前言 本文中会提到很多目前数栈中使用的特定名词,统一 ...

  4. SpringBoot整合Swagger3

    1.导入相关依赖 <!--swagger--> <dependency> <groupId>io.springfox</groupId> <art ...

  5. 2023"安洵杯"第六届网络安全挑战赛-Misc WP

    dacongのsecret 题目 我的解答: 题目给出一张png图片和一个加密压缩包,压缩包里面还存在另一张jpg图片 看名字就知道是盲水印.由于压缩包里的图片提不出来,因此是单图盲水印,我们使用工具 ...

  6. Python笔记一之excel的读取

    本文首发于公众号:Hunter后端 原文链接:Python笔记一之excel的读取 这里我常用的 python 对于 excel 的读取库有两个,一个是 xlsxwriter 用于操作 excel 的 ...

  7. JDK1.8下载 用阿里云盘

    JDK1.8下载 用阿里云盘 jdk-8u202-windows-x64.exe https://www.aliyundrive.com/s/jJhWUk17jMt 点击链接保存,或者复制本段内容,打 ...

  8. React 类组件转换为函数式

    函数式的 React 组件更加现代,并支持有用的 hooks,现在流行把旧式的类组件转换为函数式组件.这篇文章总结了转换的一些通用的步骤和陷阱. 通用替换 定义 从 class (\w+) exten ...

  9. Mysql索引失效的几种原因-mysql-suo-yin-shi-xiao-de-ji-zhong-yuan-yin

    title: Mysql索引失效的几种原因 date: 2021-07-15 17:13:59.019 updated: 2021-12-26 17:43:12.489 url: https://ww ...

  10. 【JMM内存模型-4】JMM内存模型之CPU缓存策略-jmmcpu4

    title: [JMM内存模型-4]JMM内存模型之CPU缓存策略 date: 2021-11-17 13:27:48.139 updated: 2021-12-26 17:43:10.442 url ...