1.wget 获取flume安装包wget http://mirrors.hust.edu.cn/apache/flume/1.6.0/apache-flume-1.6.0-bin.tar.gz2.解压flume安装包tar -zxvf apache-flume-1.6.0-bin.tar.gzmv apache-flume-1.6.0-bin flume3.进入flume的conf目录cd flume/confll总用量 20-rw-r--r--. 1 root root 1661 8月 14 13:49 flume-conf.properties-rw-r--r--. 1 501 games 1661 5月 9 2015 flume-conf.properties.template-rw-r--r--. 1 501 games 1110 5月 9 2015 flume-env.ps1.template-rw-r--r--. 1 501 games 1214 5月 9 2015 flume-env.sh.template-rw-r--r--. 1 501 games 3107 5月 9 2015 log4j.properties4.拷贝出配置文件模板cp flume-conf.properties flume.conf5.修改配置文件gedit flume.conf一个简单的demo#对channel而言,相当于生产者,通过接收各种格式数据发送给channel进行传输a1.sources = b1#相当于数据缓冲区,接收source数据发送给sinka1.channels = c1# 对channel而言,相当于消费者,通过接收channel数据通过指定数据类型发送到指定位置a1.sinks = d1#配置一下数据来源的信息a1.sources.b1.type=netcat#绑定本地地址a1.sources.b1.bind=localhost#监听一个端口a1.sources.b1.port=44444#配置一下sinks的消费的时候的类型a1.sinks.d1.type = loggera1.channels.c1.type = memory#上线是1000a1.channels.c1.capacity = 1000a1.channels.c1.transactionCapacity = 100# Bind the source and sink to the channel#数据来源和消费者采用的是一个通道a1.sources.b1.channels = c1a1.sinks.d1.channel = c编写的时候多编写几次应该就可以记住了source 数据源chanel 通道sinks 使用者保存配置文件 进入bin 目录启动 a1 其实也很好发现是我编写的时候起的名字 a1配置文件-f./flume-ng agent -n a1 -f ../conf/flume.conf
启动成功日志

新开一个终端采用telnet 命令去链接source 再去查看打开的flume种断 可以看到控制台的打印日志


