这篇文章给大家分享的是有关flume安装的方法的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。
从官网下载
wget http://archive.apache.org/dist/flume/1.7.0/apache-flume-1.7.0-bin.tar.gz
解压到/opt/flume目录,并重命名
tar -zxvf apache-flume-1.7.0-bin.tar.gz -C /opt/flume cd /opt/flume mv apache-flume-1.7.0-bin/ apache-flume-1.7.0
在/etc/profile中增加环境变量
export FLUME_HOME=/opt/flume/apache-flume-1.7.0 export PATH=$PATH:$FLUME_HOME/bin
配置flume-env.sh
cd /opt/flume/apache-flume-1.7.0/conf cp flume-env.sh.template flume-env.sh
在flume-env.sh中配置
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.272.b10-1.el7_9.x86_64/jre export JAVA_OPTS="-Xms100m -Xmx2000m -Dcom.sun.management.jmxremote"
配置flume-conf.properties
cd /opt/flume/apache-flume-1.7.0/conf cp flume-conf.properties.template flume-conf.properties
在flume-conf.properties配置
a1.sources = r1 a1.channels = c1 a1.sinks = k1 a1.sources.r1.type = netcat a1.sources.r1.bind = 192.168.1.10 a1.sources.r1.port = 22222 a1.sources.r1.channels = c1 a1.sinks.k1.type = logger a1.sinks.k1.channel = c1 a1.channels.c1.type = memory a1.channels.c1.capacity = 1000 a1.channels.c1.transcationCapacity = 100
都配置好后,就可以启动了
cd /opt/flume/apache-flume-1.7.0/ ./bin/flume-ng agent --conf ./conf --conf-file ./conf/flume-conf.properties --name a1 -Dflume.root.logger=INFO,console
在本机使用telnet进行测试
# telnet 192.168.1.10 22222 Trying 192.168.1.10... Connected to 192.168.1.10. Escape character is '^]'. hello OK
flume输出如下信息表示启动成功
2021-05-19 13:54:58,933 (SinkRunner-PollingRunner-DefaultSinkProcessor) [INFO - org.apache.flume.sink.LoggerSink.process(LoggerSink.java:95)] Event: { headers:{} body: 68 65 6C 6C 6F 0D hello. }
感谢各位的阅读!关于“flume安装的方法”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。