You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-cache-for-redis/cache-tutorial-active-replication.md
+67-62Lines changed: 67 additions & 62 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,12 +13,12 @@ ms.date: 09/18/2023
13
13
14
14
# Get started using Azure Cache for Redis Enterprise active replication with an AKS-hosted application
15
15
16
-
In this tutorial, you will host a simple inventory application on Azure Kubernetes Service (AKS) and find out how you can leverage active geo-replication to replicate data in your Azure Cache for Redis Enterprise instances across Azure regions.
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.
17
17
18
18
## Prerequisites
19
19
20
20
- 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). Alternately, you can host two instances of the demo application on the same AKS cluster.
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
22
23
23
> [!IMPORTANT]
24
24
> This tutorial assumes that you are familiar with basic Kubernetes concepts like containers, pods and service.
@@ -35,76 +35,81 @@ This tutorial uses a sample inventory page which shows three different T-shirt o
35
35
36
36
1. Enable **Non-TLS access only**.
37
37
1. Set **Clustering Policy** to **Enterprise**
38
-
1. Configure active geo-replication using [this guide](cache-how-to-active-geo-replication.md) to both caches to the same replication group. Create the group name with the first cache, and add the second cache to the same group.
38
+
1. Configure a new active geo-replication group using [this guide](cache-how-to-active-geo-replication.md). Eventually, you add both caches to the same replication group. Create the group name with the first cache, and add the second cache to the same group.
39
39
40
40
> [!IMPORTANT]
41
41
> This tutorial uses a non-TLS port for demonstration, but we highly recommend that you use a TLS port for anything in production.
42
42
43
-
1. Set up another Azure Cache for Redis Enterprise in **East US** region with the exact same configuration as the first cache. Alternately, you can use any region of your choice. Ensure that you choose the same replication group as the first cache.
43
+
1. Set up another Azure Cache for Redis Enterprise in **East US** region with the same configuration as the first cache. Alternatively, you can use any region of your choice. Ensure that you choose the same replication group as the first cache.
44
44
45
45
## Prepare Kubernetes deployment files
46
46
47
-
To demonstrate data replication across regions, we will run two instances of the same application in different regions. Let's assume one instance runs in Seattle (west) while the second in New York (east).
48
-
49
-
Update the following fields in the YAML file below and save it as app_west.yaml
50
-
51
-
- Update environment variables REDIS_HOST and REDIS_PASSWORD with hostname and access key of your Azure Cache for Redis Enterprise instance in West US 2 or one of the two regions your chose earlier.
52
-
- Update APP_LOCATION to display the region where this application instance is running. In this sample, we are configuring the APP_LOCATION to Seattle to indicate this application instance is running in Seattle.
53
-
54
-
```YAML
55
-
apiVersion: apps/v1
56
-
kind: Deployment
57
-
metadata:
58
-
name: shoppingcart-app
59
-
namespace: west
60
-
spec:
61
-
replicas: 1
62
-
selector:
63
-
matchLabels:
64
-
app: shoppingcart
65
-
template:
47
+
Create two .yml files using the following procedure. One file for each cache you created in the two regions.
48
+
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), while the second runs in New York (east).
50
+
51
+
1. Update the following fields in the YAML file below and save it as _app_west.yaml_.
52
+
53
+
1. Update environment variables `REDIS_HOST` and `REDIS_PASSWORD` with _hostname_ and _access key_ of your _West US 2_ cache.
54
+
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.
1. Save another copy of the same YAML file as _app_east.yaml_. This time, use different values.
106
110
107
-
Save another copy of the same YAML file as app_east.yaml. This time, update the REDIS_HOST, REDIS_PASSWORD and APP_LOCATION to point to Redis Enterprise instance in East US or your second region of choice.
111
+
1. Update environment variables `REDIS_HOST` and `REDIS_PASSWORD` with _hostname_ and _access key_ of your _East US_ cache.
112
+
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.
0 commit comments