Skip to content

Commit c044fdd

Browse files
committed
Acrolinx fixes
1 parent 8605662 commit c044fdd

File tree

1 file changed

+29
-25
lines changed

1 file changed

+29
-25
lines changed

articles/azure-cache-for-redis/cache-tutorial-active-replication.md

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
11
---
22
title: 'Tutorial: Get started using Azure Cache for Redis Enterprise active replication with an AKS-hosted application'
3-
description: In this tutorial, you learn how to connect your AKS hosted application to Azure Cache for Redis Enterprise instances and leverage active geo-replication.
3+
description: In this tutorial, you learn how to connect your AKS hosted application to a cache that uses active geo-replication.
44
author: flang-msft
55

66
ms.author: franlanglois
77
ms.service: cache
88
ms.topic: tutorial
99
ms.date: 09/18/2023
10-
#CustomerIntent: As a developer, I want to see how to use a Azure Cache for Redis Enterprise instance with an AKS container so that I see how I can use my cache instance with a Kubernetes cluster.
10+
#CustomerIntent: As a developer, I want to see how to use a Enterprise cache that uses active geo-replication to capture data from two apps running against different caches in separate geo-locations.
1111

1212
---
1313

1414
# Get started using Azure Cache for Redis Enterprise active replication with an AKS-hosted application
1515

16-
In this tutorial, you will host a simple inventory application on Azure Kubernetes Service (AKS) and find out how you can use active geo-replication to replicate data in your Azure Cache for Redis Enterprise instances across Azure regions.
16+
In this tutorial, you will host an inventory application on Azure Kubernetes Service (AKS) and find out how you can use active geo-replication to replicate data in your Azure Cache for Redis Enterprise instances across Azure regions.
1717

1818
## Prerequisites
1919

2020
- An Azure subscription. If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
21-
- Two Azure Kubernetes Service Clusters in different regions- For more information on creating a cluster, see [Quickstart: Deploy an Azure Kubernetes Service (AKS) cluster using the Azure portal](/azure/aks/learn/quick-kubernetes-deploy-portal). Alternatively, you can host two instances of the demo application on the same AKS cluster.
22-
<!-- SP -->
23-
- One Azure Kubernetes Service Cluster - For more information on creating a cluster, see [Quickstart: Deploy an Azure Kubernetes Service (AKS) cluster using the Azure portal](/azure/aks/learn/quick-kubernetes-deploy-portal). Alternately, you can host two instances of the demo application on the two different AKS clusters, which will how your production environment will be set up. However, for this tutorial, we will deploy both instances of the application on the same AKS cluster.
21+
- One Azure Kubernetes Service Cluster - For more information on creating a cluster, see [Quickstart: Deploy an Azure Kubernetes Service (AKS) cluster using the Azure portal](/azure/aks/learn/quick-kubernetes-deploy-portal). Alternatively, you can host two instances of the demo application on the two different AKS clusters. In a production environment, you would use two different clusters located in the same regions as your clusters to deploy two versions of the application. For this tutorial, you deploy both instances of the application on the same AKS cluster.
2422

2523
> [!IMPORTANT]
2624
> This tutorial assumes that you are familiar with basic Kubernetes concepts like containers, pods and service.
2725
2826
## Overview
2927

30-
This tutorial uses a sample inventory page which shows three different T-shirt options. The user can "purchase" each T-shirt and see the inventory drop. The unique thing about this demo is that we run the inventory app in two different regions. Typically, you would have to run the database storing inventory data in a single region so that there are no consistency issues. That can result in unpleasant customer experience due to higher latency for calls across different Azure regions. By using Azure Cache for Redis Enterprise as the backend, however, you can link two caches together with active geo-replication so that the inventory remains consistent across both regions while enjoying low latency performance from Redis Enterprise in the same region.
28+
This tutorial uses a sample inventory page that shows three different T-shirt options. The user can "purchase" each T-shirt and see the inventory drop. The unique thing about this demo is that we run the inventory app in two different regions. Typically, you would have to run the database storing inventory data in a single region so that there are no consistency issues. With other database backends and synchronization, customers might have unpleasant experience due to higher latency for calls across different Azure regions. When you use Azure Cache for Redis Enterprise as the backend, you can link two caches together with active geo-replication so that the inventory remains consistent across both regions while enjoying low latency performance from Redis Enterprise in the same region.
3129

3230
## Set up two Azure Cache for Redis instances
3331

@@ -48,14 +46,18 @@ This tutorial uses a sample inventory page which shows three different T-shirt o
4846

4947
Create two .yml files using the following procedure. One file for each cache you created in the two regions.
5048

51-
To demonstrate data replication across regions, we run two instances of the same application in different regions. Let's make one instance run in Seattle (west), while the second runs in New York (east).
49+
To demonstrate data replication across regions, we run two instances of the same application in different regions. Let's make one instance run in Seattle, west namespace, while the second runs in New York, east namespace.
5250

53-
1. Update the following fields in the YAML file below and save it as _app_west.yaml_.
51+
### West namespace
5452

