The version 2.0 uses ETCD to persist cluster data, it is a Kubernetes cluster, I think backing up the ETCD is enough to get it working again, but I don’t know how to do that.
If you did an HA installation (= deploying Rancher Server into an existing Kubernetes cluster), that would mean, that you have created at least 3 etcd-nodes in Kubernetes.
This is where Rancher 2.x stores its configuration automatically.
Due to triple replication of the etcd database, a backup shouldn’t be necessary, but anyways, you could probably find some clues in here: https://coreos.com/etcd/docs/latest/op-guide/recovery.html
In a “normal” Rancher setup, it uses an internal etcd and stores it into /var/lib/rancher which could be backed up simply by bind-mounting it as a volume and then copying it to somewhere else.
@amioranza@thklein Thank you! I’ll do the bind-mounting for /var/lib/rancher. After reading “etcd-backup-and-restoration” I’m not sure is it’s necessary.
If anyone that is more experienced can explain it would be great.
I tried with snapshot option, but i get fatal error:
FATA[0000] Failed to resolve cluster file: Can not find cluster configuration file: open $PWD/cluster.yml: no such file
For the automatic backup I don’t know if I should create different file that will run etcd-backup container, because it’s not running on the 3 nodes that I have. If yes what is the command to enable that container.
Actually it looks for a cluster.yml file that I’ve found in the same directory from where I executed the installation. I am not sure if it was auto created by the installation process or I created it later when I tried different stuff. The snapshot backup is now working, but I still think the procedure can be more beginner friendly
P.S. You can check example of the cluster file on the following link, hope it helps:
I’ve got another question…
We did install rancher2 on a DRBD-backed VM outside of kubernetes. Am i correct that the rancher-etcd has no connection to the cluster-etcd? Meaning i should backup the kubernetes-etcd in a separate way?
I have the same question.
Anyone knows if this etcd for rancher is enough to backup all the data from clusters? For example, I have one installation of Rancher 2.0.x that connects to one cluster for staging. This cluster have three etcds, three controls and some workers. What i have to backup?
The management server itself contains stuff like access control config, the list of clusters, projects, users and who should have access to them, etc.
Individual clusters are self-contained and have the definitions of workloads/services/volumes/etc running in that cluster. (it is not “all in the server DB”, like in 1.x. Conversely, if you have clusters that are running fine and lose the server, the workloads and their definitions are still there).
@vincent, could you please help me out on folders that need to be backed up on the additional clusters that are created?
I have 3 nodes that play “All” role and few worker nodes. Do I have to back up the etcd folders on the three “All” nodes? or something else.