sentinel cluster and redis on it, when there is change to the master, this issue happen, you cannot solve it 100%, On practice, you need to ensure that redis client is able to tolerate the failure, work on safe mode, on certain exceptions it may retry few attempts before giving up or make it up. To know who is master, ask sentinel, to check master readyness, use HA proxy, https://www.haproxy.com/blog/haproxy-advanced-redis-health-check/ If the above error occurs, it means that the current redis service is read-only and has no write permission. It is estimated that the service is used as a slave database. solution: redis-cli slaveof no one Because the master-slave replication cluster was configured before, the configuration was changed disorderly There are two solutions: 1. Open the configuration file corresponding to the redis service, and change the value of the attribute slave read-only to no, so that it can be written. 2. Open the client mode through the Read More:Ankit Guptaunread, Dec 14, 2021, 6:37:45 AM12/14/21 to Redis DB Hi Experts, We are using redis version 5.x, and using sentinel based architecture. Below is the setup N1(M) / \ / \ N2(S) N3(S) N1 got crashed , and due to failover N3 was promoted as a new master. After sometime when N1 was recovered & joined the setup/cluster as slave it requested for a full re-synchronization from N3(present master) due to which BGSave was invoked. During this process any request on master , was giving below error: org.springframework.data.redis.connection.RedisPipelineException: Pipeline contained one or more
invalid commands; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: READONLY You can't write against a read only replica.; nested exception is redis.clients.jedis.exceptions.JedisDataException: READONLY You can't write against a read only replica. We have few queries around this 1. Are we getting this error because master was busy in serving any other request? 2. Is there a configuration we can do so that if another slave is already connected then new node should do sync from existing slave? 3. Is this the expected behaviour? Thanks in advance. -Ankit Vivek Mishraunread, Jul 22, 2022, 1:13:25 PMJul 22 to Redis DB
Ankit Guptaunread, Aug 28, 2022, 7:46:54 AMAug 28 to Redis DB Hi All, We received this error again in our production setup. Surprisingly there's nothing revealed in the redis.log or even in sentinel.log. If someone has someone faced similar issue, then you're help on this much appreciated. Ankit Guptaunread, Aug 28, 2022, 7:48:00 AMAug 28 to Redis DB Hi Vivek, Has the issue resolved after this fix ? Can you please share the steps that you followed for this ? On Saturday, July 23, 2022 at 1:43:25 AM UTC+5:30 Vivek Mishra wrote: Ankit Guptaunread, Sep 4, 2022, 10:19:59 PMSep 4 to Redis DB Hi Team, Has anyone faced such an issue. Can this be an issue with # of connections or sentinel overload or client library ?
Syntax READONLYAvailable since:3.0.0Time complexity:O(1)ACL categories: @fast , @connection ,Enables read queries for a connection to a Redis Cluster replica node. Normally replica nodes will redirect clients to the authoritative master for the hash slot involved in a given command, however clients can use replicas in order to scale reads using the
When the connection is in readonly mode, the cluster will send a redirection to the client only if the operation involves keys not served by the replica's master node. This may happen because:
ReturnSimple string reply FeedbackIf you've found issues on this page, or have suggestions for improvement, please submit a request to merge or open an issue in the repository. |