55-
1. Update environment variables `REDIS_HOST` and `REDIS_PASSWORD` with _hostname_ and _access key_ of your _West US 2_ cache.
56-
1. Update `APP_LOCATION` to display the region where this application instance is running. For this cache, configure the `APP_LOCATION` to _Seattle_ to indicate this application instance is running in Seattle.
57-
<!-- sp -->
58-
1. Update environment variables REDIS_HOST and REDIS_PASSWORD with endpoint (remove the suffix ":10000") and access key of your Azure Cache for Redis Enterprise instance in West US 2 or one of the two regions your chose earlier.
53+
1. Update the following fields in the following YAML file and save it as _app_west.yaml_.
54+
55+
1. Update the variable `REDIS_HOST` with the **Endpoint value** URL after removing the port suffix: 10000
56+
1. Update `REDIS_PASSWORD` with the **Access key** of your _West US 2_ cache.
57+
1. Update `APP_LOCATION` to display the region where this application instance is running. For this cache, configure the `APP_LOCATION` to `Seattle` to indicate this application instance is running in Seattle.
58+
1. Verify that the variable `namespace` value is `west` in both places in the file.
59+
60+
It should look like following code:
5961

6062
```YAML
6163
apiVersion: apps/v1
@@ -110,14 +112,16 @@ To demonstrate data replication across regions, we run two instances of the same
110112
app: shoppingcart
111113
```
112114

113-
1. Save another copy of the same YAML file as _app_east.yaml_. This time, use different values.
115+
### East namespace
116+
117+
1. Save another copy of the same YAML file as _app_east.yaml_. This time, use the values that correspond with your second cache.
114118

115-
1. Update environment variables `REDIS_HOST` and `REDIS_PASSWORD` with Eendpoint_ and _access key_ of your _East US_ cache.
119+
1. Update the variable `REDIS_HOST` with the **Endpoint value** after removing the port suffix: 10000
120+
1. Update `REDIS_PASSWORD` with the **Access key** of your _East US_ cache.
116121
1. Update `APP_LOCATION` to display the region where this application instance is running. For this cache, configure the `APP_LOCATION` to _New York_ to indicate this application instance is running in New York.
117-
118-
1. +Save another copy of the same YAML file as app_east.yaml. This time, update the namespace, REDIS_HOST, REDIS_PASSWORD and APP_LOCATION to point to Redis Enterprise instance in East US or your second region of choice.
122+
1. Verify that the variable `namespace` value is `east` in both places in the file.
119123

120-
It should look like below:
124+
It should look like following code:
121125

122126
```YAML
123127
apiVersion: apps/v1
@@ -176,9 +180,12 @@ spec:
176180
177181
In this section, you first install the Kubernetes CLI and then connect to an AKS cluster.
178182
183+
> [!NOTE]
184+
> For this part of the tutorial, a Azure Kubernetes Service Cluster is required. For this tutorial, you deploy both instances of the application on the same AKS cluster.
185+
179186
### Install the Kubernetes CLI
180187
181-
Use the Kubernetes CLI, _kubectl_ , to connect to the Kubernetes cluster from your local computer. If you are running locally, then you can using the following command to install kubectl.
188+
Use the Kubernetes CLI, _kubectl, to connect to the Kubernetes cluster from your local computer. If you're running locally, then you can use the following command to install kubectl.
182189
183190
```bash
184191
az aks install-cli
@@ -194,7 +201,7 @@ Use the portal to copy the resource group and cluster name for your AKS cluster
194201
az aks get-credentials --resource-group myResourceGroup --name myClusterName
195202
```
196203

197-
Verify that you are able to connect to your cluster by running the following command:
204+
Verify that you're able to connect to your cluster by running the following command:
198205

199206
```bash
200207

@@ -210,7 +217,6 @@ aks-agentpool-21274953-vmss000003 Ready agent 1d v1.24.15
210217
aks-agentpool-21274953-vmss000006 Ready agent 1d v1.24.15
211218
```
212219

213-
214220
## Deploy and test your application
215221

216222
You need two namespaces for your applications to run on your AKS cluster. Create a west and then deploy the application.
@@ -256,7 +262,7 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
256262
shoppingcart-svc LoadBalancer 10.0.166.147 20.69.136.105 80:30390/TCP 90s
257263
```
258264

259-
Once the External-IP is available, open a web browser to the External-IP address of your service and you see the application running like below:
265+
Once the External-IP is available, open a web browser to the External-IP address of your service and you see the application running as follows:
260266

261267
<!-- screenshot for Seattle -->
262268

@@ -272,7 +278,7 @@ kubectl get pods -n east
272278
kubectl get service -n east
273279
```
274280

275-
With two services opened in your browser, you should see that changing the inventory in one region is virtually instantly reflected in the other region. The inventory data is stored in the Redis Enterprise instances which are replicating data across regions.
281+
With two services opened in your browser, you should see that changing the inventory in one region is almost instantly reflected in the other region. The inventory data is stored in the Redis Enterprise instances that are replicating data across regions.
276282

277283
You did it! Click on the buttons and explore the demo. To reset the count, add `/reset` after the url:
278284

@@ -283,11 +289,9 @@ You did it! Click on the buttons and explore the demo. To reset the count, add `
283289
To clean up your cluster, run the following commands:
284290

285291
```bash
286-
set kubeconfig=AKS_WestUS2
287292
kubectl delete deployment shoppingcart-app -n west
288293
kubectl delete service shoppingcart-svc -n west
289294

290-
set kubeconfig=AKS_EastUS
291295
kubectl delete deployment shoppingcart-app -n east
292296
kubectl delete service shoppingcart-svc -n east
293297
```

0 commit comments

Comments
 (0)