Redis SENTINEL SIMULATE-FAILURE

Redis Sentinel 教育
Redis Sentinel Course
Redis 定期点検/技術支援
Redis Technical Support
Redis エンタープライズサーバ
Redis Enterprise Server

Redis SENTINEL SIMULATE-FAILURE

장애조치 진행중 시뮬레이션 목적으로 센티널 리더를 다운시킨다.
센티널 장애조치(failover)를 다음과 같이 8단계로 나누어볼 수 있는데, 이 중 두 시점에서 다운 시킬 수 있다.

1. 주관적 다운(sdown)
2. 객관적 다운(odown)
3. 센티널 리더 선출(elected-leader)
4. 슬레이브 선정(selected-slave)
5. 선정된 슬레이브 마스터로 승격(promoted-slave)
6. 다른 슬레이브가 새 마스터를 바라보도록 명령 수행(slave-reconf-done)
7. 센티널 내 정보 갱신, 새로운 모니터링 시작(failover-end, switch-master, update_config)
8. 장애조치 완료.

첫 번째 시점은 3번 장애조치를 주관할 센티널 리더를 선출한 직후
두 번째 시점은 5번 선정된 슬레이브를 마스터로 승격시킨 직후이다.


사용법

명령: SENTINEL SIMULATE-FAILURE [flag]

  • crash-after-election: 3번 장애조치를 주관할 센티널 리더를 선출한 직후 다운.
    127.0.0.1:7111> sentinel simulate-failure crash-after-election
    OK
    명령 실행 후 센티널 로그에 남는 메시지
    # Failure simulation: this Sentinel will crash after being successfully elected as failover leader
  • crash-after-promotion: 5번 선정된 슬레이브를 마스터로 승격시킨 직후 다운.
    127.0.0.1:7111> sentinel simulate-failure crash-after-promotion
    OK
    명령 실행 후 센티널 로그에 남는 메시지
    # Failure simulation: this Sentinel will crash after promoting the selected slave to master
  • 취소하려면 플레그를 주지 않고 명령 실행한다.
    127.0.0.1:7111> sentinel simulate-failure
    OK
  • 확인은 info sentinel 명령을 실행하면 조회되는 항목에 sentinel_simulate_failure_flags이다.
    1은 crash-after-election
    2은 crash-after-promotion
    0은 초기화
    127.0.0.1:7111> info sentinel
    # Sentinel
    sentinel_masters:1
    sentinel_tilt:0
    sentinel_running_scripts:0
    sentinel_scripts_queue_length:0
    sentinel_simulate_failure_flags:2
    master0:name=Xmaster,status=ok,address=127.0.0.1:7124,slaves=3,sentinels=2,quorum=3
  • help: 위 두 가지 플레그를 보여준다.
    127.0.0.1:7111> sentinel simulate-failure help
    1) "crash-after-election"
    2) "crash-after-promotion"

명령문

SENTINEL SIMULATE-FAILURE crash-after-election/crash-after-promotion

  • 이 명령은 version 2.8.0 부터 사용할 수 있다.
  • 이 문서는 버전 3.2.2을 기준으로 만들었다.

Clients for Java Jedis, Lettuce
Clients for C Hiredis

<< SENTINEL CKQUORUM SIMULATE-FAILURE SENTINEL SET >>

조회수 :

Email 返事がかかってなれば、メールでお知らせします。