Spring boot项目中Redis服务禁用config命令
背景
有些项目的安全要求,禁用Redis的config命令,造成spring boot项目的调用异常
运维操作
在redis.conf文件中禁用config命令
解决方案
在springboot 的RedisConf中增加以下代码配置,初始化Bean
@Bean
public static ConfigureRedisAction configureRedisAction() {
return ConfigureRedisAction.NO_OP;
}