Conclusion

  1. Why do this study: clean cache 時發生後端service無法寫入redis問題。
  2. If 硬解(把slave設成可寫),可能發生數據不一致
  3. 最可能解法: 把STAGINGredis的部署模式調成跟TEST一樣。

Part 1 - stackoverflow

stackoverflow-Redis sentinel not connect to master: Error: READONLY You can't write against a read only slave?

image


Part 2 - GPT

Title: redis disable read-only mode on slave node
GPT: Disable Redis Slave Read-Only

aka. make the slave writable

not recommand in a production environment because it can lead to data inconsistency issues.

Action - Update the ConfigMap or Secret

apiVersion: v1
kind: ConfigMap
metadata:
  name: redis-config
data:
  redis.conf: |
    ...
    replica-read-only no
    ...


Part 3 - concept & in action(實戰)

baeldung-redis sentinel hign availability on Kubernetes

(實戰) Highly Available Redis Cluster in Action

image

Keyword

Bitnami Explain

image