您的位置:首页 > 数据库 > Redis

远程启动Redis,报错不能配置键空间通知(keyspace notifications)

2017-06-07 08:40 1386 查看
启动服务器上面的redis,报错:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in class path resource [org/springframework/session/data/redis/config/annotation/web/http/RedisHttpSessionConfiguration.class]:
Invocation of init method failed; nested exception is java.lang.IllegalStateException:
Unable to configure Redis to keyspace notifications. See http://docs.spring.io/spring-session/docs/current/reference/html5/#api-redisoperationssessionrepository-sessiondestroyedevent
在网上找了好久的原因

1.redis.conf文件中修改  bind为0.0.0.0,

2.

1、修改reids配置文件(redis.conf)
redis默认不会开启keyspace notifications,因为开启后会对cpu有消耗
备注:
E:keyevent事件,事件以__keyevent@<db>__为前缀进行发布;
x:过期事件,当某个键过期并删除时会产生该事件;
配置如下:
notify-keyspace-events "Ex"


3.sentinel.conf中加入    protected-mode no

然而都不管用 ,依然报之前的错

最后在启动redis的时候用命令  redis-server ../redis.conf   即在原来的命令后面加上配置文件,然后可以了!!

pro

tected-mode no  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  redis 服务器
相关文章推荐