一、解压cd /usr/local/softtar -zxvf apache-flume-1.9.0-bin.tar.gz
二、添加系统环境变量(需配置Java JDK系统参数)vi /etc/profileexport FLUME_HOME=/usr/local/soft/apache-flume-1.9.0-binexport PATH=
P
A
T
H
:
PATH:
PATH:FLUME_HOME/binsource /etc/profile
三、修改Flume环境变量cd /usr/local/soft/apache-flume-1.9.0-bin/conf/拷贝环境变量文件cp flume-env.sh.template flume-env.sh添加内容export JAVA_HOME=/usr/local/soft/jdk1.8.0_11四、配置文件客户端(Source):收集信息拷贝配置文件:cp flume-conf.properties.template flume-client.properties配置文件内容:#分别指定agent的sources,sinks, channels的名称 名称可以自定义a1.sources = s1 a1.sinks = k1 a1.channels = c1 #配置目录scourcea1.sources.s1.type =spooldir a1.sources.s1.spoolDir =/home/hadoop/logs a1.sources.s1.fileHeader= true a1.sources.s1.channels =c1 #配置sink a1.sinks.k1.type = logger a1.sinks.k1.channel = c1 #配置channel(内存做缓存)a1.channels.c1.type = memory
五、启动flume-ng agent -n a1 -c conf -f flume-client.properties -Dflume.root.logger=DEBUG,console其中:-n:agent名称-c:配置文件路径conf-f:配置文件名称附:集群拷贝scp -r /usr/local/soft/apache-flume-1.9.0-bin root@sla
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)