Linux下安装Flume

1 下载Flume

Welcome to Apache Flume --- Apache Flume

下载1.9.0版本

2 上传服务器并解压安装

3 删除lib目录下的guava-11.0.2.jar (如同服务器安装了hadoop,则删除,如没有安装hadoop则保留这个文件,否则无法启动flume)

4 修改conf下的log4j.properties文件

flume.root.logger=INFO,LOGFILE,console
flume.log.dir=/usr/local/flume-1.9.0/logs

5 测试

安装netcat

yum install nc

根目录下创建job目录,目录下新建 nc-flume-console.conf,将netcat输入的内容通过flume收集,并通过console打印在控制台

# example.conf: A single-node Flume configuration

# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1

# Describe/configure the source
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444

# Describe the sink
a1.sinks.k1.type = logger

# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

执行命令

bin/flume-ng agent -c conf/ -f job/nc-flume-console.conf -n a1

另外开一个窗口执行

nc localhost 44444

在窗口中输入内容,在flume控制台打印说明安装成功

相关推荐
技术小齐2 小时前
网络运维学习笔记 016网工初级(HCIA-Datacom与CCNA-EI)PPP点对点协议和PPPoE以太网上的点对点协议(此处只讲华为)
运维·网络·学习
ITPUB-微风2 小时前
Service Mesh在爱奇艺的落地实践:架构、运维与扩展
运维·架构·service_mesh
打不了嗝 ᥬ᭄3 小时前
Linux的权限
linux
落幕3 小时前
C语言-进程
linux·运维·服务器
深度Linux3 小时前
C++程序员内功修炼——Linux C/C++编程技术汇总
linux·项目实战·c/c++
chenbin5203 小时前
Jenkins 自动构建Job
运维·jenkins
java 凯3 小时前
Jenkins插件管理切换国内源地址
运维·jenkins
AI服务老曹3 小时前
运用先进的智能算法和优化模型,进行科学合理调度的智慧园区开源了
运维·人工智能·安全·开源·音视频
风静如云4 小时前
OpenBMC:BmcWeb定义service
linux
sszdzq5 小时前
Docker
运维·docker·容器