The ContextYour production Redis master just went into a sudden read-only mode. Every application request trying to update a key is hitting a wall with this error: NOREPLICAS Not enough good replicas to write.
Think of this as a safety lock. It happens when you’ve configured Redis for high consistency using the min-replicas-to-write directive. Redis is refusing to accept data because it can't guarantee that the update will be mirrored to enough healthy replicas. It would rather stop working than risk losing data during a failover.
The Debugging ProcessStart by checking the replication health directly on your master node. Run this command in your terminal:
redis-cli -h <master-ip> -p 6379
> INFO replication
Look closely at the output. You might see something like this:
# Replication
role:master
connected_slaves:1
slave0:ip=10.0.1.5,port=6379,state=online,offset=12345,lag=15
min_slaves_good_slaves:0
The smoking gun here is min_slaves_good_slaves:0. Even though one replica shows as "online," its lag has spiked to 15 seconds. Redis only counts a replica as "good" if its heartbeat lag is lower than your min-replicas-max-lag threshold.
Now, verify your current limits:
> CONFIG GET min-replicas-to-write
1) "min-replicas-to-write"
2) "2"
> CONFIG GET min-replicas-max-lag
1) "min-replicas-max-lag"
2) "10"
In this example, Redis is waiting for 2 healthy replicas with less than 10 seconds of lag. Since we only have one replica and it's 15 seconds behind, the master has locked down to protect data integrity.
The Solutions### 1. The Emergency "Stop the Bleeding" FixIf your app is down and you need to restore service immediately, you can temporarily disable the health check. This is a trade-off: you get your site back up, but you risk losing data if the master crashes before it can sync to a replica.
> CONFIG SET min-replicas-to-write 0
This command takes effect instantly without a restart. Use it as a temporary bridge while you troubleshoot the underlying infrastructure.
2. Fix the Underlying Replica HealthTo solve this properly, you need to find out why your replicas are struggling. SSH into your replica nodes and check the logs:
tail -n 100 /var/log/redis/redis-server.log
I usually look for these four culprits:
- Network Congestion: High latency between AWS availability zones or data centers can cause heartbeats (replconf acks) to arrive late.- Memory Pressure: If the replica is hitting 95% RAM usage and swapping to disk, it won't respond to the master in time.- CPU Spikes: Heavy
KEYS *commands or intensive Lua scripts can block the Redis event loop.- Large Persistence Tasks: A massive RDB snapshot or AOF rewrite can make a replica unresponsive for several seconds.### 3. Adjust for Network RealityIf your nodes are spread across different cloud regions (e.g., us-east-1 to us-west-2), a 10-second lag limit might be too strict. You can make yourredis.confmore resilient to minor network hiccups:
# In redis.conf
min-replicas-to-write 1
min-replicas-max-lag 20
Don't forget: CONFIG SET only changes the running instance. Always update the physical config file so the settings survive a reboot.
VerificationAfter fixing the replicas or relaxing the settings, run INFO replication again. You want to see min_slaves_good_slaves meet or exceed your requirement. Test it with a simple write:
> SET health_check "ok"
OK
If you see OK, the write block is officially lifted.

