flume.conf 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 = file
  5. a1.channels.c2.checkpointDir = /data/flume_data1/checkpoint
  6. a1.channels.c2.dataDirs = /data/flume_data1/data
  7. a1.channels.c2.transactionCapacity = 200000
  8. a1.channels.c2.capacity = 1000000
  9. a1.channels.c2.write-timeout = 250
  10. a1.channels.c2.keep-alive = 250
  11. # Define an Avro source called r1 on a1 and tell it
  12. # to bind to 0.0.0.0:41414. Connect it to channel c1.
  13. #注意这里分出2个channel出来,一个是到k1,一个到k2
  14. #如果这里只出一个channel c1的话,下面2个sink channel都为c1,则消息就会随机分到2个sink上,而不是2个sink都有一份
  15. a1.sources.r1.channels = c1 c2
  16. a1.sources.r1.type = exec
  17. a1.sources.r1.command = tail -F /log/nginx/visit/access.log
  18. a1.sources.r1.restart = true
  19. a1.sources.r1.interceptors = i1 i2
  20. a1.sources.r1.interceptors.i1.type = timestamp
  21. a1.sources.r1.interceptors.i2.type = host
  22. a1.sources.r1.interceptors.i2.useIP = false
  23. #默认是replicationg,还有multiplexer
  24. #a1.sources.r1.selector.type = replicationg
  25. a1.sinks.k1.type = avro
  26. a1.sinks.k1.channel = c1
  27. a1.sinks.k1.hostname = 10.26.26.67
  28. a1.sinks.k1.port = 41414
  29. a1.sinks.k2.type = avro
  30. a1.sinks.k2.channel = c2
  31. a1.sinks.k2.hostname = 10.26.33.113
  32. a1.sinks.k2.port = 41414
  33. a1.sinks.k2.request-timeout = 100000
  34. a1.sinks.k2.connect-timeout = 100000
  35. # Finally, now that we've defined all of our components, tell
  36. # a1 which ones we want to activate.
  37. a1.sources = r1
  38. a1.channels = c1 c2
  39. a1.sinks = k1 k2