Redis
-
[Redis] 서비스 고가용성을 위한 ReplicaDataBase/NoSQL 2023. 2. 19. 15:24
RDB를 사용하거나 AOF를 사용하는 백업방식은 disk에 있는 파일로부터 Redis를 복구하는 방법인데, 백업만으로는 백업 실패 가능성도 있고 복구에 시간도 꽤 소요되는 등 장애 대비에 부족한 측면이 있다. 하지만 Redis 복제를 하면 가용성을 확보할 수 있을 뿐만 아니라 빠른 장애조치가 가능하다. master가 죽었을 경우 복제본(replica)중 하나를 master로 승격시켜 즉시 서비스 정상화가 가능하기 때문이다. replica는 read-only 모드로 사용하는 것이 권장된다. 입력/수정/삭제가 가능하다면 데이터 무결성이 보장되지 않기 때문이다. 또, 하드웨어적인 문제 발생을 대처하기 위해 master와 replica는 물리적으로 다른 머신에 두어야 한다. 아래는 docker를 이용해서 ..