Advertisement
hivefans

flume-kafka0.1-kafka2

Apr 23rd, 2021
1,396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.79 KB | None | 0 0
  1. # 定义这个agent组件名称
  2. a1.sources = r1
  3. a1.sinks = k1
  4. a1.channels = c1
  5.  
  6. # =======================使用内置kafka source
  7. a1.sources.r1.kafka.bootstrap.servers=ip:9092
  8. a1.sources.r1.kafka.topics=kafka0-10-0
  9. a1.sources.r1.kafka.consumer.security.protocol=SASL_PLAINTEXT
  10. a1.sources.r1.kafka.consumer.sasl.mechanism=PLAIN
  11. a1.sources.r1.kafka.consumer.group.id=groupid
  12. a1.sources.r1.kafka.consumer.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="用户名"  password="密码";
  13. a1.sources.r1.type=org.apache.flume.source.kafka.KafkaSource
  14. a1.sources.r1.batchSize=5000
  15.  
  16. #  =======================对sources进行拦截器操作  channel中会带有Header,我做了remove_header操作
  17. a1.sources.r1.interceptors=i1
  18. a1.sources.r1.interceptors.i1.type=remove_header
  19. a1.sources.r1.interceptors.i1.fromList=timestamp,topic,offset,partition
  20.  
  21. a1.sources.r1.channels=c1
  22.  
  23. # channel设置  a1.sinks.k1.type有很多种,如、memory、file、jdbc、kafka   我使用kafka做为通道
  24. # channel  先把数据发动到kafka缓存通道,处理完成sink接收,之后进行producer
  25. a1.channels.c1.type=org.apache.flume.channel.kafka.KafkaChannel
  26. a1.channels.c1.kafka.bootstrap.servers=127.0.0.1:9002
  27. a1.channels.c1.kafka.topic=kafka-channel
  28.  
  29.  
  30. #  =======================目标生产数据
  31. #a1.sinks.k1.type=logger  打开这里可以验证从channel传递过来的数据是否是你想要的
  32. a1.sinks.k1.type=org.apache.flume.sink.kafka.KafkaSink
  33. a1.sinks.k1.kafka.topic=kafka2-1
  34. a1.sinks.k1.kafka.bootstrap.servers=127.0.0.1:9002
  35. a1.sinks.k1.kafka.flumeBatchSize= 1000
  36. a1.sinks.k1.kafka.producer.acks = 1
  37. a1.sinks.k1.kafka.producer.compression.type = snappy
  38.  
  39.  
  40. # Bind the source and sink to the channel
  41. a1.sources.r1.channels=c1
  42. a1.sinks.k1.channel=c1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement