RedisShake
RedisShake copied to clipboard
可否使用filter过滤db
问题描述
可否使用filter过滤db,使用scan模式的时候,有一个db太大了,不想同步,怎么写这个filter进行忽略呢?谢谢!
参考这里:https://github.com/alibaba/RedisShake/wiki/%E4%BD%BF%E7%94%A8-filters-%E5%81%9A%E6%95%B0%E6%8D%AE%E6%B8%85%E6%B4%97#filter-%E8%84%9A%E6%9C%AC%E4%B9%A6%E5%86%99%E8%AF%B4%E6%98%8E
skip_db.lua
function filter(id, is_base, group, cmd_name, keys, slots, db_id, timestamp_ms)
if db_id == 3 then
return 1, db_id -- disallow
else
return 0, db_id -- allow
end
end
scan.toml
type = "scan"
是想将这个db3 过滤掉,这样db3仍然是被scan 并write到新的redis中。
@zonshy 有没有可能目标 db 本身 db3 有数据