라이브러리/시스템

Flume 1.4 설치 (Ubuntu 14.04 server)

눌프 2014. 8. 7. 18:05
Download
  • wget http://ftp.daum.net/apache/flume/1.4.0/apache-flume-1.4.0-bin.tar.gz
  • tar zxvf apache-flume-1.4.0-bin.tar.gz
  • sudo mv apache-flume-1.4.0-bin /usr/local/flume
  • sudo chown -R hadoop:hadoop /usr/local/flume
Set Environment
  • vi ~/.bashrc
    • export FLUME_HOME=/usr/local/flume
    • export PATH=$PATH:$FLUME_HOME/bin
  • source ~/.bashrc
Flume Configuration
  • cd $FLUME_HOME/conf
  • cp flume-conf.properties.template flume.conf
  • vi flume.conf
######################################################
agent.sources = netcat_source
agent.channels = memory_channel
agent.sinks = file_sink

######################################################
agent.sources.netcat_source.type = netcat
agent.sources.netcat_source.bind = 0.0.0.0
agent.sources.netcat_source.port = 8888
agent.sources.netcat_source.channels = memory_channel

######################################################
agent.channels.memory_channel.type = memory
agent.channels.memory_channel.capacity = 10000

######################################################
agent.sinks.file_sink.type = file_roll
agent.sinks.file_sink.sink.directory = /tmp/flume
agent.sinks.file_sink.channel = memory_channel
agent.sinks.file_sink.sink.rollInterval = 60
agent.sinks.file_sink.batchSize = 10000
  • touch /tmp/test.log
  • mkdir /tmp/flume
Test
  • flume-ng agent --conf-file $FLUME_HOME/conf/flume.conf --name agent
  • ls -al /tmp/flume
  • telnet localhost 8888