DEV_희쨔응
Apache Flume(Kafka To File) 본문
위와 같은 데모 시나리오로 테스트 서버에 개발/테스트 완료 하였습니다.
Kafka Topic의 데이터를 Flume을 사용하여 Consume 한 후 지정된 디렉터리에 File형식으로 적재하는 시나리오 입니다.
Flume Kafka 컨슈머 소스
agent_heejae.sources = kafka_src
agent_heejae.channels = mem_chnl
agent_heejae.sinks = file_sink
agent_heejae.sources.kafka_src.channels = mem_chnl
agent_heejae.sources.kafka_src.type = org.apache.flume.source.kafka.KafkaSource
agent_heejae.sources.kafka_src.kafka.topics = local-topic
agent_heejae.sources.kafka_src.kafka.bootstrap.servers = IP:9092
agent_heejae.sources.kafka_src.kafka.consumer.client.id = heejae
agent_heejae.sources.kafka_src.kafka.consumer.group.id = local-group
agent_heejae.sources.kafka_src.kafka.consumer.auto.offset.reset = earliest
agent_heejae.channels.mem_chnl.type = memory
agent_heejae.channels.mem_chnl.capacity = 10000
agent_heejae.channels.mem_chnl.transactionCapacity = 1000
agent_heejae.sinks.file_sink.type = file_roll
agent_heejae.sinks.file_sink.channel = mem_chnl
agent_heejae.sinks.file_sink.sink.rollInterval = 0
agent_heejae.sinks.file_sink.sink.directory = /usr/local/apache-flume-1.10.1-bin/conf
agent_heejae.sinks.file_sink.sink.pathManager.prefix = kafka_
agent_heejae.sinks.file_sink.sink.pathManager.extension = log
Kafka Topic 데이터 확인 (Kafdrop)
Flume 실행 화면
적재된 File 확인
'Kafka' 카테고리의 다른 글
API to PostgreSQL 연동 (AirFlow, Kafka) (0) | 2023.06.09 |
---|---|
Kafkaconnector(MysqlCDC To Impala&Kudu)-Confluent (0) | 2023.03.02 |
Kafkaconnector(MysqlCDC To Impala&Kudu) (0) | 2023.02.22 |
Kcat(Kafkacat) (3) | 2023.02.20 |
MariaDB to Elasticsearch (0) | 2023.01.30 |
Comments