Ubuntu16.04 install apache-flume-1.7.0-bin.tar.gz
下载 wget http://mirror.bit.edu.cn/apache/flume/1.7.0/apache-flume-1.7.0-bin.tar.gz
解压 tar zxvf apache-flume-1.7.0-bin.tar.gz
存放 sudo mv apache-flume-1.7.0-bin.tar.gz /opt/flume
进入 cd /opt/flume
执行 bin/flume-ng agent -n agent -c ./conf -f conf/hello-world.properties -Dflume.root.logger=INFO,console
新开窗口 telnet localhost 12345
flume退出,进程销毁
改为后台进程 nohup bin/flume-ng agent -n agent -c ./conf -f conf/hello-world.properties -Dflume.root.logger=INFO,console &
查看nohup日记 tail -f nohup.out
销毁进程 kill -9 进程ID
监听输出 tail -f nohup.out
http
bin/flume-ng agent -n agent -c conf -f conf/http.properties -Dflume.root.logger=INFO,console
curl -X POST -d '[{"headers" :{"name":"lancer","level":"min"},"body":"text"}]' http://localhost:50000
spooling
mkdir -p /data/log/flume_spool
bin/flume-ng agent -n agent -c conf -f conf/spooling.properties -Dflume.root.logger=INFO,console
cp Ubuntu /data/log/flume_spool/
cp /data/demo_sql/data_op/order.data /data/log/flume_spool/
spooling-hdfs
窗口一:
bin/flume-ng agent -n agent -c conf -f conf/spooling-hdfs.properties -Dflume.root.logger=INFO,console
窗口二:
hdfs dfs -ls /
hdfs dfs -mkdir /flume
hdfs dfs -ls /flume/
hdfs dfs -cat /flume/20171008/log_20171008_21.1507467792328.log
窗口三:
cd /data/log/flume_spool
rm *
cp Linux /data/log/flume_spool
posted on 2017-10-08 11:42 唐先生_DowneyJr 阅读(162) 评论(0) 编辑 收藏 举报