CONFIG 命令查看或设置配置项。
 CONFIG get * 所有的
 CONFIG get XXX
 CONFIG set XXX YYY (设置XXX = YYY)

示例

#设置配置
config set notify-keyspace-events Egx
#查看配置
config get notify-keyspace-events
#客户端方式
redis-cli config set notify-keyspace-events Egx
#
redis-cli config get notify-keyspace-events

#重启redis配置生效

note(小问题)

Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in class path resource

在spring boot中,我们使用了注解:@EnableRedisHttpSession,这个注解是用来开启Redis来集式式管理Session。 而在使用这种方式的时候,是需要Redis开启Keyspace Notifications功能的,默认是关闭的。 这个功能有一个参数来控制它,notify-keyspace-events,值为Egx。

  

 

相关文章:

  • 2021-11-14
  • 2021-06-30
  • 2021-09-04
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
  • 2021-12-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2022-12-23
  • 2021-09-07
  • 2022-12-23
相关资源
相似解决方案