1. Configuration

    1. Broker Configs

    2. 설정파일 : $KAFKA_HOME/config/server.properties

    3. 반드시 설정해야 하는 3가지

      1. broker.id

      2. log.dirs

      3. zookeeper.connect

    4. Topic-level configurations

      1. Log Basics

        1. log.dirs : 로그데이터 저장 디렉토리, 설정하지 않을 경우 log.dir 에 설정된 곳 사용

        2. num.partitions : number of log partitions per topic

        3. num.recovery.threads.per.data.dir

      2. Log Retention

        1. log.retention.hour : 로그 수명, 설정된 수명이 지나면 삭제
      3. Zookeeper 관련

        1. zookeeper.connect : zookeeper connection string

          1. ex> single : zookeeper.connect=localhost:2181

          2. ex> cluster : zookeeper.connect=127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002

        2. zookeeper.connection.timeout.ms : zookeeper 커넥션 타임아웃 시간 설정

  2. Producer Configs

    1. bootstrap.servers

      1. 초기 클러스터 연결 시 사용, 최초 전체 서버를 찾는데 사용함

      2. ex> bootstrap.servers=kafka1:9092,kafka2:9092,kafka3:9002

    2. compression.type : 메시지 압축포맷 ( none, gzip, snappy, lz4 )

    3. acks

      1. acks=0

        1. 서버에서 수신확인 (acknowledgment)을 기다리지 않음 (will not wait)

        2. 서버가 record를 수신했다는 보장을 할 수 없고 (no guarantee), retries configuration 설정도 적용되지 않음

      2. acks=1

        1. leaer가 레코드를 자신의 로컬 로그에 쓰고 follower로 부터 수신확인(acknowledgment)을 기다리지 않고 응답
        2. follower가 record를 복제하기전 이면 record는 없어질 수 있음
      3. acks=all

        1. leader는 레코드가 동기로 복제되고 알림이 오기를 기다림, 최소한 하나의 복제가 살아있는 한 레코드가 소실되지 않는 것을 보장함. ( This means the leader will wait for the full set of in-sync replicas to acknowledge the record )
    4. linger.ms

      1. 특정시간 동안 버퍼링해서 묶어서 하나의 배치 요청으로 보내는 것, 지정된 값 만큼 record전송을 지연하지만 bach.size에 도달하면 전송함

      2. time based batching

    5. batch.size

      1. 동일파티션에 여러개의 레코드가 보내질때 지정된 크기보다 작으면, 지정된 사이즈만큼 모아서 전송

      2. size based batching

    6. retries

      1. producer가 레코드를 보낼 때 에러가 발생 시 재시도 횟수 설정값, 재시도시 잠재적으로 순서가 바뀔 수 있음 ( will potentially change the ordering of records)
    7. max.in.flight.requests.per.connection

      1. client가 blocking 되기 전에 단일 커넥션에 보낼 답을 받지 못한 최대 요청 수
      2. 1보다 큰 값이고 실패한 보내기가 있다면, 재시도 때문에 메시지 정렬 이슈가 있음
  3. Consumer Configs

    1. 설정파일 위치 : $KAFKA_HOME/config/consumer.properties

    2. bootstrap.servers

    3. group.id : consumer gropu id

    4. zookeeper.connect : zookeeper connection string

    5. New Consumer Configs

    6. Old Consumer Configs

  4. Kafka Connect Configs

  5. Kafka Streams Configs

  6. 참고사이트

    1. https://github.com/PerfectBlueRain/study_Kafka/blob/master/KafKa_운영.md

    2. http://webcache.googleusercontent.com/search?q=cache:gB0kuemZWXUJ:d2.naver.com/helloworld/7731491+&cd=1&hl=en&ct=clnk≷=kr

    3. http://free-strings.blogspot.kr/2016/04/producer.html

    4. producer performance tuning : https://www.slideshare.net/JiangjieQin/producer-performance-tuning-for-apache-kafka-63147600

    5. producer 성능향상 : http://ingest.tips/2015/07/19/tips-for-improving-performance-of-kafka-producer/

results matching ""

    No results matching ""