# Conclusion 1. Why do this study: clean cache 時發生後端service無法寫入redis問題。 2. If 硬解(把slave設成可寫),可能發生**數據不一致**。 3. 最可能解法: 把`STAGING`redis的部署模式調成跟`TEST`一樣。 # Part 1 - stackoverflow [stack**overflow**-Redis sentinel not connect to master: Error: READONLY You can't write against a read only slave?](https://stackoverflow.com/questions/42810115/redis-sentinel-not-connect-to-master-error-readonly-you-cant-write-against-a) :::spoiler ![image](https://hackmd.io/_uploads/Bkusk9ytA.png) ::: --- # Part 2 - GPT Title: redis disable read-only mode on slave node GPT: [Disable Redis Slave Read-Only](https://chatgpt.com/share/d5b49c51-f488-48a5-be67-e2c48e003009) ``` aka. make the slave writable ``` :::danger 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](https://www.baeldung.com/ops/redis-sentinel-kubernetes-high-availability) ## (實戰) Highly Available Redis Cluster in Action :::spoiler ![image](https://hackmd.io/_uploads/H1LdQOyK0.png) ::: ### Keyword `Bitnami` `Explain` :::spoiler ![image](https://hackmd.io/_uploads/SJhRrdJtA.png) :::