flume伪分布式安装: 1、导包:apache-flume-1.7.0-bin.tar.gz 2、配置环境变量:/etc/profile export FLUME_HOME=/yang/apache-flume-1.7.0-bin export PATH=$PATH:$FLUME_HOME/bin 3、在conf目录下创建example.conf的空文件: # a1是给这个agent取的一个名字 # sources sinks channels是一个agent下的三个组件,下面这三行是为三个组件去名字 a1.sources = r1 a1.sinks = k1 a1.channels = c1 # 为agent名为a1的source定义相关的属性 a1.sources.r1.type = netcat a1.sources.r1.bind = localhost a1.sources.r1.port = 44444 # 为agent名为k1的source定义相关的属性 a1.sinks.k1.type = logger # 为agent名为c1的source定义相关的属性 a1.channels.c1.type = memory a1.channels.c1.capacity = 1000 a1.channels.c1.transactionCapacity = 100 # 让sources关联channels a1.sources.r1.channels = c1 # 让sinks关联channel a1.sinks.k1.channel = c1 4、启动 flume-ng agent –conf conf –conf-file /yang/apache-flume-1.7.0-bin/conf/example.conf –name a1 -Dflume.root.logger=INFO,console 5、Linux下测试 采用telnet测试 linux需要先安装telnet命令:yum install -y telnet 新开窗口输入:telnet localhost 44444 注:如果a1.sources.r1.bind = 主机名的话,就新开窗口输入:telnet localhost 44444 6、外部windows测试配置 进入控制面板–程序和功能–启动或关闭windows功能–√上Telnet客户端 运行cmd窗口,telnet 主机名 44444访问不了的话,修改a1.sources.r1.bind = 主机名 再通过cmd访问:telnet 主机名 44444