Skip to content

Commit 4d814e4

Browse files
committed
revised file creation section
1 parent 5b8321b commit 4d814e4

File tree

1 file changed

+67
-62
lines changed

1 file changed

+67
-62
lines changed

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

Lines changed: 67 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ ms.date: 09/18/2023
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 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.
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). 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.
2222

2323
> [!IMPORTANT]
2424
> 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
3535

3636
1. Enable **Non-TLS access only**.
3737
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.
3939

4040
> [!IMPORTANT]
4141
> This tutorial uses a non-TLS port for demonstration, but we highly recommend that you use a TLS port for anything in production.
4242
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.
4444

4545
## Prepare Kubernetes deployment files
4646

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.
55+
56+
```YAML
57+
apiVersion: apps/v1
58+
kind: Deployment
6659
metadata:
67-
labels:
68-
app: shoppingcart
60+
name: shoppingcart-app
61+
namespace: west
6962
spec:
70-
containers:
71-
- name: demoapp
72-
image: mcr.microsoft.com/azure-redis-cache/redisactivereplicationdemo:latest
73-
resources:
74-
limits:
75-
cpu: "0.5"
76-
memory: "250Mi"
77-
requests:
78-
cpu: "0.5"
79-
memory: "128Mi"
80-
env:
81-
- name: REDIS_HOST
82-
value: "DemoWest.westus.redisenterprise.cache.azure.net"
83-
- name: REDIS_PASSWORD
84-
value: "myaccesskey"
85-
- name: REDIS_PORT
86-
value: "10000" # redis enterprise port
87-
- name: HTTP_PORT
88-
value: "8080"
89-
- name: APP_LOCATION
90-
value: "Seattle, WA"
91-
---
92-
apiVersion: v1
93-
kind: Service
94-
metadata:
95-
name: shoppingcart-svc
96-
namespace: west
97-
spec:
98-
type: LoadBalancer
99-
ports:
100-
- protocol: TCP
101-
port: 80
102-
targetPort: 8080
103-
selector:
104-
app: shoppingcart
105-
```
63+
replicas: 1
64+
selector:
65+
matchLabels:
66+
app: shoppingcart
67+
template:
68+
metadata:
69+
labels:
70+
app: shoppingcart
71+
spec:
72+
containers:
73+
- name: demoapp
74+
image: mcr.microsoft.com/azure-redis-cache/redisactivereplicationdemo:latest
75+
resources:
76+
limits:
77+
cpu: "0.5"
78+
memory: "250Mi"
79+
requests:
80+
cpu: "0.5"
81+
memory: "128Mi"
82+
env:
83+
- name: REDIS_HOST
84+
value: "DemoWest.westus.redisenterprise.cache.azure.net"
85+
- name: REDIS_PASSWORD
86+
value: "myaccesskey"
87+
- name: REDIS_PORT
88+
value: "10000" # redis enterprise port
89+
- name: HTTP_PORT
90+
value: "8080"
91+
- name: APP_LOCATION
92+
value: "Seattle, WA"
93+
---
94+
apiVersion: v1
95+
kind: Service
96+
metadata:
97+
name: shoppingcart-svc
98+
namespace: west
99+
spec:
100+
type: LoadBalancer
101+
ports:
102+
- protocol: TCP
103+
port: 80
104+
targetPort: 8080
105+
selector:
106+
app: shoppingcart
107+
```
108+
109+
1. Save another copy of the same YAML file as _app_east.yaml_. This time, use different values.
106110
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.
108113

109114
## Install and connect to your AKS cluster
110115

0 commit comments

Comments
 (0)