tail-hdfs.conf
用tail命令获取数据,下沉到hdfs
mkdir /home/hadoop/log
while true
do
echo 111111 >> /home/hadoop/log/test.log
sleep 0.5
done
tail -F test.log
采集到hdfs中, 文件中的目录不用自己建的
检查下hdfs式否是salf模式:
hdfs dfsadmin -report
bin/flume-ng agent -c conf -f conf/tail-hdfs.conf -n a1
前端页面查看下, master:50070, 文件目录: /flum/events/16-04-20/
启动命令:
bin/flume-ng agent -c conf -f conf/tail-hdfs.conf -n a1
################################################################
# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1
#exec 指的是命令
# Describe/configure the source
a1.sources.r1.type = exec
#F根据文件名追中, f根据文件的nodeid追中
a1.sources.r1.command = tail -F /home/hadoop/log/test.log
a1.sources.r1.channels = c1
用tail命令获取数据,下沉到hdfs
mkdir /home/hadoop/log
while true
do
echo 111111 >> /home/hadoop/log/test.log
sleep 0.5
done
tail -F test.log
采集到hdfs中, 文件中的目录不用自己建的
检查下hdfs式否是salf模式:
hdfs dfsadmin -report
bin/flume-ng agent -c conf -f conf/tail-hdfs.conf -n a1
前端页面查看下, master:50070, 文件目录: /flum/events/16-04-20/
启动命令:
bin/flume-ng agent -c conf -f conf/tail-hdfs.conf -n a1
################################################################
# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1
#exec 指的是命令
# Describe/configure the source
a1.sources.r1.type = exec
#F根据文件名追中, f根据文件的nodeid追中
a1.sources.r1.command = tail -F /home/hadoop/log/test.log
a1.sources.r1.channels = c1