Flume安装与简介

0. CentOS7下安装Flume

官方文档
http://flume.apache.org/FlumeUserGuide.html

修改配置文件flume-env.sh

/home/hadoop/flume-1.8.0/conf
cp flume-env.sh.template flume-env.sh

修改Java_home路径

export JAVA_HOME=/usr/java/jdk1.8.0_144

创建自定义配置文件a1.conf

以/home/hadoop/flume-1.8.0/confflume-conf.properties.template为模板, 自定义配置文件

a1.sources=r1
a1.channels=c1
a1.sinks=k1
#设置sources的监听
a1.sources.r1.type=netcat
a1.sources.r1.bind=ghym#监听的机器名或IP地址
a1.sources.r1.port=9999#自定义监听的端口
a1.sources.r1.channels=c1
#设置channel的属性
a1.channels.c1.type=memory
a1.channels.c1.capacity=1000
#a1.channels.c1.transactionCapacity = 100
#设置sinks的属性
a1.sinks.k1.channel=c1
a1.sinks.k1.type=logger

启动Flume,测试是否安装成功

flume-ng agent -n a1 -c ./ -f ./a1.conf -Dflume.root.logger=INFO,console

通过telnet可在其他IP地址上访问flume所在IP

telnet ghym 9999

猜你喜欢

转载自blog.csdn.net/wxfghy/article/details/80761423