Redis的配置文件中可以额外包含多个配置文件,我们可以从示例配置文件中的注释一窥究竟:
Include one or more other config files here. This is useful if you have a standard template that goes to all Redis servers but also need to customize a few per-server settings. Include files can include other files, so use this wisely.
在这里包含一个或多个其他配置文件。这是有用的,如果你有一个标准的模板匹配所有的Redis服务器,但也需要自定义一些不同服务器的设置。Include文件指令可以包含其他文件,要明智地使用它。
Notice option "include" won't be rewritten by command "CONFIG REWRITE" from admin or Redis Sentinel. Since Redis always uses the last processed line as value of a configuration directive, you'd better put includes at the beginning of this file to avoid overwriting config change at runtime.If instead you are interested in using includes to override configuration options, it is better to use include as the last line.
注意include指令不会被admin或Redis Sentinel的命令“CONFIG REWRITE”重写。因为Redis总是使用最新处理的行作为配置指令的值,你最好把include放在这个文件的开头,以避免在运行时覆盖配置更改。如果您对使用include来覆盖配置选项感兴趣,那么最好将include作为最后一行。
可以使用以下指令包含以下两个配置文件
include /path/to/local.conf
include /path/to/other.conf
上一条:Redis官方可视化工具
下一条:一文读懂Redis