BladePipe 1.9.0: New data pipelines, faster Oracle writes, and improved stability.
跳到主要内容

Redis 到 Redis

选择对端数据库:

数据链路

基本功能

功能说明
Full Data Migration and Incremental Data Sync

Synchronize data by executing the PSYNC command, with optional historical data initialization.

Position Resetting

Initialize historical data again by modifying the position.

Supported Deployment

Support single node, Sentinel, and Redis sharded cluster.

Supported Commands

Currently support the following commands (continuously expanding):

  • SET, SETNX, SETEX, APPEND, GETSET, HSET, HSETNX, MSET, HMSET
  • DEL, HDEL, UnLink
  • INCR, INCRBY, HINCRBY
  • LPUSH, RPUSH, LSET, LINSERT, LREM
  • SADD, ZADD, ZREM, ZREMRANGEBYSCORE, SREM
  • EXPIRE, PExpire, RENAME, Eval

高级功能

功能说明
缓存失效时间

支持设置数据到 Redis 后缓存失效时间(单位:秒)

Bidirectional Redis Synchronization

Support full data migration and incremental data synchronization in which the circular data replication is prevented. See Redis Bidirectional Data Synchronization.

Supported Commands for Redis Bidirectional Synchronization

Currently, the following commands are supported in bidirectional synchronization (continuously expanding):

  • SET, SETNX, SETEX, APPEND, GETSET, HSET, HSETNX, MSET, HMSET
  • DEL, HDEL, UnLink
  • LPUSH, RPUSH, LSET, LINSERT, LREM
  • SADD, ZADD, ZREM, ZREMRANGEBYSCORE
  • EXPIRE, PExpire, Eval

限制和注意点

限制项说明
主备切换兼容性

Redis 3.x 因使用早期版本的 PSYNC , 主备切换适配较差,存在丢数据风险

复制 backlog 设置

Redis 默认复制参数 repl-backlog-size 过小, 如数据同步延迟过大,可能触发 FULL SYNC 全量初始化。需调大此参数

使用示例

标题详情
Redis Bidirectional Data Synchronization

See Redis Bidirectional Data Synchronization.


源端数据源

前置条件

条件说明
指令准备

可执行 PSYNC 指令 (托管云服务可能不支持该指令)

网络准备

迁移同步节点(sidecar)可连接 Redis 各节点和 Sentinel 节点(如果有)

任务参数

参数名称说明
dbHeartbeatIntervalSec

发送 PING 指令的间隔时间

deCycle

双向同步过滤开关,过滤带防循环事件的增量事件

deCycleMode

双向同步过滤事件模式:GET_KEY 代表 查询 标记模式,DEL_KEY 代表 删除 标记模式,TX_SIGN 代表 事务 标记模式

enableDbMapping

Redis 启用 DB 映射,需要保证源端和目标端实例 DB 数量相等

deCycleEventExpireSec

防循环事件写入对端后的过期时间, <0 则不过期

extractorQueueSize

暂存的 Redis 事件的队列大小

inputStreamBufferSize

接收 Redis 响应的字节流 buffer 大小

connAndSoTimeoutMs

TCP 链接参数 SO_TIMEOUT

receiveBufferSize

TCP 链接参数 SO_RCVBUF

sendBufferSize

TCP 链接参数 SO_SNDBUF

isSentinel

true 代表 Redis Sentinel 集群,false 则代表 单机或分片集群

sentinelUser

连接 Sentinel 的用户名

sentinelPassword

连接 Sentinel 的密码

sentinelMasterName

Redis Sentinel 配置中指定的 Master Name

enableWriteDeReplay

Redis 增量非幂等指令时,是否开启防重放逻辑

Tips: 通用参数配置请参考 通用参数及功能


目标端数据源

前置条件

条件说明
网络准备

迁移同步节点(sidecar)可连接 Redis/AWS ElastiCache 各节点和 Sentinel 节点(如果有)

任务参数

参数名称说明
isSentinel

true 代表 Redis Sentinel 集群,false 则代表 单机或分片集群

sentinelUser

连接 Sentinel 的用户名

sentinelPassword

连接 Sentinel 的密码

sentinelMasterName

Redis Sentinel 配置中指定的 Master Name

secondsToExpire

通过 set 指令写入对端数据的 过期时间,-1 则不做限制

Tips: 通用参数配置请参考 通用参数及功能