2017-09-21 1 views
0

나는 카프카에게 아주 새로운 사람이다. 그래서이 질문은 매우 기초적 일 수 있습니다. 내가 달성하려는 것은 중개인이 실패하고 다시 추가 될 때 재조정에 걸리는 시간을 알아내는 것입니다. 설명서를 읽은 후 (http://kafka.apache.org/documentation/#basic_ops_restarting). 브로커가 실패하거나 유지 보수를 위해 내려올 때카프카 재조정에 걸리는 시간은 어떻게 측정합니까?

  • It will sync all its logs to disk to avoid needing to do any log recovery when it restarts (i.e. validating the checksum for all messages in the tail of the log). Log recovery takes time so this speeds up intentional restarts.

  • It will migrate any partitions the server is the leader for to other replicas prior to shutting down. This will make the leadership transfer faster and minimize the time each partition is unavailable to a few milliseconds. 내가 migrate any partitions that the server is the leader for to other replicas

    내 카프카에 걸리는 시간을 알 수있다 수행 할 작업을

설치는 3 개의 브로커 노드와 3 개의 zk 노드입니다.

또한이 노드를 auto.rebalance=true 속성에 다시 추가하면 재조정이 다시 시작되어 리더를 다시 선출합니다. 이 시간도 어떻게 측정합니까?

답변

0

데이터 복사본과 같이 "마이그레이션"이 없습니다. 브로커를 깔끔하게 종료 할 때 컨트롤러는 브로커가 선두였던 모든 파티션에 대해 사용 가능한 복제본에서 새로운 리더를 선출하여 전환을 빠르게 만듭니다.

리더십 선거를 모니터링 할 수있는 몇 가지 측정 항목이 있습니다.

kafka.controller:type=ControllerStats,name=AutoLeaderBalanceRateAndTimeMs 

이는 속도와 자동 리더 재조정의 기간을 추적합니다 은 0.11.0.0 때문에 브로커가 포함 컨트롤러 메트릭의 수를 표시합니다. 0.11에 추가 된 컨트롤러 메트릭의 전체 목록은 측정 도구에서 사용할 수 있습니다 :

: 당신은 이전 버전 (< 0.11.0.0)를 실행하는 경우 https://cwiki.apache.org/confluence/display/KAFKA/KIP-143%3A+Controller+Health+Metrics#KIP-143:ControllerHealthMetrics-ControllerMetrics

, 당신은 같은 통계에 의존해야합니다

kafka.controller:type=ControllerStats,name=LeaderElectionRateAndTimeMs 

여기에는 모든 리더 선거가 포함됩니다.

관련 문제