# Rancher 2.0 backup

**URL:** https://forums.suse.com/t/rancher-2-0-backup/10332
**Category:** Rancher 2.0 Tech Preview
**Created:** [May 8, 2018, 11:45am UTC](https://forums.suse.com/t/rancher-2-0-backup/10332 "2018-05-08T11:45:16Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![evertonpaiva](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/evertonpaiva/32/1636_2.png) [@evertonpaiva](https://forums.suse.com/u/evertonpaiva)
#### Post date: [May 8, 2018, 11:45am UTC](https://forums.suse.com/t/rancher-2-0-backup/10332/1 "2018-05-08T11:45:16Z")

</div>

- Where can I find the best practices for backup in Rancher 2.0?
- Is there a mysql database like Rancher 1.6?
- Should I create persistent volumes for the kubernetes cluster?

Is there a documentation for this? Sorry if it’s a silly question.

We made a HA Server Install - 3 nodes.

---

<div class="post-metadata">

### Author: ![amioranza](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/amioranza/32/3053_2.png) [@amioranza](https://forums.suse.com/u/amioranza)
#### Post date: [May 8, 2018, 9:27pm UTC](https://forums.suse.com/t/rancher-2-0-backup/10332/2 "2018-05-08T21:27:35Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![thklein](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/thklein/32/4095_2.png) [@thklein](https://forums.suse.com/u/thklein)
#### Post date: [May 14, 2018, 7:07am UTC](https://forums.suse.com/t/rancher-2-0-backup/10332/3 "2018-05-14T07:07:50Z")

</div>

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](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.

---

<div class="post-metadata">

### Author: ![evertonpaiva](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/evertonpaiva/32/1636_2.png) [@evertonpaiva](https://forums.suse.com/u/evertonpaiva)
#### Post date: [May 14, 2018, 10:49am UTC](https://forums.suse.com/t/rancher-2-0-backup/10332/4 "2018-05-14T10:49:51Z")

</div>

@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.

---

<div class="post-metadata">

### Author: ![penevigor](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@penevigor](https://forums.suse.com/u/penevigor)
#### Post date: [May 14, 2018, 10:52am UTC](https://forums.suse.com/t/rancher-2-0-backup/10332/5 "2018-05-14T10:52:41Z")

</div>

We have this After Installation page that should help us in configuring backup, but I just can’t figure it out [https://rancher.com/docs/rancher/v2.x/en/installation/after-installation/etcd-backup-and-restoration/](https://rancher.com/docs/rancher/v2.x/en/installation/after-installation/etcd-backup-and-restoration/)

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.

---

<div class="post-metadata">

### Author: ![evertonpaiva](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/evertonpaiva/32/1636_2.png) [@evertonpaiva](https://forums.suse.com/u/evertonpaiva)
#### Post date: [May 14, 2018, 11:08am UTC](https://forums.suse.com/t/rancher-2-0-backup/10332/6 "2018-05-14T11:08:51Z")

</div>

@penevigor I think this page “Etcd Backup And Restoration” is new. I’ll take a look in it. Thank you.

---

<div class="post-metadata">

### Author: ![evertonpaiva](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/evertonpaiva/32/1636_2.png) [@evertonpaiva](https://forums.suse.com/u/evertonpaiva)
#### Post date: [May 14, 2018, 11:47am UTC](https://forums.suse.com/t/rancher-2-0-backup/10332/7 "2018-05-14T11:47:35Z")

</div>

I did RKE update and followed this instructions: [https://github.com/rancher/rke#etcd-backup-and-restoration](https://github.com/rancher/rke#etcd-backup-and-restoration)

---

<div class="post-metadata">

### Author: ![evertonpaiva](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/evertonpaiva/32/1636_2.png) [@evertonpaiva](https://forums.suse.com/u/evertonpaiva)
#### Post date: [May 14, 2018, 12:17pm UTC](https://forums.suse.com/t/rancher-2-0-backup/10332/8 "2018-05-14T12:17:13Z")

</div>

Maybe you need specify the config file name. For example:  
$rke\_linux-amd64 etcd backup --config 3-node-certificate.yml

---

<div class="post-metadata">

### Author: ![penevigor](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@penevigor](https://forums.suse.com/u/penevigor)
#### Post date: [May 14, 2018, 2:31pm UTC](https://forums.suse.com/t/rancher-2-0-backup/10332/9 "2018-05-14T14:31:02Z")

</div>

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:

> <https://github.com/penevigor/rancher/blob/master/cluster.yml_EXAMPLE>

---

<div class="post-metadata">

### Author: ![romanvg](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/romanvg/32/3759_2.png) [@romanvg](https://forums.suse.com/u/romanvg)
#### Post date: [July 10, 2018, 10:19am UTC](https://forums.suse.com/t/rancher-2-0-backup/10332/10 "2018-07-10T10:19:56Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![edmilsonjnior](https://avatars.discourse-cdn.com/v4/letter/e/b9bd4f/32.png) [@edmilsonjnior](https://forums.suse.com/u/edmilsonjnior)
#### Post date: [November 9, 2018, 2:33pm UTC](https://forums.suse.com/t/rancher-2-0-backup/10332/11 "2018-11-09T14:33:38Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)
#### Post date: [November 12, 2018, 6:06pm UTC](https://forums.suse.com/t/rancher-2-0-backup/10332/12 "2018-11-12T18:06:50Z")

</div>

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).

So you need to back up both.

---

<div class="post-metadata">

### Author: ![edmilsonjnior](https://avatars.discourse-cdn.com/v4/letter/e/b9bd4f/32.png) [@edmilsonjnior](https://forums.suse.com/u/edmilsonjnior)
#### Post date: [November 12, 2018, 6:28pm UTC](https://forums.suse.com/t/rancher-2-0-backup/10332/13 "2018-11-12T18:28:41Z")

</div>

Thanks for the reply.  
I will work on it.

---

<div class="post-metadata">

### Author: ![Sarma\_K](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@Sarma\_K](https://forums.suse.com/u/Sarma_K)
#### Post date: [December 17, 2018, 12:20pm UTC](https://forums.suse.com/t/rancher-2-0-backup/10332/14 "2018-12-17T12:20:41Z")

</div>

@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.

Thanks,  
Sarma K
