From b61f2082cc5693a7a188cd5e54001121a249c52d Mon Sep 17 00:00:00 2001 From: Dorota Wojcik Date: Mon, 2 Dec 2024 17:01:31 +0100 Subject: [PATCH] cli instructions for crdr ops --- .../crdr/crdr-failover-to-recovery.md | 27 +++++++++++-- .../postgresql/crdr/crdr-revert-to-primary.md | 38 +++++++++++++++++-- docs/products/postgresql/crdr/enable-crdr.md | 38 +++++++++++++++++-- 3 files changed, 93 insertions(+), 10 deletions(-) diff --git a/docs/products/postgresql/crdr/crdr-failover-to-recovery.md b/docs/products/postgresql/crdr/crdr-failover-to-recovery.md index 213fd8c2..35f9d44f 100644 --- a/docs/products/postgresql/crdr/crdr-failover-to-recovery.md +++ b/docs/products/postgresql/crdr/crdr-failover-to-recovery.md @@ -5,7 +5,9 @@ limited: true keywords: [recovery, primary, outage, failure, failover, CRDR, cross-region disaster recovery] --- -import ConsoleLabel from "@site/src/components/ConsoleIcons" +import ConsoleLabel from "@site/src/components/ConsoleIcons"; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; At the event of a region outage, [failover](/docs/products/postgresql/crdr/crdr-overview#failover-to-the-recovery-region) @@ -15,7 +17,8 @@ infrastructure, you can also perform a manual failover. ## Prerequisites - [CRDR setup](/docs/products/postgresql/crdr/enable-crdr) up and running -- Access to the [Aiven Console](https://console.aiven.io/) +- Access to the [Aiven Console](https://console.aiven.io/) or + the [Aiven CLI client installed](/docs/tools/cli) ## Automatic failover @@ -26,7 +29,10 @@ region outage. ## Fail over manually Initiate a [manual failover](/docs/products/postgresql/crdr/crdr-overview#manual-switchover) -in the the [Aiven Console](https://console.aiven.io/): +using a tool of your choice: + + + 1. Log in to the the [Aiven Console](https://console.aiven.io/), and go to your primary Aiven for PostgreSQL service. @@ -38,6 +44,21 @@ When the failover process is completed, your primary service is **Failed**, and recovery service is **Active**, which means the recovery service is in control over your workloads now. + + + +Run [avn byoc update](/docs/tools/cli/service-cli#avn-cli-service-update): + +```bash +avn service update PRIMARY_SERVICE_NAME \ + --disaster-recovery-role failed +``` + +Replace `PRIMARY_SERVICE_NAME` with the name of the primary service, for example, `pg-demo`. + + + + ## Related pages [Aiven for PostgreSQL® CRDR revert to the primary region](/docs/products/postgresql/crdr/crdr-revert-to-primary) diff --git a/docs/products/postgresql/crdr/crdr-revert-to-primary.md b/docs/products/postgresql/crdr/crdr-revert-to-primary.md index 7fbfd4c2..21396171 100644 --- a/docs/products/postgresql/crdr/crdr-revert-to-primary.md +++ b/docs/products/postgresql/crdr/crdr-revert-to-primary.md @@ -5,20 +5,26 @@ limited: true keywords: [recovery, primary, outage, failure, failover, CRDR, cross-region disaster recovery] --- -import ConsoleLabel from "@site/src/components/ConsoleIcons" +import ConsoleLabel from "@site/src/components/ConsoleIcons"; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; Shift your workloads back to the primary region, where your service was hosted originally before failing over to the recovery region. Restore your CRDR setup. ## Prerequisites - [CRDR failover](/docs/products/postgresql/crdr/crdr-failover-to-recovery) completed -- Access to the [Aiven Console](https://console.aiven.io/) +- Access to the [Aiven Console](https://console.aiven.io/) or + the [Aiven CLI client installed](/docs/tools/cli) ## Revert to the primary region Initiate a [revert process](/docs/products/postgresql/crdr/crdr-overview#revert-to-the-primary-region) -in the the [Aiven Console](https://console.aiven.io/): +using a tool of your choice: + + + 1. Log in to the the [Aiven Console](https://console.aiven.io/), and go to your primary Aiven for PostgreSQL service. @@ -41,6 +47,32 @@ in the the [Aiven Console](https://console.aiven.io/): 1. Click **Done**. + + + +1. Restore the primary service by running + [avn byoc update](/docs/tools/cli/service-cli#avn-cli-service-update): + + ```bash + avn service update PRIMARY_SERVICE_NAME \ + --disaster-recovery-role passive + ``` + + Replace `PRIMARY_SERVICE_NAME` with the name of the primary service, for example, `pg-demo`. + +1. Promote the primary service as active by running + [avn byoc update](/docs/tools/cli/service-cli#avn-cli-service-update): + + ```bash + avn service update PRIMARY_SERVICE_NAME \ + --disaster-recovery-role active + ``` + + Replace `PRIMARY_SERVICE_NAME` with the name of the primary service, for example, `pg-demo`. + + + + ## Related pages [Aiven for PostgreSQL® CRDR failover to the recovery region](/docs/products/postgresql/crdr/crdr-failover-to-recovery) diff --git a/docs/products/postgresql/crdr/enable-crdr.md b/docs/products/postgresql/crdr/enable-crdr.md index 19ac882d..1476e5c7 100644 --- a/docs/products/postgresql/crdr/enable-crdr.md +++ b/docs/products/postgresql/crdr/enable-crdr.md @@ -5,7 +5,9 @@ limited: true keywords: [recovery, primary, outage, failure, failover] --- -import ConsoleLabel from "@site/src/components/ConsoleIcons" +import ConsoleLabel from "@site/src/components/ConsoleIcons"; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; Enable the [cross-region disaster recovery (CRDR)](/docs/products/postgresql/crdr/crdr-overview) feature in in Aiven for PostgreSQL® by creating a recovery service, which takes over from a primary service in case of region outage. @@ -20,13 +22,16 @@ Enable the [cross-region disaster recovery (CRDR)](/docs/products/postgresql/crd plan. ::: -- Access to the [Aiven Console](https://console.aiven.io/) +- Access to the [Aiven Console](https://console.aiven.io/) or + the [Aiven CLI client installed](/docs/tools/cli) ## Set up a recovery service -Create a [CRDR setup](/docs/products/postgresql/crdr/crdr-overview#crdr-setup) in the the -[Aiven Console](https://console.aiven.io/): +Create a [CRDR setup](/docs/products/postgresql/crdr/crdr-overview#crdr-setup) using +a tool of your choice: + + 1. Log in to the the [Aiven Console](https://console.aiven.io/), and go to your primary Aiven for PostgreSQL service. 1. Click in the sidebar. @@ -39,6 +44,31 @@ Througout the process of creating the recovery service, the recovery service is **Rebuilding** state. As soon as the recovery service is ready, its status changes to **Passive**, which means your CRDR setup is up and running. + + + +Run [avn byoc create](/docs/tools/cli/service-cli#avn-cli-service-create): + +```bash +avn service create RECOVERY_SERVICE_NAME \ + --service-type pg \ + --plan SERVICE_PLAN \ + --cloud CLOUD_REGION \ + --disaster-recovery-copy-for PRIMARY_SERVICE_NAME +``` + +Replace the following: + +- `RECOVERY_SERVICE_NAME` with the name of the recovery service, for example, + `pg-demo-recovery` +- `SERVICE_PLAN` with the plan to use for the recovery service, for example, `startup-4` +- `CLOUD_REGION` with the cloud region where to host the recovery service, for example, + `google-europe-west-4` +- `PRIMARY_SERVICE_NAME` with the name of the primary service, for example, `pg-demo` + + + + ## Related pages - [Aiven for PostgreSQL® CRDR failover to the recovery region](/docs/products/postgresql/crdr/crdr-failover-to-recovery)