diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-04-05 10:05:44 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-04-05 10:08:31 +0200 |
commit | a122a8cb464e78e1b5f2454aef91f12d647b1b6c (patch) | |
tree | 331f09b969d2b7727a48e275ab58f3c02c6168cf /doc/book/cookbook | |
parent | 9fd8ec1dee367c773d51cdc035879ea43abb1cbf (diff) | |
download | garage-a122a8cb464e78e1b5f2454aef91f12d647b1b6c.tar.gz garage-a122a8cb464e78e1b5f2454aef91f12d647b1b6c.zip |
Add an "upgrading" section, add a guide for 0.7
Diffstat (limited to 'doc/book/cookbook')
-rw-r--r-- | doc/book/cookbook/upgrading.md | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/doc/book/cookbook/upgrading.md b/doc/book/cookbook/upgrading.md new file mode 100644 index 00000000..41e8b294 --- /dev/null +++ b/doc/book/cookbook/upgrading.md @@ -0,0 +1,56 @@ ++++ +title = "Upgrading Garage" +weight = 40 ++++ + +Garage is a stateful clustered application, where all nodes are communicating together and share data structures. +It makes upgrade more difficult than stateless applications so you must be more careful when upgrading. +On a new version release, there is 2 possibilities: + - protocols and data structures remained the same ➡️ this is a **straightforward upgrade** + - protocols or data structures changed ➡️ this is an **advanced upgrade** + +You can quickly now what type of update you will have to operate by looking at the version identifier. +Following the [SemVer ](https://semver.org/) terminology, if only the *patch* number changed, it will only need a straightforward upgrade. +Example: an upgrade from v0.6.0 from v0.6.1 is a straightforward upgrade. +If the *minor* or *major* number changed however, you will have to do an advanced upgrade. Example: from v0.6.1 to v0.7.0. + +Migrations are tested only from one stable version to another one, if you want to minimize your risks, you must ideally upgrade only to the direct next stable version, including patch ones. +Example: to go from v0.6.0 to v0.7.0, upgrade from v0.6.0 to v0.6.1 and then from v0.6.1 to v0.7.0. + +Migrating from a minor version to another one without installing patch ones could work but are not tested, you must do your own tests in advance. +Example: going from v0.6.0 directly to v0.7.0 should work but is untested. Never, never, skip a minor or a major version. +Example: going from v0.6.0 directly to v0.8.0 is forbidden. +If you are very late in your upgrades, you should consider spawning a new cluster with the latest version and operate application level migrations +from the old cluster to the new one. + +## Straightforward upgrades + +Straightforward upgrades do not imply cluster downtime. +Before upgrading, you should still read [the changelog](https://git.deuxfleurs.fr/Deuxfleurs/garage/releases) and ideally test your deployment on a staging cluster before. + +When you are ready, start by checking the health of your cluster. +You can force some checks with `garage repair`, we recommend at least running `garage repair --all-nodes --yes` that is very quick to run (less than a minute). +You will see that the command correctly terminated in the logs of your daemon. + +Finally, you can simply upgrades nodes one by one. +For each node: stop it, install the new binary, edit the configuration if needed, restart it. + +## Advanced upgrades + +Advanced upgrades will imply cluster downtime. +Before upgrading, you must read [the changelog](https://git.deuxfleurs.fr/Deuxfleurs/garage/releases) and you must test your deployment on a staging cluster before. + +From a high level perspective, an advanced upgrade looks like this: + 1. Make sure the health of your cluster is good (see `garage repair`) + 2. Disable API access (comment the configuration in your reverse proxy) + 3. Check that your cluster is idle + 4. Stop the whole cluster + 5. Backup the metadata folder of all your nodes, so that you will be able to restore it quickly if the upgrade fails (blocks being immutable, they should not be impacted) + 6. Install the new binary, update the configuration + 7. Start the whole cluster + 8. If needed, run the corresponding migration from `garage migrate` + 9. Make sure the health of your cluster is good + 10. Enable API access (uncomment the configuration in your reverse proxy) + 11. Monitor your cluster while load comes back, check that all your applications are happy with this new version + +We write guides for each advanced upgrade, they are stored under the "Working Documents" section of this documentation. |