lonelysoul011 发表于 2015-05-17 21:53

redis 不小心运行了 slaveof get 2 导致连接错误

我的redis 单机环境。 今天用 ./redis-cli 连上去后不小心运行了    SLAVEOF get 2    本来是想运行SLOWLOG get 2
运行后各client 就开始报错了,错误如下:
read client org.springframework.data.redis.RedisConnectionFailureException: java.net.SocketTimeoutException: Read timed out; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed outwrite client org.springframework.dao.InvalidDataAccessApiUsageException: READONLY You can't write against a read only slave.; nested exception is redis.clients.jedis.exceptions.JedisDataException: READONLY You can't write against a read only slave.各位有好的解决办法没? 我用的笨方法,将业务停掉, 重启 redis

renxiao2003 发表于 2015-07-08 22:29

这样不是最好的解决办法吧。如果业务系统在运行呢。

cjfeii 发表于 2016-04-22 16:25

没有看懂问题、、、

cjfeii 发表于 2016-04-22 16:31

明白了,但是也不用重启redis啊,直接用redis-cli执行 slaveof no one 不就可以了吗?

cjfeii 发表于 2016-04-22 16:32

执行过slave no one之后,该redis实例的role就是master了,就可以写了
页: [1]
查看完整版本: redis 不小心运行了 slaveof get 2 导致连接错误