feat: Redis Sentinel 기반 자동 Failover 구성 - #19
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경 사항
장애 대응 구조
Redis Master 장애 시 바로 Redis 복구를 기다리지 않고
Circuit Breaker와 MySQL Fallback으로 사용자 요청을 처리한다.
동시에 Sentinel이 Master 장애를 감지해
Replica 하나를 새로운 Master로 승격한다.
애플리케이션은 Sentinel을 통해 새 Master를 탐색하고
Redis Cache 경로로 자동 복귀한다.
실험 조건
결과
redis-replica-1redis-replica-2Master 장애 직후 Circuit Breaker와 MySQL Fallback이 동작했고,
Sentinel Failover 이후 Cache Hit 경로가 자동 복구됐다.
한계
독립 Failure Domain을 구성한 실제 운영 환경과는 차이가 있다.