简体   繁体   English

如何使用Flume将主题从kafka转换为kafka?

[英]How sink topic, kafka to kafka, using Flume?

I am trying transfer log from topic to another topic. 我正在尝试将日志从主题转移到另一个主题。 I need connect Kafka to Kafka using Flume. 我需要使用Flume将Kafka连接到Kafka。 Take a look below: 看下面:

#
# Flume Conf
#

a1.sources = s1
a1.sinks = k1
a1.channels = c1


# Kafka Source

a1.sources.s1.type = org.apache.flume.source.kafka.KafkaSource
a1.sources.s1.kafka.bootstrap.servers = kafka:9092
a1.sources.s1.kafka.topics = apache


# Kafka Sink

a1.sinks.k1.type = org.apache.flume.sink.kafka.KafkaSink
a1.sinks.k1.kafka.bootstrap.servers = kafka:9092


# Use a channel which buffers events in memory

a1.channels.c1.type = memory
a1.channels.c1.capacity = 10000000
a1.channels.c1.transactionCapacity = 1000000


# Bind the source and sink to the channel

a1.sources.s1.channels = c1
a1.sinks.k1.channel = c1

The sink are not creating. 接收器未创建。

If you want to replicate data from one Kafka cluster to another, there are better ways than Flume, including: 如果要将数据从一个Kafka集群复制到另一个集群,有比Flume更好的方法,包括:

If you want a really dirty hack, you can also do something with kafkacat and nc . 如果您想要真正的肮脏黑客,也可以使用kafkacatnc

Disclaimer: I work for Confluent. 免责声明:我为Confluent工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM