Create Active-Active database (REAADB)
Prerequisites
Before creating an Active-Active database on Redis Enterprise for Kubernetes, you’ll need to prepare your participating Redis Enterprise clusters (REC). See Prepare participating clusters before creating your Redis Enterprise remote cluster (RERC) and Redis Enterprise Active-Active database (REAADB).
Create RedisEnterpriseRemoteCluster
resources
-
Create a
RedisEnterpriseRemoteCluster
(RERC) custom resource file for each participating Redis Enterprise cluster (REC). Below are examples of RERC resources for two participating clusters. Substitute your own values to create your own resource.Example RERC for a REC named
rec1
in the namespacens1
:apiVersion: app.redislabs.com/v1alpha1 kind: RedisEnterpriseRemoteCluster metadata: name: rerc1 spec: recName: rec1 recNamespace: ns1 apiFqdnUrl: test-example-api-rec1-ns1.redis.com dbFqdnSuffix: -example-cluster-rec1-ns1.redis.com secretName: redis-enterprise-rerc1
Example RERC for a REC named
rec2
in the namespacens2
:apiVersion: app.redislabs.com/v1alpha1 kind: RedisEnterpriseRemoteCluster metadata: name: rerc2 spec: recName: rec2 recNamespace: ns2 apiFqdnUrl: test-example-api-rec2-ns2.redis.com dbFqdnSuffix: -example-cluster-rec2-ns2.redis.com secretName: redis-enterprise-rerc2
For more details on RERC fields, see the RERC API reference.
-
Create a Redis Enterprise remote cluster from each RERC custom resource file.
kubectl create -f <rerc-file>
-
Check the status of your RERC. If
STATUS
isActive
andSPEC STATUS
isValid
, then your configurations are correct.kubectl get rerc <rerc-name>
Output should look similar to:
kubectl get rerc rerc1 NAME STATUS SPEC STATUS LOCAL rerc1 Active Valid true
In case of errors, review the RERC custom resource events and the Redis Enterprise operator logs.
Create RedisEnterpriseActiveActiveDatabase
resource
-
Create a
RedisEnterpriseActiveActiveDatabase
(REAADB) custom resource file meeting the naming requirements and listing the names of the RERC custom resources created in the last step.Naming requirements:
- less than 63 characters
- contains only lowercase letters, numbers, or hyphens
- starts with a letter
- ends with a letter or digit
Example REAADB named
example-aadb-1
linked to the REC namedrec1
with two participating clusters and a global database configuration with shard count set to 3:apiVersion: app.redislabs.com/v1alpha1 kind: RedisEnterpriseActiveActiveDatabase metadata: name: example-aadb-1 spec: globalConfigurations: databaseSecretName: <my-secret> memorySize: 200MB shardCount: 3 participatingClusters: - name: rerc1 - name: rerc2
For more details on RERC fields, see the RERC API reference.
-
Create a Redis Enterprise Active-Active database from the REAADB custom resource file.
kubectl create -f <reaadb-file>
-
Check the status of your RERC. If
STATUS
isActive
andSPEC STATUS
isValid
, your configurations are correct.kubectl get raadb <raadb-name>
Output should look similar to:
kubectl get raadb example-aadb-1 NAME STATUS SPEC STATUS GLOBAL CONFIGURATIONS REDB LINKED REDBS example-aadb-1 active Valid
In case of errors, review the REAADB custom resource events and the Redis Enterprise operator logs.