Connect to Redis CLI
$ redis-cli
Enable the current redis as a slave for the master node
127.0.0.1:6379> SLAVEOF master-node-address.0001.euw1.cache.amazonaws.com 6379
Issue a sync
command, starting sync operations
127.0.0.1:6379> SYNC
Start save the sabe to the dump.rdb
file
127.0.0.1:6379> BGSAVE
127.0.0.1:6379> SLAVEOF NO ONE
127.0.0.1:6379> EXIT
Fetch the number of keys inside the database
127.0.0.1:6379> DBSIZE
Find the location of the configuration file we need this to find out where is Redis data folder
$ redis-cli INFO | grep file
config_file:/usr/local/etc/redis.conf
Location where the .rdb data files are stored
$ cat /usr/local/etc/redis.conf | grep dir --color
dir /usr/local/var/db/redis/
the logic is good. however, AWS doesn't seem to support SYNC and PSYNC command. https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/RestrictedCommands.html
have you got it working by any chance?
here is some debug.