×
Community Blog Best Practice: Migrate AWS ElastiCache to Alibaba Cloud Tair via RIOT

Best Practice: Migrate AWS ElastiCache to Alibaba Cloud Tair via RIOT

This article explains how RIOT makes it easy to migrate data from AWS ElastiCache to cloud-native in-memory databases (such as Tair and ApsaraDB for Redis) with examples.

1. Prepare for Resource Migration

1.1. Source

AWS ElastiCache cache.r6g.xlarge. It has three data shards and is compatible with Redis 6.2.

1

AWS EC2 t2.medium CentOS 7 (It is in the same VPC as AWS ElastiCache because ElastiCache does not support public network connection.)

2

1.2. Target

Alibaba Cloud Tair tair.rdb.with.proxy.24g. It has three data shards and is compatible with Redis 6.0. (Public network address is enabled, and the whitelist is set to EC2 public network IP address.)

3

2. Configure the Source Database Environment

2.1 Change the value of the AWS ElastiCache parameter and notify-keyspace-events to KEA for the source instance.

Open the parameter group on the left side of the AWS ElastiCache console and create a new template based on the current version, such as Redis 6.x.

4
5

2.2 Change the value of the notify-keyspace-events to KEA and cluster-enabled to yes.

6
7

2.3 Apply New Parameter Template on Elasticache Instance

8
9
10

3. Deploy the RIOT Tool on the EC2 Instance

sudo yum install java-1.8.0-openjdk -y
wget https://github.com/redis-developer/riot/releases/download/v3.1.5/riot-3.1.5.zip
unzip riot-3.1.5.zip

4. Install the Redis Client on the EC2 Instance

Deploy the Redis client on the EC2 instance and connect to the ElastiCache instance to create test data.

Note: If there is already an ElastiCache instance with data, you do not need to recreate the test data. You can install the Redis client on the EC2 instance.

sudo yum install gcc jemalloc-devel openssl-devel tcltcl-devel -y
sudo wget http://download.redis.io/redis-stable.tar.gz
sudo tar xvzf redis-stable.tar.gz
cd redis-stable
sudo make BUILD_TLS=yes
src/redis-cli -c -h clustercfg.test-20230904.vsntkk.apne1.cache.amazonaws.com --tls -a xxxxxxxxxxxx -p 6379

11

5. Start the Migration

5.1. Start the RIOT Tool on the EC2 Instance

Log on to the EC2 host, use the source and target parameters, and start the RIOT program to synchronize full and incremental data.

cd /home/centos/riot-3.1.5/bin
./riot -h clustercfg.test-20230904.vsntkk.apne1.cache.amazonaws.com --tls -a xxxxxxxxxxx -c -p 6379 replicate -h r-gs5u6x8xuwywt0q8qnpd.redis.singapore.rds.aliyuncs.com -p 6379 --user=poc --pass=xxxxxxxx -c --mode live --progress log

12

5.2. Log on to the Target Instance Tair to Verify the Data

Access the Tair console and log on to the database through DMS to query data and check whether full data is migrated properly:

13
14
15
16
17

5.3. Write Incremental Data and Verify It

Insert incremental data into the source instance Elasticache and verify the incremental data in the target instance Tair:

18
19
20
21
22

6. Summary

Using RIOT makes it easy to quickly migrate data from AWS ElastiCache to cloud-native in-memory databases, such as Tair and ApsaraDB for Redis. Compared with other methods (such as redis-shake), the tool supports full migration along with enhanced replication without downtime during migration, which is a very good tool for improving efficiency.

7. About RIOT

RIOT (or Redis Input/Output Tools) is an open-source online migration tool built by Julien Ruaux, a Solution Architect at Redis. It is a migration tool that allows seamless live replication between two Redis databases. It implements client-side replication using a producer/consumer approach.

RIOT is a command-line utility designed to help you get data in and out of Redis. It supports many different sources and targets, including files (CSV, JSON, XML), data generators (Redis data structures and Faker), relational databases, and Redis (snapshot and live replication). RIOT can be installed in different ways depending on your environment and preference.

In terms of safety, RIOT Redis performs a verification step to compare values and TTLs between source and destination databases once the replication is complete. However, as with any migration process, it is always a good idea to back up your data before proceeding.

8. About Tair

Tair is a cloud-native in-memory database service developed by Alibaba Cloud. It provides full compatibility with open-source Redis and offers a variety of data modules and enterprise-class capabilities to help you implement online real-time scenarios.

Learn more with a free 30-day trial: https://www.alibabacloud.com/product/tair

1 1 0
Share on

ApsaraDB

443 posts | 93 followers

You may also like

Comments

5646998924277397 November 7, 2023 at 3:11 am

6666

ApsaraDB

443 posts | 93 followers

Related Products