Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. Installation Steps:
  2.  
  3. • Copy file from local to location where you installed hadoop ( cp ~/Desktop/POC/apache-flume-1.6.0-bin.tar.gz /opt)
  4. • Run sudo tar -xzvf apache-flume-1.6.0-bin.tar.gz
  5. • Now go to folder flume-1.6.0-bin/conf( cd apache-flume-1.6.0-bin/conf folder)
  6. • Rename the flume-conf.properties.template file (sudo mv flume-conf.properties.template flume-conf.properties)
  7. • Now rename flume-env.sh.template (sudo mv flume-env.sh.template flume-env.sh)
  8. • Add this line export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_51
  9. • Now go to ./bashrc file and write these lines:
  10. export FLUME_HOME=/opt/apache-flume-1.6.0-bin
  11. export PATH=$PATH:$FLUME_HOME/bin
  12. export CLASSPATH=$CLASSPATH:$FLUME_HOME/lib/*
  13. • Run . ~/.baschrc
  14. • Run ./flume-ng
  15. After successfully installed Help prompt of flume will get
  16.  
  17. Moving Data into Flume:
  18.  
  19. • Go to apache-flume-1.6.0-bin/conf folder
  20. • Create one file datasource.conf and write following lines:
  21.  
  22. agent1.channels = c1
  23. agent1.sources = r1
  24. agent1.sinks = k1
  25.  
  26. #source configuration
  27. agent1.sources.r1.type = spooldir
  28. agent1.sources.r1.channels = c1
  29. agent1.sources.r1.spoolDir = /home/ubuntu/flume_source/
  30. agent1.sources.r1.fileHeader = true
  31.  
  32. #channel configuration
  33. agent1.channels.c1.type = memory
  34.  
  35. #sink configuration
  36. agent1.sinks.k1.channel = c1
  37. agent1.sinks.k1.type = hdfs
  38. agent1.sinks.k1.hdfs.path = hdfs://localhost:9000/flume_sink
  39. agent1.sinks.k1.hdfs.serializer = Text
  40. agent1.sinks.k1.hdfs.writeFormat = Text
  41. agent1.sinks.k1.hdfs.fileType = DataStream
  42. agent1.sinks.k1.hdfs.serializer.appendNewline=true
  43. agent1.sinks.k1.hdfs.rollSize = 6700000000 #This parameter decides number of files going to HDFS system.This is in MB.
  44. agent1.sinks.k1.hdfs.rollCount = 0
  45. agent1.sinks.k1.hdfs.rollInterval = 30
  46. agent1.sinks.k1.hdfs.batchSize = 100
  47.  
  48.  
  49. • Create folder /home/ubuntu/flume_source/ on your local and put the log files there.
  50. • Now run the following command:
  51.  
  52. flume-ng agent --conf ./conf/ -f /opt/apache-flume-1.6.0-bin/conf/datasource.conf Dflume.root.logger=DEBUG,console -n agent1
  53.  
  54. Once it’s done check following:
  55. • hadoop fs -cat /flume_sink/FlumeData.1453279735239 |wc –l
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement