Create a database with Replica Of
Create Replica Of database
Replica databases copy data from source databases (previously known as master), which enable read-only connections from apps and clients located in different geographic locations.
To create a replica connection, you define a database as a replica of a source database. Replica Of databases (also known as Active-Passive databases) synchronize in the background.
Sources databases can be:
- Located in the same Redis Enterprise Software cluster
- Located in a different Redis Enterprise cluster
- Hosted by a different deployment, e.g. Redis Cloud
- Redis Community Edition databases
Your apps can connect to the source database to read and write data; they can also use any replica for read-only access.
Replica Of can model a variety of data relationships, including:
- One-to-many relationships, where multiple replicas copy a single source database.
- Many-to-one relationships, where a single replica collects data from multiple source databases.
When you change the replica status of a database by adding, removing, or changing sources, the replica database is synchronized to the new sources.
Configure Replica Of
You can configure a database as a Replica Of, where the source database is in one of the following clusters:
The order of the multiple Replica Of sources has no material impact on replication.
For best results when using the Multicast DNS (mDNS) protocol to resolve the fully-qualified domain name (FQDN) of the cluster, verify that your client connections meet the client mDNS prerequisites.
Same Redis Enterprise cluster
To configure a Replica Of database in the same Redis Enterprise cluster as the source database:
-
Create a new database or select an existing database from the Databases screen.
-
For an existing database, select Edit from the Configuration tab.
-
Expand the Replica Of section.
-
Select + Add source database.
-
In the Connect a Replica Of source database dialog, select Current cluster.
-
Select the source database from the list.
-
Select Add source.
-
Select Save.
Different Redis Enterprise cluster
To configure a Replica Of database in a different Redis Enterprise cluster from the source database:
-
Sign in to the Cluster Manager UI of the cluster hosting the source database.
-
In Databases, select the source database and then select the Configuration tab.
-
In the Replica Of section, select Use this database as a source for another database.
-
Copy the Replica Of source URL.
To change the internal password, select Regenerate password.
If you regenerate the password, replication to existing destinations fails until their credentials are updated with the new password.
-
-
Sign in to the Cluster Manager UI of the destination database's cluster.
-
Create a new database or select an existing database from the Databases screen.
-
For an existing database, select Edit from the Configuration tab.
-
Expand the Replica Of section.
-
Select + Add source database.
-
In the Connect a Replica Of source database dialog, select External.
-
Enter the URL of the source database endpoint.
-
Select Add source.
-
Select Save.
For source databases on different clusters, you can compress replication data to save bandwidth.
Redis Community Edition cluster
To use a database from a Redis Community Edition cluster as a Replica Of source:
-
Create a new database or select an existing database from the Databases screen.
-
For an existing database, select Edit from the Configuration tab.
-
Expand the Replica Of section.
-
Select + Add source database.
-
In the Connect a Replica Of source database dialog, select External.
-
Enter the URL of the source endpoint in one of the following formats:
-
For databases with passwords:
redis://:<password>@<host>:<port>
Where the password is the Redis password represented with URL encoding escape characters.
-
For databases without passwords:
redis://<host>:<port>
-
-
Select Add source.
-
Select Save.
Configure TLS for Replica Of
When you enable TLS for Replica Of, the Replica Of synchronization traffic uses TLS certificates to authenticate the communication between the source and destination clusters.
To encrypt Replica Of synchronization traffic, configure encryption for the source database and the destination replica database.
Encrypt source database traffic
To enable TLS for Replica Of cluster connections:
-
For each cluster hosting a replica:
-
From the Security tab of the Replica Of source database, select Edit.
-
In the TLS - Transport Layer Security for secure connections section, make sure the checkbox is selected.
-
In the Apply TLS for section, select Between databases only.
-
Select Mutual TLS (Client authentication).
-
Select + Add certificate, paste or upload the syncer certificate, then select Done.
Repeat this process, adding the syncer certificate for each cluster hosting a replica of this database.
-
(Optional) To require TLS for client connections, change Apply TLS for to Clients and databases + Between databases and add client certificates.
-
Select Save.
Encrypt replica database traffic
To enable TLS for Replica Of in the destination database:
-
From the Cluster Manager UI of the cluster hosting the source database:
-
From the Configuration tab of the Replica Of destination database, select Edit.
-
Expand the Replica Of section.
-
Paste or upload the source proxy certificate, then select Done.
-
Select Save.