方式一:修改配置文件 notify-keyspace-events Ex 重启redis,看配置是否生效 执行 CONFIG GET notify-keyspace-events ,如果有返回值证明配置成功 方式二:执行命令 CONFIG SET notify-keyspace-events "Ex"