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

相关推荐
AC赳赳老秦7 小时前
OpenClaw多平台部署:Windows+Linux跨系统协同,实现全场景覆盖
linux·服务器·前端·网络·windows·deepseek·openclaw
念恒123067 小时前
进程--程序地址空间下篇(进程地址空间)
linux·c语言
___波子 Pro Max.7 小时前
Linux 外挂 SSD 根目录下的 `.Trash-1000` 到底是什么
linux
爱学习的小囧8 小时前
VMware vCenter Server 9.0.2.0 资源详解+完整部署教程+下载指南+常见问题
运维·服务器·esxi·vmware·虚拟化·esxi9.0.2.0
贾斯汀玛尔斯8 小时前
每天学一个算法--单调栈(Monotonic Stack)
运维·服务器·算法
hhb_6188 小时前
Linux底层运维自动化挂载与磁盘分区实战指南
linux·运维·自动化
SpikeKing8 小时前
Server - 配置 SQLBot 智能问数项目
运维·server·sqlbot
cui_ruicheng9 小时前
Linux库制作与使用(二):ELF文件与链接过程
linux·运维·服务器
ReaF_star9 小时前
【环保】CentOS 7 安装 MySQL 8 实战记录:从安装到排障一次讲清
linux·mysql·centos
怀旧,9 小时前
【Linux系统编程】18. Linux进程信号(上)
linux·运维·服务器