redis:在运行时启用已禁用的命令

redis:在运行时启用已禁用的命令

这是centos上redis 2.8.13的生产实例。

在我们的 redis.conf 中,我们有以下内容:

rename-command CONFIG ""

现在......我们要运行延迟监视器,这需要使用 CONFIG 命令。

我们有 root 权限,这是我们自己的专用服务器。是否可以在不重新启动 redis 的情况下修改 conf 文件并重新加载配置?(这是一个生产系统)

答案1

redis 没有办法在不重启的情况下重新加载 redis.conf。您需要重启 redis。

这次,请仔细注意示例和 redis.conf 中给出的警告:

# Command renaming.
#
# It is possible to change the name of dangerous commands in a shared
# environment. For instance the CONFIG command may be renamed into something
# hard to guess so that it will still be available for internal-use tools
# but not available for general clients.
#
# Example:
#
# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52
#
# It is also possible to completely kill a command by renaming it into
# an empty string:
#
# rename-command CONFIG ""
#
# Please note that changing the name of commands that are logged into the
# AOF file or transmitted to slaves may cause problems.

相关内容