flume.conf 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. a1.channels.c1.type = file
  2. a1.channels.c1.checkpointDir = /data/flume_data/checkpoint
  3. a1.channels.c1.dataDirs = /data/flume_data/data
  4. a1.channels.c2.type = org.apache.flume.channel.kafka.KafkaChannel
  5. #a1.channels.c2.transactionCapacity = 100000
  6. #a1.channels.c2.capacity = 10000000
  7. a1.channels.c2.brokerList = 10.26.27.212:8092,10.26.22.76:8092,10.26.22.72:8092,10.26.22.73:8092,10.26.22.74:8092
  8. a1.channels.c2.topic = home_easou_com_nginx
  9. a1.channels.c2.zookeeperConnect = 10.26.27.212:2181,10.26.22.76:2181,10.26.22.72:2181,10.26.22.73:2181,10.26.22.74:2181
  10. #a1.channels.c2.write-timeout = 150
  11. #a1.channels.c2.keep-alive = 260
  12. # Define an Avro source called r1 on a1 and tell it
  13. # to bind to 0.0.0.0:41414. Connect it to channel c1.
  14. #注意这里分出2个channel出来,一个是到k1,一个到k2
  15. #如果这里只出一个channel c1的话,下面2个sink channel都为c1,则消息就会随机分到2个sink上,而不是2个sink都有一份
  16. a1.sources.r1.channels = c1 c2
  17. a1.sources.r1.type = exec
  18. a1.sources.r1.command = tail -F /log/nginx/visit/access.log
  19. a1.sources.r1.restart = true
  20. a1.sources.r1.interceptors = i1 i2
  21. a1.sources.r1.interceptors.i1.type = timestamp
  22. a1.sources.r1.interceptors.i2.type = host
  23. a1.sources.r1.interceptors.i2.useIP = false
  24. #默认是replicationg,还有multiplexer
  25. #a1.sources.r1.selector.type = replicationg
  26. a1.sinks.k1.type = avro
  27. a1.sinks.k1.channel = c1
  28. a1.sinks.k1.hostname = 10.26.26.67
  29. a1.sinks.k1.port = 41414
  30. # Finally, now that we've defined all of our components, tell
  31. # a1 which ones we want to activate.
  32. a1.sources = r1
  33. a1.channels = c1 c2
  34. a1.sinks = k1