Redis-Standalone Hands-on Guide on Kubernetes ③


Failover test

🖧 1. Redis-Standalone Pod diagram (initial)

┌──────────────┐ │ Redis(220) │ │ 🟢Master │ └──────────────┘

1. Failover test

Take Redis-0 down. There is no replica.
💥 After delete/restart the Pod IP changes.

Redis-0 💥 down (delete)

💻 Terminal-1

💻 Redis-0 LOG

① 15s: got kill signal, Redis down (+0s)
② 18s: Redis auto-restart (+3s)
③ 22s: data load complete (~5s) (+7s)
④ 22s: Redis ready (+7s)

📄 redis.log

Full Redis-0 log ▼
📄 redis.log

💻 App log

① 15s: connection lost -> reconnect fails (+0s)
② 19s: after 5 retries, FAIL (+4s)
③ 24s: reconnect fails (+9s)
④ 32s: reconnect succeeds (+17s)
⑤ 32s: writes succeed (+17s)

💻 Terminal-2

Full App log ▼
📄 Full App log

🧮 After failover

Redis-0 IP changed from 10.42.0.220 to 10.42.0.222.

💻 Terminal-1

🖧 Redis-Standalone Pod diagram (after failover)

┌──────────────┐ │ Redis(222) │ │ 🟢Master │ └──────────────┘

🧑‍💻 Conclusion

Redis-Standalone failover test succeeded.
Deleting/restarting the Pod changes its IP. After about 17s the app reconnects and writes again.
If ~30s of downtime is acceptable, Redis-Standalone can be an option.


➡ Up to here we tested Redis-Standalone by itself.
Click here to see it working with a Java (Spring) app.



<< K8s Redis-Standalone ② K8s Redis Scale-Out >>

Email 답글이 올라오면 이메일로 알려드리겠습니다.