升级模块
Redis 堆栈 |
---|
升级 Redis Enterprise 中的模块以获取最新功能和修复。
-
如果升级单节点集群,它不会加载与新集群版本捆绑的新模块。
-
在将启用了 RediSearch 模块的数据库升级到 Redis 5.0 之前,必须将 RediSearch 模块升级到版本 1.4.2 或更高版本。
先决条件
在升级数据库中启用的模块之前,请在集群上安装该模块的新版本。
升级数据库的模块
在集群上安装更新的模块后,您可以升级数据库以使用新的模块版本。
要升级为数据库启用的模块:
-
连接到集群中某个节点的终端。
-
跑
rladmin status
以列出节点上的数据库。 -
复制使用要升级的模块的数据库的名称。
-
查找确切的模块名称和版本:
- 提取模块存档 (zip) 文件。
- 打开 JSON 文件。
- 在文件中找到模块名称和版本号。
下面是 RediSearch 模块的 JSON 文件示例:
-
要查看集群上模块的版本,请运行以下任一命令:
rladmin status modules
- 显示集群上可用的最新模块以及数据库使用的模块。rladmin status modules all
- 显示集群上所有可用的模块以及数据库使用的模块。
-
要将数据库升级到最新版本的 Redis,并将其模块升级到最新版本,而不更改模块参数:
-
对于使用 Redis Enterprise Software 版本 7.8.2 或更高版本的集群,请运行:
rladmin upgrade db < database-name | database-ID >
-
For clusters with versions earlier than 7.8.2, include the
latest_with_modules
option:rladmin upgrade db < database-name | database-ID > latest_with_modules
Warning:The upgrade process does not validate the module upgrade arguments, and incorrect arguments can cause unexpected downtime. Test module upgrade commands in a test environment before you upgrade modules in production.-
Use
keep_redis_version
to upgrade the modules without upgrading the database to the latest Redis version.keep_redis_version
is deprecated as of Redis Enterprise Software version 7.8.2. To upgrade modules without upgrading the Redis database version, setredis_version
to the current Redis database version instead. -
To specify the modules to upgrade, add the following for each module:
and module module_name <module_name> version <new_module_version_number> module_args "<module arguments>"
For the module arguments, use one of the following:
-
module_args "<module_arguments>"
to replace the existing module arguments. -
module_args ""
without arguments to remove the existing module arguments. -
module_args keep_args
to use the existing module arguments.
-
-
Examples for Redis Software v7.8.2 and later
The following module upgrade examples are supported for Redis Enterprise Software versions 7.8.2 and later:
-
Keep the current Redis database version, which is 7.2 in this example, and upgrade to the latest version of the enabled modules:
rladmin upgrade db shopping-cart redis_version 7.2
-
Upgrade the database to use the latest version of Redis and the latest versions of the enabled modules:
rladmin upgrade db shopping-cart
Deprecated examples
As of Redis Enterprise Software version 7.8.2, the following module upgrade examples are deprecated but still supported.
-
Keep the current version of Redis and upgrade to the latest version of the enabled modules:
rladmin upgrade db shopping-cart keep_redis_version latest_with_modules
-
Upgrade the database to the latest Redis version and upgrade RediSearch to 1.6.7 with the specified arguments:
rladmin upgrade db shopping-cart and module db_name shopping-cart module_name ft version 10607 module_args "PARTITIONS AUTO"
-
Upgrade the database to the latest Redis version and upgrade RedisBloom to version 2.2.1 without arguments:
rladmin upgrade db db:3 and module db_name shopping-cart module_name bf version 20201 module_args ""
-
Upgrade RedisJSON to 1.0.4 with the existing arguments and RedisBloom to version 2.2.1 without arguments:
rladmin upgrade module db_name MyDB module_name ReJSON version 10004 module_args keep_args and module db_name MyDB module_name bf version 20201 module_args ""
-
Upgrade the database to use the latest version of Redis and use the latest version of the enabled modules:
rladmin upgrade db shopping-cart latest_with_modules
On this page