linux 安装etcd版本3.5.0

1,安装golang环境,参考连接https://blog.csdn.net/h394600493/article/details/120431561?spm=1001.2014.3001.5502https://blog.csdn.net/h394600493/article/details/120431561?spm=1001.2014.3001.5502

2,下载etcd 3.5.0版本 

git clone https://github.com/etcd-io/etcd.git -b v3.5.0
cd etcd

3,编译etcd

# 在etcd目录执行
make 
make install
cp ./bin/* /usr/local/bin/ -fr

执行过程中遇到问题

1,go: go.etcd.io/etcd/client/v2@v2.305.0 requires
        github.com/json-iterator/go@v1.1.11: Get "https://proxy.golang.org/github.com/json-iterator/go/@v/v1.1.11.mod": dial tcp 172.217.160.81:443: i/o timeout

解决方法:   

# 执行命令,换一个国内能访问的代理地址:https://goproxy.cn
go env -w GOPROXY=https://goproxy.cn

2, must be run from 'go.etcd.io/etcd/v3' module directory

在etcd目录编辑go.mod文件,加入了replace google.golang.org/grpc => google.golang.org/grpc v1.26.0,如下图,之后执行命令go mod tidy,在接着第3步编译etcd

vi go.mod
module go.etcd.io/etcd/v3

go 1.16

replace (
        go.etcd.io/etcd/api/v3 => ./api
        go.etcd.io/etcd/client/pkg/v3 => ./client/pkg
        go.etcd.io/etcd/client/v2 => ./client/v2
        go.etcd.io/etcd/client/v3 => ./client/v3
        go.etcd.io/etcd/etcdctl/v3 => ./etcdctl
        go.etcd.io/etcd/etcdutl/v3 => ./etcdutl
        go.etcd.io/etcd/pkg/v3 => ./pkg
        go.etcd.io/etcd/raft/v3 => ./raft
        go.etcd.io/etcd/server/v3 => ./server
        go.etcd.io/etcd/tests/v3 => ./tests
)

replace google.golang.org/grpc => google.golang.org/grpc v1.26.0

require (
        github.com/bgentry/speakeasy v0.1.0
        github.com/dustin/go-humanize v1.0.0
        github.com/spf13/cobra v1.1.3
        go.etcd.io/bbolt v1.3.6
        go.etcd.io/etcd/api/v3 v3.5.0
        go.etcd.io/etcd/client/pkg/v3 v3.5.0
        go.etcd.io/etcd/client/v2 v2.305.0
        go.etcd.io/etcd/client/v3 v3.5.0
        go.etcd.io/etcd/etcdctl/v3 v3.5.0
        go.etcd.io/etcd/etcdutl/v3 v3.5.0
        go.etcd.io/etcd/pkg/v3 v3.5.0
        go.etcd.io/etcd/raft/v3 v3.5.0
        go.etcd.io/etcd/server/v3 v3.5.0
        go.etcd.io/etcd/tests/v3 v3.5.0
        go.uber.org/zap v1.17.0
        golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
        google.golang.org/grpc v1.38.0
        gopkg.in/cheggaaa/pb.v1 v1.0.28
)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值