복붙노트

[REDIS] 새로운 레디 스 마스터가 센티넬를 사용하는 클라이언트를 확인하는 방법

REDIS

새로운 레디 스 마스터가 센티넬를 사용하는 클라이언트를 확인하는 방법

나는 정보의 일부 중요한 부분을 누락처럼 좋아, 느낌.

로컬 나는 한 마스터 1 개 슬레이브 레디 스 서버는 서로 다른 포트에서 실행 한 http://redis.io/topics/sentinel

또한 3 센티넬을 가지고 있고 그들은 모두 서로를 인식하고 예상대로 작동 될 것으로 보인다.

나의 주인 레디 스 서버가 어디 있는지 지금은 127.0.0.1:6379에 자바 코드 가리키는 큰 있습니다.

내가 마스터를 쓰러 트릴 경우 새 마스터가 켜져 이제 마스터 슬레이브를 홍보 예상대로 감시는 모든 것을 않습니다

127.0.0.1:6380

내 질문은 내 코드는 다음과 오토 스위치를 알고 있나요 어떻게?

해결법

  1. ==============================

    1.당신은 그들의 pubsub 채널 중 하나에 메시지를 감시에 가입해야합니다. 당신은 당신이 감시 같은 메시지를 게시 할 것이라는 점을 게시하는 링크에서 볼 수 있습니다

    당신은 그들의 pubsub 채널 중 하나에 메시지를 감시에 가입해야합니다. 당신은 당신이 감시 같은 메시지를 게시 할 것이라는 점을 게시하는 링크에서 볼 수 있습니다

    +odown <instance details> -- The specified instance is now in Objectively Down state.
    -odown <instance details> -- The specified instance is no longer in Objectively Down state.
    +failover-takedown <instance details> -- 25% of the configured failover timeout has elapsed, but this sentinel can't see any progress, and is the new leader. It starts to act as the new leader reconfiguring the remaining slaves to replicate with the new master.
    +failover-triggered <instance details> -- We are starting a new failover as a the leader sentinel.
    

    당신이 그 채널 중 하나에 게시 센티넬 볼 때, 당신은 메시지를 분석하고 그에 따라 클라이언트 응답이 필요합니다. 레디 스 스마트 아니다 - 당신이 클라이언트 라이브러리를 사용하여 이러한 일을 처리 할 수 ​​있습니다.

    구체적으로는, 가장 유용한 채널은

    +odown
    +failover-detected
    +switch-master
    
  2. from https://stackoverflow.com/questions/15437334/how-to-tell-a-client-where-the-new-redis-master-is-using-sentinel by cc-by-sa and MIT license