From 377ac36ca3380b21231602306a419f185ceec4db Mon Sep 17 00:00:00 2001 From: Mark Bishop Date: Sat, 25 Aug 2018 21:41:29 -0700 Subject: [PATCH] draft for single node install upgrade rollback backup redo --- .../backups/single-node-backups/_index.md | 16 +++++++++++---- .../single-node-restoration/_index.md | 16 ++++++++++++--- .../rollbacks/single-node-rollbacks/_index.md | 20 +++++++++++++------ .../upgrades/single-node-upgrade/_index.md | 17 ++++++++++++++-- 4 files changed, 54 insertions(+), 15 deletions(-) diff --git a/content/rancher/v2.x/en/backups/backups/single-node-backups/_index.md b/content/rancher/v2.x/en/backups/backups/single-node-backups/_index.md index 9392e349970..23e80edef6a 100644 --- a/content/rancher/v2.x/en/backups/backups/single-node-backups/_index.md +++ b/content/rancher/v2.x/en/backups/backups/single-node-backups/_index.md @@ -10,14 +10,22 @@ After completing your single node installation of Rancher, we recommend creating ## Before You Start -During backup creation, you'll enter a series of commands, filling placeholders with data from your environment. These placeholders are denoted with angled brackets (``). Cross reference the image and reference table below to learn how to obtain this placeholder data. Write down or copy this information before starting the [procedure below](#creating-a-backup). +During creation of your backup, you'll enter a series of commands, filling placeholders with data from your environment. These placeholders are denoted with angled brackets and all capital letters (``). Here's an example of a command with a placeholder: -Terminal `docker ps` Command and Rancher UI +``` +docker run --volumes-from rancher-data- -v $PWD:/backup alpine tar zcvf /backup/rancher-data-backup-.tar.gz /var/lib/rancher +``` + +In this command, `` is a placeholder for the version of Rancher running in your environment. `v2.0.5` for example. + +Cross reference the image and reference table below to learn how to obtain this placeholder data. Write down or copy this information before starting the [procedure below](#creating-a-backup). + +Terminal `docker ps` Command and Rancher UI, Displaying Where to Find Placeholders ![Placeholder Reference]({{< baseurl >}}/img/rancher/placeholder-ref.png) | Legend | Placeholder | Example | Description | | ------ | -------------------------- | -------------------------- | ----------------- | -| A | `` | `v2.0.5` | The rancher/rancher image you pulled for install.| +| A | `` | `v2.0.5` | The rancher/rancher image you pulled for initial install.| | B | `` | `festive_mestorf` | The name of your Rancher container.| | C | `` | `v2.0.5` | The version of Rancher run in your container. |
@@ -37,7 +45,7 @@ This procedure creates a backup that you can restore to in case Rancher encounte 1. Stop the container currently running Rancher Server. Replace `` with the [name of your Rancher container](#before-you-start). ``` - docker stop + docker stop x ``` 1. Use the command below, replacing each [placeholder](#before-you-start), to create a data container from the Rancher container that you just stopped. diff --git a/content/rancher/v2.x/en/backups/restorations/single-node-restoration/_index.md b/content/rancher/v2.x/en/backups/restorations/single-node-restoration/_index.md index bc6d8c34867..c408330625f 100644 --- a/content/rancher/v2.x/en/backups/restorations/single-node-restoration/_index.md +++ b/content/rancher/v2.x/en/backups/restorations/single-node-restoration/_index.md @@ -10,9 +10,19 @@ If you encounter a disaster scenario, you can restore your Rancher Server to you ## Before You Start -During backup restoration, you'll enter a series of commands, filling placeholders with data from your environment. These placeholders are denoted with angled brackets (``). Cross reference the image and reference table below to learn how to obtain this placeholder data. Write down or copy this information before starting the [procedure below](#restoring-backups). +During restoration of your backup, you'll enter a series of commands, filling placeholders with data from your environment. These placeholders are denoted with angled brackets and all capital letters (``). Here's an example of a command with a placeholder: -Terminal `docker ps` Command and Rancher UI +``` +docker run --volumes-from -v $PWD:/backup +alpine sh -c "rm /var/lib/rancher/* -rf && +tar zxvf /backup/rancher-data-backup-" +``` + +In this command, `` and `` are environment variables for your Rancher deployment. + +Cross reference the image and reference table below to learn how to obtain this placeholder data. Write down or copy this information before starting the [procedure below](#restoring-backups). + +Terminal `docker ps` Command and Rancher UI, Displaying Where to Find Placeholders ![Placeholder Reference]({{< baseurl >}}/img/rancher/placeholder-ref.png) | Legend | Placeholder | Example | Description | @@ -51,7 +61,7 @@ Using a backup that you created earlier, restore Rancher to its last known healt ``` docker run --volumes-from -v $PWD:/backup alpine sh -c "rm /var/lib/rancher/* -rf && - tar zxvf /backup/rancher-data-backup-" + tar zxvf /backup/rancher-data-backup-.tar.gz" ``` **Step Result:** A series of commands should run. diff --git a/content/rancher/v2.x/en/upgrades/rollbacks/single-node-rollbacks/_index.md b/content/rancher/v2.x/en/upgrades/rollbacks/single-node-rollbacks/_index.md index afe819a2a61..5ed40add764 100644 --- a/content/rancher/v2.x/en/upgrades/rollbacks/single-node-rollbacks/_index.md +++ b/content/rancher/v2.x/en/upgrades/rollbacks/single-node-rollbacks/_index.md @@ -6,18 +6,26 @@ aliases: - /rancher/v2.x/en/upgrades/single-node-rollbacks --- -Rolling back an unsuccessful Rancher upgrade requires you to restore the backup you created while completing [Single Node Upgrade]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrade-scenarios/single-node-upgrade/). +If a Rancher upgrade does not complete successfully, you'll have to roll back to the backup you created during [Single Node Upgrade]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrade-scenarios/single-node-upgrade/). This rollback restores both your previous version of Rancher and your data. ## Before You Start -During backup creation, you'll enter a series of commands, filling placeholders with data from your environment. These placeholders are denoted with angled brackets (``). Cross reference the image and reference table below to learn how to obtain this placeholder data. Write down or copy this information before starting the [procedure below](#creating-a-backup). +During rollback to a prior version of Rancher, you'll enter a series of commands, filling placeholders with data from your environment. These placeholders are denoted with angled brackets and all capital letters (``). Here's an example of a command with a placeholder: -Terminal `docker ps` Command and Rancher UI +``` +docker pull rancher/rancher: +``` + +In this command, `` is the version of Rancher you were running before your unsuccessful upgrade. `v2.0.5` for example. + +Cross reference the image and reference table below to learn how to obtain this placeholder data. Write down or copy this information before starting the [procedure below](#creating-a-backup). + +Terminal `docker ps` Command and Rancher UI, Displaying Where to Find Placeholders ![Placeholder Reference]({{< baseurl >}}/img/rancher/placeholder-ref.png) | Legend | Placeholder | Example | Description | | ------ | -------------------------- | -------------------------- | ----------------- | -| A | `` | `v2.0.5` | The rancher/rancher image you pulled for install.| +| A | `` | `v2.0.5` | The rancher/rancher image you used before upgrade.| | B | `` | `festive_mestorf` | The name of your Rancher container.| | C | `` | `v2.0.5` | The version of Rancher run in your container. |
@@ -51,14 +59,14 @@ If you have issues upgrading Rancher, roll it back to its laster known healthy s 1. Make sure you're in your home directory (`cd ~`). Enter `dir` to make sure the tarball you created during [Step 4](({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrades/single-node-upgrade/#tarball)) while following [Single Node Upgrade]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrades/single-node-upgrade/) is available. - It will have a name similar to (`rancher-data-backup-`). + It will have a name similar to (`rancher-data-backup-.tar.gz`). 1. Run the following command to create a data container from the backup tarball, replacing the [placeholder](#before-you-start) Don't forget to close the quotes. ``` docker run --volumes-from rancher-data -v $PWD:/backup alpine sh -c "rm /var/lib/rancher/* -rf - && tar zxvf /backup/rancher-data-backup-" + && tar zxvf /backup/rancher-data-backup-.tar.gz" ``` 1. Start a new Rancher Server container with the `` tag [placeholder](#before-you-start) pointing to the data container. diff --git a/content/rancher/v2.x/en/upgrades/upgrades/single-node-upgrade/_index.md b/content/rancher/v2.x/en/upgrades/upgrades/single-node-upgrade/_index.md index 0b530fbf432..fe118d5d207 100644 --- a/content/rancher/v2.x/en/upgrades/upgrades/single-node-upgrade/_index.md +++ b/content/rancher/v2.x/en/upgrades/upgrades/single-node-upgrade/_index.md @@ -8,9 +8,18 @@ To upgrade Rancher Server 2.x when a new version is released, create a data back ## Before You Start -During upgrade, you'll enter a series of commands, filling placeholders with data from your environment. These placeholders are denoted with angled brackets (``). Cross reference the image and reference table below to learn how to obtain this placeholder data. Write down or copy this information before starting the [procedure below](#completing-the-upgrade). +During upgrade, you'll enter a series of commands, filling placeholders with data from your environment. These placeholders are denoted with angled brackets and all capital letters (``). Here's an example of a command with a placeholder: -Terminal `docker ps` Command and Rancher UI + +``` +docker run --volumes-from rancher-data -v $PWD:/backup alpine tar zcvf /backup/rancher-data-backup-.tar.gz /var/lib/rancher +``` + +In this command, `` is the version of Rancher running in your Rancher deployment before upgrade. + +Cross reference the image and reference table below to learn how to obtain this placeholder data. Write down or copy this information before starting the [procedure below](#completing-the-upgrade). + +<Terminal `docker ps` Command and Rancher UI, Displaying Where to Find Placeholders ![Placeholder Reference]({{< baseurl >}}/img/rancher/placeholder-ref.png) | Legend | Placeholder | Example | Description | @@ -26,6 +35,8 @@ During upgrade, you'll enter a series of commands, filling placeholders with dat ## Completing the Upgrade +During upgrade, you create a copy of the data from your current Rancher container and a backup in case something goes wrong. Then you deploy the new version of Rancher in a new container using your existing data. + 1. Using a remote Terminal connection, log into your Rancher Server. @@ -50,6 +61,8 @@ During upgrade, you'll enter a series of commands, filling placeholders with dat docker run --volumes-from rancher-data -v $PWD:/backup alpine tar zcvf /backup/rancher-data-backup-.tar.gz /var/lib/rancher ``` + When you enter this command, a series of commands should run. + 1. Enter the `dir` command to confirm that the backup tarball was created. It will have a name similar to `rancher-data-backup-`. ![Backup Backup Tarball]({{< baseurl >}}/img/rancher/dir-backup-tarball.png)