zeromicro / go-zero

A cloud-native Go microservices framework with cli tool for productivity.
https://go-zero.dev
MIT License
29.01k stars 3.93k forks source link

panic: etcdclient: old cluster version #4170

Open hdytime opened 4 months ago

hdytime commented 4 months ago

image image image

My etcd version is very new but I still can't successfully start this demo. I have been troubled for two days. Does anyone know how to solve this?

Owen-Zhang commented 3 months ago

看了 etcd client源码,这个错误是etcd server那边返回的

if maj < 3 || (maj == 3 && min < 2) {
   rerr = ErrOldCluster
}
// 如果主版本 < 3 或者 版本 < 3.2 才会报这个错误 (那个版本号在api项目中写死的)

你用etcd --version 估计应该也差不多,

  1. 你看一下你的etcd服务端是不是使用了v2版本, 2 看一个etcd client是不是老了,更新一点看看,反正就是服务端返回了版本信息,客户端做了一些验证

看一下server端的yaml文件, 同时升级etcd client,(我用 o.etcd.io/etcd/client/pkg/v3 v3.5.13, 都是正常的 )

Issues-translate-bot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


After looking at etcd client source, this error is returned by etcd server.

if maj < 3 || (maj == 3 && min < 2) {
rerr = ErrOldCluster
}
// This error will only be reported if the main version < 3 or version < 3.2 (that version number is hard-coded in the api project)

It should be similar if you use etcd --version.

  1. Check to see if your etcd server uses version v2. 2 Check if an etcd client is old, update it and see if it is

I personally feel that the problem is more likely to be caused by the server. Can you take a look at the configuration of etcd.yaml?