【Azure Redis】Redis导入备份文件(RDB)失败的原因

发布时间 2023-07-18 23:02:57作者: 路边两盏灯

问题描述

在测试Azure Redis的导入/导出备份文件的功能中,突然发现在Redis 4.0上导入的时候,一直报错。

 

问题解答

因为门户上只是显示导入失败,没有任何错误消息说明。根据常理推断,Redis 的RDB文件格式都具有一致性。居然会出现导入失败,所以非常不合常理。但为什么会出现这样的情况呢?

进一步检查Redis的RDB文件,是从一个新的Azure Redis上产生的,而导入的目标Redis服务是比较旧的一个服务。通过查看他们之间的版本,一个是6.0, 一个是4.0。

所以现在需要调查的问题是 Redis 6.0生产的RDB文件导入Redis 4.0服务时,为什么会失败呢?

最后,在官方文档中,寻找到了问题的答案!

Exported backups from newer versions of Redis (for example, Redis 6.0) can't be imported into older versions of Redis (for example, Redis 4.0)

从较新版本的 Redis (例如 Redis 6.0) 导出的备份无法导入到较旧版本的 Redis (例如 Redis 4.0)

 

 

参考资料

Import and Export data in Azure Cache for Redis : https://learn.microsoft.com/en-us/azure/azure-cache-for-redis/cache-how-to-import-export-data#compatibility