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。