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控制台打印说明安装成功

相关推荐
LiQiang33几秒前
Ubuntu2404修改国内镜像
linux
杰哥技术分享1 分钟前
Ubuntu 22.04安装SQL Server指南
linux·运维·ubuntu·sqlserver
遇见火星1 分钟前
ubuntu18.04 升级Ubuntu 20.04
linux·运维·ubuntu·系统升级
x县豆瓣酱9 分钟前
【第四节】ubuntu server安装docker
linux·ubuntu·docker
Gene_202210 分钟前
【TOOL】ubuntu升级cmake版本
linux·运维·ubuntu
宇钶宇夕15 分钟前
S7-200 SMART CPU 密码清除全指南:从已知密码到忘记密码的解决方法
运维·服务器·数据库·程序人生·自动化
思序 LogicFlow23 分钟前
关于在Linux上部署 SecretFlow --- P2P部署模式
linux·服务器
YC运维2 小时前
网络配置综合实验全攻略(对之前学习的总结)
linux·服务器·网络
平凡灵感码头2 小时前
什么是 Bootloader?怎么把它移植到 STM32 上?
linux·soc
MarkGosling3 小时前
【开源项目】网络诊断告别命令行!NetSonar:开源多协议网络诊断利器
运维·后端·自动化运维