cd /opt/software tar -zxvf apache-flume-1.9.0-bin.tar.gz -C 解压到哪的路径二、添加系统环境变量(需配置Java JDK系统参数)
vi /etc/profile export FLUME_HOME=/opt/moudle/apache-flume-1.9.0-bin export PATH=$PATH:$FLUME_HOME/bin
source /etc/profile三、修改Flume环境变量
cd /opt/moudle/apache-flume-1.9.0-bin/conf/拷贝环境变量文件
cp flume-env.sh.template flume-env.sh添加内容
export JAVA_HOME=opt/moudle/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 #配置目录scource a1.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:配置文件名称
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)