-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cluster member fail when restore etcd data #7615
Comments
I use backup to restore etcd data 2> etcd -data-dir=/home/wwf/etcd_back/ -force-new-cluster --name infra0 --initial-advertise-peer-urls http://10.15.209.165:2480 --listen-peer-urls http://10.15.209.165:2480 --listen-client-urls http://10.15.209.165:2479,http://127.0.0.1:2479 --advertise-client-urls http://10.15.209.165:2479 --initial-cluster-token etcd-cluster-1 --initial-cluster infra0=http://10.15.209.165:2480 --initial-cluster-state new I can not found any data in this new restore etcd server, why? and this next I run 2 new etcd server on other machine, like follow: on 10.15.209.165 I try to add this new 2 etcd server as cluster members: ETCD_NAME="infra0" But add other fail: [root@10 member]# etcdctl --endpoint 10.15.209.165:2479 member add infra1 http://10.15.107.143:2379 and on 10.15.209.165 etcd servrer print log as follow: If some one can tell me how to do etcd restore,I has read: And my final question is that I has a etcd cluster which both has v2 data and v3 data ,How can I restore this cluser data? |
taking a look. |
from your command It seems to me that your wal file is in your data dir. So there is no need to specify try then start etcd with the new backup dir should work. |
@fanminshi thanks your suggust! |
I was able to reproduce the same error Setup: Steps:
the issue is that the @luweijie007 I am investigating this issue. I'll let you know my progress. |
3.1 expects a db file since restoring from backup is expected to come from an |
@heyitsanthony I was also able get around of this issue by just copying the |
@fanminshi there is already an open issue on this subject at #7002. I don't think copying the db file is safe for when doing a v2 restore because the WAL's membership data will not match the membership data in the db. |
@heyitsanthony agreed. |
@luweijie007 is the cluster only storing v3 keys? If so, that would explain why the data isn't showing up after etcdctl backup / restore. Try |
When after backing up with create an empty db file with then start etcd with the new backup dir should work; I tested that with cluster storing both v2 and v3 keys. edit: this doesn't work as intended. see #7615 (comment) below. |
@heyitsanthony @fanminshi |
@luweijie007 it's not possible to restore both v2 and v3 keys, hence the issue #7002. |
@heyitsanthony , you mean that It is not no way to restore a cluster which has keep v2 and v3 keys? |
@luweijie007 that's storing keys. Not retrieving old keys. The v3 keys are held in the db; creating an empty db file won't restore them. |
ok , I try as fanminshi instruction. and this new cluster can get v2 keys, but v3 keys just has a little. NO all v3 keys. |
@luweijie007 what is happening in this case is the backed up WAL still has some v3 proposals in it. However, there's no guarantee it will have all the v3 keys since the WAL is periodically pruned and the v3 keys are saved into the DB. It's not a reliable backup method for v3 keys. It's possible to store both v2 and v3 keys into an etcd cluster, but there's no way official way to restore both into a new cluster. |
@heyitsanthony @fanminshi |
Bug reporting
A good bug report has some very specific qualities, so please read over our short document on reporting bugs before submitting a bug report.
To ask a question, go ahead and ignore this.
The text was updated successfully, but these errors were encountered: