mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-09-24 20:18:18 +00:00
completing draft
This commit is contained in:
committed by
Denise Schannon
parent
805596d063
commit
48ff75a99d
@@ -8,41 +8,44 @@ aliases:
|
||||
|
||||
After completing your single node installation of Rancher, we recommend creating backups of it on a regular basis. Use these backups as a restoration point in a disaster scenario.
|
||||
|
||||
<a id="prereq"></a>
|
||||
## 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 (`<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).
|
||||
|
||||
<sup>Terminal `docker ps` Command and Rancher UI</sup>
|
||||

|
||||
|
||||
| Legend | Placeholder | Example | Description |
|
||||
| ------ | -------------------------- | -------------------------- | ----------------- |
|
||||
| A | `<RANCHER_CONTAINER_TAG>` | `v2.0.5` | The rancher/rancher image you pulled for install.|
|
||||
| B | `<RANCHER_CONTAINER_NAME>` | `festive_mestorf` | The name of your Rancher container.|
|
||||
| C | `<RANCHER_VERSION>` | `v2.0.5` | The version of Rancher run in your container. |
|
||||
<br/>
|
||||
|
||||
- Obtain `<RANCHER_CONTAINER_TAG>` and `<RANCHER_CONTAINER_NAME>` by logging into your Rancher Server by remote connection and entering `docker ps`.
|
||||
|
||||
- Obtain `<RANCHER_VERSION>` by logging into Rancher and viewing the bottom left of the browser window.
|
||||
|
||||
|
||||
## Creating a Backup
|
||||
|
||||
This procedure creates a backup that you can restore to in case Rancher encounters a disaster scenario.
|
||||
|
||||
>**Prerequisite:** Open Rancher and write down the version number displayed in the lower-left of the browser (example: `v2.0.5`). You'll need this number during the backup process.
|
||||
>
|
||||
>
|
||||
|
||||
1. Using a remote Terminal connection, log into your Rancher Server.
|
||||
|
||||
1. Stop the container currently running Rancher Server. Replace `<RANCHER_CONTAINER_NAME>` with the name of your Rancher container.
|
||||
1. Stop the container currently running Rancher Server. Replace `<RANCHER_CONTAINER_NAME>` with the [name of your Rancher container](#before-you-start).
|
||||
|
||||
```
|
||||
docker stop <RANCHER_CONTAINER_NAME>
|
||||
```
|
||||
<a id="placeholders"></a>You can obtain the name for your Rancher container by entering `docker ps`.
|
||||

|
||||
|
||||
1. <a id="backup"></a>Using the command below, create a data container from the Rancher container you just stopped.
|
||||
1. <a id="backup"></a>Use the command below, replacing each [placeholder](#before-you-start), to create a data container from the Rancher container that you just stopped.
|
||||
|
||||
```
|
||||
docker create --volumes-from <RANCHER_CONTAINER_NAME> --name rancher-data-<RANCHER_VERSION> rancher/rancher:<RANCHER_CONTAINER_TAG>
|
||||
```
|
||||
|
||||
Replace each of the command placeholders using help from the table below.
|
||||
|
||||
<a id="ref-table"></a>
|
||||
|
||||
Placeholder | Example | Description
|
||||
---------|----------|---------
|
||||
`<RANCHER_CONTAINER_NAME>` | `festive_mestorf` | The name of your [Rancher container](#placeholders).
|
||||
`<RANCHER_VERSION>` | `v2.0.5` | The [version](#prereq) of Rancher run in your container.
|
||||
`<RANCHER_CONTAINER_TAG>` | `v2.0.5` | The [rancher/rancher image](#placeholders) you pulled for install.
|
||||
<br/>
|
||||

|
||||
|
||||
1. <a id="tarball"></a>From the data container that you just created (`rancher-data-<RANCHER_VERSION>`), create a backup tarball (`rancher-data-backup-<RANCHER_VERSION>.tar.gz`). Use the following command, replacing each [placeholder](#ref-table).
|
||||
1. <a id="tarball"></a>From the data container that you just created (`rancher-data-<RANCHER_VERSION>`), create a backup tarball (`rancher-data-backup-<RANCHER_VERSION>.tar.gz`). Use the following command, replacing each [placeholder](#before-you-start).
|
||||
|
||||
```
|
||||
docker run --volumes-from rancher-data-<RANCHER_VERSION> -v $PWD:/backup alpine tar zcvf /backup/rancher-data-backup-<RANCHER_VERSION>.tar.gz /var/lib/rancher
|
||||
@@ -54,7 +57,7 @@ After completing your single node installation of Rancher, we recommend creating
|
||||
|
||||

|
||||
|
||||
1. Restart Rancher Server. Replace `<RANCHER_CONTAINER_NAME>` with the name of your [Rancher container](#placeholders).
|
||||
1. Restart Rancher Server. Replace `<RANCHER_CONTAINER_NAME>` with the name of your [Rancher container](#before-you-start).
|
||||
|
||||
```
|
||||
docker start <RANCHER_CONTAINER_NAME>
|
||||
|
||||
@@ -8,21 +8,45 @@ aliases:
|
||||
|
||||
If you encounter a disaster scenario, you can restore your Rancher Server to your most recent backup.
|
||||
|
||||
## 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 (`<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](#restoring-backups).
|
||||
|
||||
<sup>Terminal `docker ps` Command and Rancher UI</sup>
|
||||

|
||||
|
||||
| Legend | Placeholder | Example | Description |
|
||||
| ------ | -------------------------- | -------------------------- | ----------------- |
|
||||
| A | `<RANCHER_CONTAINER_TAG>` | `v2.0.5` | The rancher/rancher image you pulled for install.|
|
||||
| B | `<RANCHER_CONTAINER_NAME>` | `festive_mestorf` | The name of your Rancher container.|
|
||||
| C | `<RANCHER_VERSION>` | `v2.0.5` | The version of Rancher run in your container. |
|
||||
<br/>
|
||||
|
||||
- Obtain `<RANCHER_CONTAINER_TAG>` and `<RANCHER_CONTAINER_NAME>` by logging into your Rancher Server by remote connection and entering `docker ps`.
|
||||
|
||||
- Obtain `<RANCHER_VERSION>` by logging into Rancher and viewing the bottom left of the browser window.
|
||||
|
||||
## Restoring Backups
|
||||
|
||||
Using a backup that you created earlier, restore Rancher to its last known healthy state.
|
||||
|
||||
1. Using a remote Terminal connection, log into your Rancher Server.
|
||||
|
||||
1. Stop the container currently running Rancher Server. Replace `<RANCHER_CONTAINER_NAME>` with the name of your Rancher container.
|
||||
1. Stop the container currently running Rancher Server. Replace `<RANCHER_CONTAINER_NAME>` with the [name of your Rancher container](#before-you-start).
|
||||
|
||||
```
|
||||
docker stop <RANCHER_CONTAINER_NAME>
|
||||
```
|
||||
You can obtain the name for your Rancher container by entering `docker ps`.
|
||||

|
||||
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/backups/backups/single-node-backups/#tarball) while following [Creating Backups—Single Node Installs]({{< baseurl >}}/rancher/v2.x/en/backups/backups/single-node-backups/) is available.
|
||||
|
||||
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/backups/backups/single-node-backups/#tarball)) while following [Creating Backups—Single Node Installs]({{< baseurl >}}/rancher/v2.x/en/backups/backups/single-node-backups/) is available.
|
||||
It will have a name similar to `rancher-data-backup-<RANCHER_VERSION>`.
|
||||
|
||||
It will have a name similar to (`rancher-data-backup-<RANCHER_VERSION>`).
|
||||

|
||||
|
||||
1. Enter the following command to delete your current state data and start your backup data. Don't forget to close the quotes.
|
||||
|
||||
1. Enter the following command to delete your current state data and start your backup data, replacing the [placeholders](#before-you-start). Don't forget to close the quotes.
|
||||
|
||||
>**Warning!** This command deletes all current state data from your Rancher Server container. Any changes saved after your backup tarball was created will be lost.
|
||||
|
||||
```
|
||||
docker run --volumes-from <RANCHER_CONTAINER_NAME> -v $PWD:/backup
|
||||
@@ -30,9 +54,9 @@ If you encounter a disaster scenario, you can restore your Rancher Server to you
|
||||
tar zxvf /backup/rancher-data-backup-<RANCHER_VERSION>"
|
||||
```
|
||||
|
||||
>**Warning!** This command deletes all current state data from your Rancher Server container. Any changes saved after your backup tarball was created will be lost.
|
||||
**Step Result:** A series of commands should run.
|
||||
|
||||
1. Restart your Rancher Server container. It will restart using your backup data.
|
||||
1. Restart your Rancher Server container, replacing the [placeholder](#before-you-start). It will restart using your backup data.
|
||||
|
||||
```
|
||||
docker start <RANCHER_CONTAINER_NAME>
|
||||
|
||||
@@ -6,18 +6,42 @@ 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/).
|
||||
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/).
|
||||
|
||||
## 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 (`<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).
|
||||
|
||||
<sup>Terminal `docker ps` Command and Rancher UI</sup>
|
||||

|
||||
|
||||
| Legend | Placeholder | Example | Description |
|
||||
| ------ | -------------------------- | -------------------------- | ----------------- |
|
||||
| A | `<PRIOR_RANCHER_VERSION>` | `v2.0.5` | The rancher/rancher image you pulled for install.|
|
||||
| B | `<RANCHER_CONTAINER_NAME>` | `festive_mestorf` | The name of your Rancher container.|
|
||||
| C | `<RANCHER_VERSION>` | `v2.0.5` | The version of Rancher run in your container. |
|
||||
<br/>
|
||||
|
||||
- Obtain `<PRIOR_RANCHER_VERSION>` and `<RANCHER_CONTAINER_NAME>` by logging into your Rancher Server by remote connection and entering `docker ps`.
|
||||
|
||||
- Obtain `<RANCHER_VERSION>` by logging into Rancher and viewing the bottom left of the browser window.
|
||||
|
||||
## Rolling Back Rancher
|
||||
|
||||
If you have issues upgrading Rancher, roll it back to its laster known healthy state by pulling the last version you used and then restoring the backup you made before upgrade.
|
||||
|
||||
>**Warning!** Rolling back to a previous version of Rancher destroys any changes made to Rancher following the upgrade. Unrecoverable data loss may occur.
|
||||
|
||||
1. Pull the version of Rancher that you were running prior to upgrade (which was the version that you wrote down for the [prereq]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrades/single-node-upgrade/#prereq).
|
||||
1. Using a remote Terminal connection, log into your Rancher Server.
|
||||
|
||||
1. Pull the version of Rancher that you were running prior to upgrade. Replace the `<PRIOR_RANCHER_VERSION>` with [that version](#before-you-start).
|
||||
|
||||
For example, if you were running Rancher v2.0.5 before upgrade, pull v2.0.5.
|
||||
|
||||
```
|
||||
docker pull rancher/rancher:<PRIOR_RANCHER_VERSION>
|
||||
```
|
||||
For example, if you were running Rancher v2.0.5 before upgrade, pull v2.0.5.
|
||||
|
||||
|
||||
1. Stop the container currently running Rancher Server. Replace `<RANCHER_CONTAINER_NAME>` with the name of your Rancher container.
|
||||
|
||||
```
|
||||
@@ -29,15 +53,15 @@ restore the backup you created while completing [Single Node Upgrade]({{< baseur
|
||||
|
||||
It will have a name similar to (`rancher-data-backup-<RANCHER_VERSION>`).
|
||||
|
||||
1. Run the following command to create a data container from the backup tarball. Don't forget to close the quotes.
|
||||
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-<RANCHER_VERSION>"
|
||||
```
|
||||
```
|
||||
|
||||
1. Start a new Rancher Server container with the `<PRIOR_RANCHER_VERSION>` tag pointing to the data container.
|
||||
1. Start a new Rancher Server container with the `<PRIOR_RANCHER_VERSION>` tag [placeholder](#before-you-start) pointing to the data container.
|
||||
```
|
||||
docker run -d --volumes-from rancher-data
|
||||
--restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher:<PRIOR_RANCHER_VERSION>
|
||||
|
||||
@@ -6,40 +6,53 @@ aliases:
|
||||
---
|
||||
To upgrade Rancher Server 2.x when a new version is released, create a data backup for your current Rancher deployment, pull the latest image of Rancher, and then start a new Rancher container using your data backup.
|
||||
|
||||
<a id="prereq"></a>
|
||||
## Before You Start
|
||||
|
||||
>**Prerequisite:** Open Rancher and write down the version number displayed in the lower-left of the browser (example: `v2.0.5`). You'll need this number during the backup process.
|
||||
>
|
||||
>
|
||||
During upgrade, you'll enter a series of commands, filling placeholders with data from your environment. These placeholders are denoted with angled brackets (`<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](#completing-the-upgrade).
|
||||
|
||||
<sup>Terminal `docker ps` Command and Rancher UI</sup>
|
||||

|
||||
|
||||
| Legend | Placeholder | Example | Description |
|
||||
| ------ | -------------------------- | -------------------------- | ----------------- |
|
||||
| A | `<RANCHER_CONTAINER_TAG>` | `v2.0.5` | The rancher/rancher image you pulled for install.|
|
||||
| B | `<RANCHER_CONTAINER_NAME>` | `festive_mestorf` | The name of your Rancher container.|
|
||||
| C | `<RANCHER_VERSION>` | `v2.0.5` | The version of Rancher run in your container. |
|
||||
<br/>
|
||||
|
||||
- Obtain `<RANCHER_CONTAINER_TAG>` and `<RANCHER_CONTAINER_NAME>` by logging into your Rancher Server by remote connection and entering `docker ps`.
|
||||
|
||||
- Obtain `<RANCHER_VERSION>` by logging into Rancher and viewing the bottom left of the browser window.
|
||||
|
||||
## Completing the Upgrade
|
||||
|
||||
1. Using a remote Terminal connection, log into your Rancher Server.
|
||||
|
||||
1. Stop the container currently running Rancher Server. Replace `<RANCHER_CONTAINER_NAME>` with the name of your Rancher container.
|
||||
|
||||
1. Stop the container currently running Rancher Server. Replace `<RANCHER_CONTAINER_NAME>` with the [name of your Rancher container](#before-you-start).
|
||||
|
||||
```
|
||||
docker stop <RANCHER_CONTAINER_NAME>
|
||||
```
|
||||
You can obtain the name for your Rancher container by entering `docker ps`.
|
||||

|
||||
|
||||
1. <a id="backup"></a>Using the command below, create a data container from the Rancher container you just stopped.
|
||||
1. <a id="backup"></a>Use the command below, replacing each [placeholder](#before-you-start), to create a data container from the Rancher container that you just stopped.
|
||||
|
||||
- Replace `<RANCHER_CONTAINER_NAME>` with the name from the previous step (our example uses `festive_mestorf`).
|
||||
- Replace `<RANCHER_CONTAINER_TAG>` with tag of your Rancher image (`v2.0.5` in our example).
|
||||
|
||||
```
|
||||
```
|
||||
docker create --volumes-from <RANCHER_CONTAINER_NAME> --name rancher-data rancher/rancher:<RANCHER_CONTAINER_TAG>
|
||||
```
|
||||
|
||||
1. <a id="tarball"></a>From the data container that you just created (`rancher-data`), create an upgrade tarball (`rancher-data-backup-<RANCHER_VERSION>.tar.gz`).
|
||||
|
||||
This tarball will serve as a rollback point if something goes wrong during upgrade.
|
||||
This tarball will serve as a rollback point if something goes wrong during upgrade. Use the following command, replacing each [placeholder](#before-you-start).
|
||||
|
||||
|
||||
```
|
||||
docker run --volumes-from rancher-data -v $PWD:/backup alpine tar zcvf /backup/rancher-data-backup-<RANCHER_VERSION>.tar.gz /var/lib/rancher
|
||||
```
|
||||
|
||||
1. Enter the `dir` command to confirm that the backup tarball was created.
|
||||
1. Enter the `dir` command to confirm that the backup tarball was created. It will have a name similar to `rancher-data-backup-<RANCHER_VERSION>`.
|
||||
|
||||

|
||||
|
||||
1. Pull the most recent image of Rancher.
|
||||
|
||||
@@ -77,6 +90,8 @@ To upgrade Rancher Server 2.x when a new version is released, create a data back
|
||||
|
||||
1. Log into Rancher. Confirm that the upgrade succeeded by checking the version displayed in the bottom-left corner of the browser window.
|
||||
|
||||
<!--/img/rancher/)-->
|
||||
|
||||
1. Remove the previous Rancher Server container.
|
||||
|
||||
If you only stop the previous Rancher Server container (and don't remove it), the container may restart after the next server reboot.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 215 KiB |
Reference in New Issue
Block a user