Flume Avor Source

1.cd /usr/local2/flume/conf

sudo vim avro.conf:

  1. a1.sources = r1
  2. a1.sinks = k1
  3. a1.channels = c1
  4.  
  5. # Describe/configure the source
  6. a1.sources.r1.type = avro
  7. a1.sources.r1.channels = c1
  8. a1.sources.r1.bind = 0.0.0.0
  9. a1.sources.r1.port = 5252
  10. # Describe the sink
  11. a1.sinks.k1.type = logger
  12.  
  13. # Use a channel which buffers events in memory
  14. a1.channels.c1.type = memory
  15. a1.channels.c1.capacity = 1000
  16. a1.channels.c1.transactionCapacity = 100
  17.  
  18. # Bind the source and sink to the channel
  19. a1.sources.r1.channels = c1
  20. a1.sinks.k1.channel = c1
  21. shell:  cd/usr/local2/flume/bin
    ./flume-ng agent -c . -f /usr/local/flume/conf/avro.conf -n a1 -Dflume.root.logger=INFO,console #启动日志控制台        

保留这个shell

测试文件:

cd /usr/local2/flume

vim soyo.txt

再开一个shell:./flume-ng avro-client --conf conf -H localhost -p 5252 -F /usr/local/flume/soyo.txt

即可看见soyo.txt的内容

 

posted @ 2017-10-18 15:09  soyosuyang  阅读(343)  评论(0编辑  收藏  举报