Caused by: redis.clients.jedis.exceptions.JedisDataException: READONLY You can't write against a read only slave.
Caused by: redis.clients.jedis.exceptions.JedisDataException: READONLY You can't write against a read only slave. at redis.clients.jedis.Protocol.processError(Protocol.java:127) ~[jedis-2.9.0.jar:na] at redis.clients.jedis.Protocol.process(Protocol.java:161) ~[jedis-2.9.0.jar:na] at redis.clients.jedis.Protocol.read(Protocol.java:215) ~[jedis-2.9.0.jar:na] at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:340) ~[jedis-2.9.0.jar:na] at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:239) ~[jedis-2.9.0.jar:na] at redis.clients.jedis.BinaryJedis.setex(BinaryJedis.java:616) ~[jedis-2.9.0.jar:na] at org.springframework.data.redis.connection.jedis.JedisConnection.setEx(JedisConnection.java:1418) ~[spring-data-redis-1.8.4.RELEASE.jar:na] ... 73 common frames omitted
这是因为连接的是从节点,从节点只有读的权限,没有写的权限
解决办法:
进入redis的redis.conf配置文件,修改配置文件的slave-read-only为no
-----------------------有任何问题可以在评论区评论,也可以私信我,我看到的话会进行回复,欢迎大家指教------------------------
(蓝奏云官网有些地址失效了,需要把请求地址lanzous改成lanzoux才可以)