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

相关推荐
Marry Andy10 分钟前
Atlas 300l Duo部署qwen3_32b_light
linux·人工智能·经验分享·语言模型·自然语言处理
ALGO阿狗16 分钟前
一款简单易用的远程日志查看器,可实时查看云服务器上的日志数据
运维·服务器·日志
微露清风18 分钟前
系统性学习Linux-第三讲-进程概念
linux·运维·学习
请你喝好果汁64118 分钟前
Linux-sh -c \dirname
linux·运维·服务器
Trouvaille ~19 分钟前
【Linux】线程同步与互斥(四):线程池与任务管理
linux·运维·服务器·c++·操作系统·线程池·日志系统
qinyia27 分钟前
如何在服务器上查看网络连接数并进行综合分析
linux·运维·服务器·开发语言·人工智能·php
Alter123028 分钟前
拆开“超节点”的伪装:没有内存统一编址,仍是服务器堆叠
运维·服务器
思麟呀30 分钟前
进程间通信
linux·运维·服务器
老兵发新帖34 分钟前
Ubuntu上使用企业微信
linux·ubuntu·企业微信
hwj运维之路37 分钟前
超详细ubuntu22.04部署k8s1.28高可用(一)【多master+keepalived+nginx实现负载均衡】
运维·云原生·kubernetes·负载均衡