解决Redis服务出于安全会禁用CONFIG命令后服务不可用的问题

This commit is contained in:
648540858 2021-12-08 20:56:07 +08:00
parent 5c9c112fd2
commit 4d4d274e9b
4 changed files with 6 additions and 17 deletions

View File

@ -30,6 +30,8 @@ public class KeepaliveTimeoutListenerForPlatform extends KeyExpirationEventMessa
public KeepaliveTimeoutListenerForPlatform(RedisMessageListenerContainer listenerContainer) { public KeepaliveTimeoutListenerForPlatform(RedisMessageListenerContainer listenerContainer) {
super(listenerContainer); super(listenerContainer);
// 配置springboot默认Config为空即不让应用去修改redis的默认配置因为Redis服务出于安全会禁用CONFIG命令给远程用户使用
setKeyspaceNotificationsConfigParameter("");
} }

View File

@ -30,6 +30,8 @@ public class KeepliveTimeoutListener extends KeyExpirationEventMessageListener {
public KeepliveTimeoutListener(RedisMessageListenerContainer listenerContainer) { public KeepliveTimeoutListener(RedisMessageListenerContainer listenerContainer) {
super(listenerContainer); super(listenerContainer);
// 配置springboot默认Config为空即不让应用去修改redis的默认配置因为Redis服务出于安全会禁用CONFIG命令给远程用户使用
setKeyspaceNotificationsConfigParameter("");
} }
/** /**

View File

@ -29,6 +29,8 @@ public class ZLMKeepliveTimeoutListener extends KeyExpirationEventMessageListene
public ZLMKeepliveTimeoutListener(RedisMessageListenerContainer listenerContainer) { public ZLMKeepliveTimeoutListener(RedisMessageListenerContainer listenerContainer) {
super(listenerContainer); super(listenerContainer);
// 配置springboot默认Config为空即不让应用去修改redis的默认配置因为Redis服务出于安全会禁用CONFIG命令给远程用户使用
setKeyspaceNotificationsConfigParameter("");
} }
/** /**

View File

@ -27,21 +27,6 @@ public class ZLMOnlineEventListener implements ApplicationListener<ZLMOnlineEven
private final static Logger logger = LoggerFactory.getLogger(ZLMOnlineEventListener.class); private final static Logger logger = LoggerFactory.getLogger(ZLMOnlineEventListener.class);
@Autowired
private IVideoManagerStorager storager;
@Autowired
private RedisUtil redis;
@Autowired
private SipConfig sipConfig;
@Autowired
private UserSetup userSetup;
@Autowired
private IMediaServerService mediaServerService;
@Autowired @Autowired
private IStreamPushService streamPushService; private IStreamPushService streamPushService;
@ -59,7 +44,5 @@ public class ZLMOnlineEventListener implements ApplicationListener<ZLMOnlineEven
streamPushService.zlmServerOnline(event.getMediaServerId()); streamPushService.zlmServerOnline(event.getMediaServerId());
streamProxyService.zlmServerOnline(event.getMediaServerId()); streamProxyService.zlmServerOnline(event.getMediaServerId());
} }
} }