环境:
OS:Centos 7
RedisShake:v4.2.2
1.下载地址
https://github.com/tair-opensource/RedisShake/releases/download/v4.2.2/redis-shake-linux-amd64.tar.gz
2.解压安装
mkdir -p /opt/redis-shake ##安装包上传到该目录
tar -xvf redis-shake-linux-amd64.tar.gz
3.修改配置文件
vi /opt/redis-shake/shake.toml
4.执行迁移
/opt/redis-shake /opt/redis-shake/shake.toml
配置文件例子1:
ecs自己单机redis迁移到阿里云云服务redis(集群模式)
[sync_reader] cluster = false # set to true if source is a redis cluster address = "172.1.40.200:6379" # when cluster is true, set address to one of the cluster node username = "" # keep empty if not using ACL password = "aaaaaaaaa" # keep empty if no authentication is required [redis_writer] cluster = false # set to true if target is a redis cluster sentinel = false # set to true if target is a redis sentinel master = "" # set to master name if target is a redis sentinel address = "r-wzeeeeeeeeeeee:6379" # when cluster is true, set address to one of the clust er node username = "" # keep empty if not using ACL password = "aaaaaaa" # keep empty if no authentication is required [filter] # Allow keys with specific prefixes or suffixes # Examples: # allow_key_prefix = ["user:", "product:"] # allow_key_suffix = [":active", ":valid"] # Leave empty to allow all keys allow_key_prefix = ["hxl"] allow_key_suffix = []
说明:
a.目标端阿里云的地址是代理模式的url,内部是集群,但是这里cluster设置成false
b.只同步hxl开头的key
c.需要将程序运行所在ECS的ip加入到阿里云redis云服务的白名单。
标签:同步,set,RedisShake,redis,cluster,过滤,key,shake,empty From: https://www.cnblogs.com/hxlasky/p/18604376