From ebfe8eeb60634dd8a799ac0819412f59d9c38087 Mon Sep 17 00:00:00 2001 From: Harshini Rangaswamy Date: Tue, 4 Jun 2024 17:20:36 +0200 Subject: [PATCH] update: content updated with Console and CLI instructions --- .../caching/concepts/caching-read-replica.md | 48 +++++ docs/products/caching/concepts/redis-ccr.md | 51 ----- .../howto/create-caching-read-replica.md | 182 ++++++++++++++++++ .../caching/howto/enable-redis-ccr.md | 129 ------------- sidebars.ts | 20 +- 5 files changed, 240 insertions(+), 190 deletions(-) create mode 100644 docs/products/caching/concepts/caching-read-replica.md delete mode 100644 docs/products/caching/concepts/redis-ccr.md create mode 100644 docs/products/caching/howto/create-caching-read-replica.md delete mode 100644 docs/products/caching/howto/enable-redis-ccr.md diff --git a/docs/products/caching/concepts/caching-read-replica.md b/docs/products/caching/concepts/caching-read-replica.md new file mode 100644 index 00000000..0f77fb0d --- /dev/null +++ b/docs/products/caching/concepts/caching-read-replica.md @@ -0,0 +1,48 @@ +--- +title: Aiven for Caching read replica +sidebar_label: Caching read replica +pro: true +--- + +Aiven for Caching read replica replicates data from a primary to a replica cluster across different DNS, clouds, or regions, improving data availability and supporting disaster recovery. + +## Features and benefits + +- **High availability:** By replicating data across clusters in different locations, + Aiven for Caching read replica ensures that your application remains available even if one + cluster goes down. +- **Disaster recovery:** Automatic promotion of the follower cluster to leader status in + case of the primary/main cluster's failure provides a robust disaster + recovery mechanism. +- **Geographical distribution:** With support for all clouds and regions, Aiven for Caching + read replica reduces latency by keeping data closer to your users. + +## How read replica works + +Aiven for Caching uses an **active-passive replication model** for its read replica +cluster, ensuring high availability and data resilience across deployments. + +**Replication process:** The replication process involves two services - the primary and +replica services. The system automatically and asynchronously copies any new data you +add to the primary service to the replica service. The primary service manages all +read and write operations for optimal performance and data consistency under +normal conditions. + +**Handling failures:** In the event of a primary service failure, Aiven's automatic +failover feature promotes the read replica service to become the new primary, +ensuring continuous service availability. + +However, to fully resume normal operations, manually update your application’s +connection settings to point to the new primary service. + +## Limitations + +- This feature requires Aiven enterprise. +- Aiven for Caching read replica follows an active-passive model, which means that only + the data ingested in the primary service gets replicated. +- Aiven for Caching services only support replication within their own service type. + Cross-service replication to or from Aiven for Dragonfly services is not supported. + +## Related pages + +- [Create read replica for Aiven for Caching](/docs/products/caching/howto/create-caching-read-replica) diff --git a/docs/products/caching/concepts/redis-ccr.md b/docs/products/caching/concepts/redis-ccr.md deleted file mode 100644 index d7259c02..00000000 --- a/docs/products/caching/concepts/redis-ccr.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: Aiven for Redis®* cross-cluster replication -sidebar_label: Redis CCR -pro: true ---- - -Aiven for Redis®* Cross-Cluster Replication (CCR) feature replicates data from a primary to a replica cluster across various DNS, clouds, or regions, improving data availability and aiding in disaster recovery. - -## Features and benefits - -- **High availability:** By replicating data across clusters in different locations, - Aiven for Redis CCR ensures that your application remains available even if one - cluster goes down. -- **Disaster recovery:** Automatic promotion of the follower cluster to leader status in - case of the primary/main cluster's failure provides a robust disaster - recovery mechanism. -- **Geographical distribution:** With the ability to work across all clouds and regions, - Aiven for Redis CCR keeps data closer to your users, reducing latency and improving - the user experience. - -## How CCR works - -Aiven for Redis uses an **active-passive replication model** for its CCR feature, -ensuring high availability and data resilience across deployments. - -**Replication process:** The replication process involves two services - the primary and -replica services. The system automatically and asynchronously copies any new data you -add to the primary service to the replica service. The primary service manages all -read and write operations for optimal performance and data consistency under -normal conditions. - -**Handling failures:** In case of any failure of the primary service, Aiven provides -automatic failover functionality, which promotes the replica service to become -the new primary, maintaining service continuity. - -However, to fully resume normal operations, you must manually update your application’s -connection settings to point to the new primary service. - -## Limitations - -- This feature requires `[Pro Platform](/docs/platform/concepts/pro-platform)`. -- Aiven for Redis CCR follows an active-passive model, which means that only the data -ingested in the primary service gets replicated. -- Aiven for Redis services only support replication within their own service type. -Cross-service replication to or from Aiven for Dragonfly services is not supported. -- Enabling up CCR for Aiven for Redis is only possible via API/CLI, with console support - planned for future releases. - -## Related pages - -- [Enable cross-cluster replication for Aiven for Redis](/docs/products/redis/howto/enable-redis-ccr) diff --git a/docs/products/caching/howto/create-caching-read-replica.md b/docs/products/caching/howto/create-caching-read-replica.md new file mode 100644 index 00000000..3e0a44bb --- /dev/null +++ b/docs/products/caching/howto/create-caching-read-replica.md @@ -0,0 +1,182 @@ +--- +title: Create read replica in Aiven for Caching +sidebar_label: Create read replica +enterprise: true +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +[Aiven for Caching read replica](/docs/products/caching/concepts/caching-read-replica) enables data replication from a primary to a replica service, ensuring high availability and disaster recovery. + +## Prerequisites + +- This feature requires Aiven enterprise. +- An Aiven account and API token +- [Aiven CLI tool](https://github.com/aiven/aiven-client) +- Backup enabled for the service + +## Limitations + +- You can only create a maximum of **5 read replicas** per primary service. +- Read replicas can only be created on the **Startup-4** plan. + + +## Create a read replica + + + + +1. Log in to the [Aiven Console](https://console.aiven.io/), select your project, + and select your Aiven for Caching service. +1. On the **Overview** page, click **Create replica**. +1. Enter a name for the read replica, select the cloud provider, region, and + service plan, and click **Create**. + +The read replica is created and listed within your project services. You can access +read replica services from the **Read replica** section on the service's **Overview** +page. Additionally, identify the service type by the chips +labeled **Primary** or **Replica** at the top. + + + + +To enable a read replica using the Aiven CLI, use the following command with placeholders: + +```bash +avn service create -t redis -p startup-4 --project PROJECT_NAME \ + --read-replica-for PRIMARY_SERVICE_NAME REPLICA_SERVICE_NAME +``` + +Replace the placeholders with your actual values: + + - `PROJECT_NAME`: The name of your project. + - `CLOUD_NAME`: The name of the cloud to use. + - `PRIMARY_SERVICE_NAME`: The name of your primary service. + - `REPLICA_SERVICE_NAME`: The name of your replica service. + + + + +To enable a read replica for your existing Aiven for Caching service via API, +use the following command: + +```shell +curl -X POST https://api.aiven.io/v1/project/PROJECT_NAME/service \ +-H "Content-Type: application/json" \ +-H "Authorization: bearer YOUR_AUTH_TOKEN" \ +-d '{ + "cloud": "CLOUD_NAME", + "plan": "startup-4", + "service_name": "REPLICA_SERVICE_NAME", + "service_type": "redis", + "project": "PROJECT_NAME", + "service_integrations": [ + { + "integration_type": "read_replica", + "source_service_name": "PRIMARY_SERVICE_NAME" + } + ] + }' +``` + +Replace the placeholders with your actual values: + +- `PROJECT_NAME`: The name of your project. +- `YOUR_AUTH_TOKEN`: Your API authentication token. +- `CLOUD_NAME`: The name of the cloud to use. +- `REPLICA_SERVICE_NAME`: The name of your replica service. +- `PRIMARY_SERVICE_NAME`: The name of your primary service. + + + + +## Promote a replica to standalone primary + +You can promote your read replica to become a primary service. After promotion, the +replica becomes an independent primary service, +disconnected from the original. + + + + +1. Log in to the [Aiven Console](https://console.aiven.io/) and select + your Aiven for Caching service. +1. Click the replica service you intend to promote in the* Read replica* section on + the service's **Overview** page. +1. On the *replica* service's **Overview** page, click **Promote to primary**. +1. Click **Promote**, in the confirmation dialog. + + + + +To promote the replica to primary using the Aiven CLI, follow these steps: + +1. Retrieve the service integration ID using the integration-list command: + + ```bash + avn service integration-list --project + ``` + + Parameters: + + - `--project `: The name of your project. + - ``: The name of your replica service. + +1. Delete the service integration using the following command: + + ...:::note + Deleting the service integration breaks the replication link between the primary and + the replica, promoting the replica to act as a standalone primary service. + ::: + + ```bash + avn service integration-delete --project + ``` + + Parameters: + + - `--project `: The name of your project. + - ``: The integration ID retrieved in the previous step. + + + + +To promote the replica to primary using the Aiven API, follow these steps: + +1. Initiate an API call to retrieve the service integration ID. + + ```shell + curl -s \ + -H "Authorization: bearer YOUR_AUTH_TOKEN" \ + "https://api.aiven.io/v1/project//service//integration" \ + | jq -r '.service_integrations[] | select(.source_service_name=="").service_integration_id' + + ``` + + Parameter: + + - `YOUR_AUTH_TOKEN`: Your API authentication token. + - ``: The name of your project. + -` `: The name of your replica service. + - `select(.source_service_name=="")`: Filters the integrations + to find the one linked to your primary service. + - `service_integration_id`: Extracts the integration ID. + +1. Delete the service integration using the retrieved integration ID. + + ```shell + curl -X DELETE -H "Authorization: bearer YOUR_AUTH_TOKEN" "https://api.aiven.io/v1/project//integration/" + + ``` + + Parameters: + + - `YOUR_AUTH_TOKEN`: Your API authentication token. + - ``: The name of your project. + - ``: The integration ID retrieved in the previous step. + +The replica service will be promoted to a standalone primary service, disconnected +from the original primary service. + + + diff --git a/docs/products/caching/howto/enable-redis-ccr.md b/docs/products/caching/howto/enable-redis-ccr.md deleted file mode 100644 index 25495525..00000000 --- a/docs/products/caching/howto/enable-redis-ccr.md +++ /dev/null @@ -1,129 +0,0 @@ ---- -title: Enable cross-cluster replication in Aiven for Redis®* -sidebar_label: Enable CCR -pro: true ---- -[Aiven for Redis cross-cluster replication (CCR)](/docs/products/redis/concepts/redis-ccr) feature enables data replication from a primary to a replica service, ensuring high availability and disaster recovery. Learn how to enable CCR for your Aiven for Redis service, verify data replication, and manage failovers. - - -## Prerequisites - -- This feature requires `[Pro Platform](/docs/platform/concepts/pro-platform)`. -- An Aiven account and API token -- [Aiven CLI tool](https://github.com/aiven/aiven-client) -- Two Aiven for Redis services within your Aiven project: one designated as the *primary* - and the other as the *replica* - -## Enable CCR via API - -To enable CCR for your Aiven for Redis service via API, follow these steps: - -1. **Create the primary service:** Start by creating your primary Aiven for Redis service. - This service acts as the primary (leader) in the replication setup. Use the - following Aiven API call to create the service: - - ```shell - curl -X POST https://api.aiven.io/v1/project/PROJECT_NAME/service \ - -H "Content-Type: application/json" \ - -H "Authorization: bearer YOUR_AUTH_TOKEN" \ - -d '{ - "cloud": "CLOUD_NAME", - "plan": "business-4", - "service_name": "PRIMARY_SERVICE_NAME", - "service_type": "redis", - "project": "PROJECT_NAME" - }' - ``` - - Replace the placeholders with your actual values: - - - `PROJECT_NAME`: The name of your project. - - `YOUR_AUTH_TOKEN`: Your API authentication token. - - `CLOUD_NAME`: The name of the cloud you want to use. - - `PRIMARY_SERVICE_NAME`: The name you want to give to your primary service. - - `YOUR_AUTH_TOKEN`: Your API authentication token. - -1. **Confirm primary service backups:** Before creating a replica service, verify that - your primary Aiven for Redis service has a backup. - [Configuring backups](/docs/platform/concepts/service_backups#aiven-for-redis) - is essential to ensure data consistency and integrity for replication. - -1. **Create the replica service:** Next, create the Aiven for Redis service that acts as - the replica. Specify the primary service as the source for replication using the - following API call: - - ```shell - curl -X POST https://api.aiven.io/v1/project/PROJECT_NAME/service \ - -H "Content-Type: application/json" \ - -H "Authorization: bearer YOUR_AUTH_TOKEN" \ - -d '{ - "cloud": "CLOUD_NAME", - "plan": "startup-4", - "service_name": "REPLICA_SERVICE_NAME", - "service_type": "redis", - "project": "PROJECT_NAME", - "service_integrations": [ - { - "integration_type": "read_replica", - "source_service_name": "PRIMARY_SERVICE_NAME" - } - ] - }' - ``` - - Replace the placeholders with your actual values: - - - `PROJECT_NAME`: The name of your project. - - `YOUR_AUTH_TOKEN`: Your API authentication token. - - `CLOUD_NAME`: The name of the cloud you want to use. - - `REPLICA_SERVICE_NAME`: The name you want to give to your replica service. - - `PRIMARY_SERVICE_NAME`: The name of your primary service. - -## Enable CCR via CLI - -You can also use the Aiven CLI to enable CCR for your Aiven for Redis service. - -1. **Create the primary service**: Execute the command below to create the primary - (leader) Aiven for Redis service: - - ```bash - avn service create --project -t redis --plan startup-4 --cloud \ - --service-integration source_service=,integration_type=read_replica - ``` - - Replace the placeholders with your actual values: - - - `PRIMARY_SERVICE_NAME`: The name of your primary service. - - `PROJECT_NAME`: The name of your project. - - `CLOUD_NAME`: The name of the cloud you want to use. - -1. **Confirm primary service backups:** Before creating a replica service, verify that - your primary Aiven for Redis service has a backup. - [Configuring backups](/docs/platform/concepts/service_backups#aiven-for-redis) is - essential to ensure data consistency and integrity for replication. - -1. **Create the replica service:** Use the following CLI command to create the replica - service with the correct replication settings: - - ```bash - avn service create REPLICA_SERVICE_NAME --project PROJECT_NAME -t redis --plan startup-4 --cloud CLOUD_NAME \ - --service-integration source_service=PRIMARY_SERVICE_NAME,integration_type=read_replica - ``` - - Replace the placeholders with your actual values: - - - `REPLICA_SERVICE_NAME`: The name you want to give to your replica service. - - `PROJECT_NAME`: The name of your project. - - `CLOUD_NAME`: The name of the cloud you want to use. - - `PRIMARY_SERVICE_NAME`: The name of your primary service. - -## Verify data replication - -After setting up the replica, ensure that data entered into the primary Aiven for Redis -service is successfully replicated to the replica service. - -## Manage failover - -If the primary service fails, Aiven automatically promotes the replica service to the -new primary. Update your application's connection details to connect to this new primary -service to maintain smooth operations. diff --git a/sidebars.ts b/sidebars.ts index 09310921..b2962088 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -2076,11 +2076,11 @@ const sidebars: SidebarsConfig = { slug: 'products/caching/concepts', }, items: [ - 'products/redis/concepts/high-availability-redis', - 'products/redis/concepts/lua-scripts-redis', - 'products/redis/concepts/memory-usage', - 'products/redis/concepts/restricted-redis-commands', - 'products/redis/concepts/redis-ccr', + 'products/caching/concepts/high-availability-redis', + 'products/caching/concepts/lua-scripts-caching', + 'products/caching/concepts/memory-usage', + 'products/caching/concepts/restricted-redis-commands', + 'products/caching/concepts/caching-read-replica', ], }, { @@ -2125,11 +2125,11 @@ const sidebars: SidebarsConfig = { 'products/caching/howto/migrate-redis-aiven-via-console', ], }, - 'products/redis/howto/estimate-max-number-of-connections', - 'products/redis/howto/manage-ssl-connectivity', - 'products/redis/howto/warning-overcommit_memory', - 'products/redis/howto/benchmark-performance', - 'products/redis/howto/enable-redis-ccr', + 'products/caching/howto/estimate-max-number-of-connections', + 'products/caching/howto/manage-ssl-connectivity', + 'products/caching/howto/warning-overcommit_memory', + 'products/caching/howto/benchmark-performance', + 'products/caching/howto/create-caching-read-replica', ], }, {