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

相关推荐
眷蓝天8 分钟前
Docker 镜像瘦身:从 GB 到 MB 的优化实践
运维·docker·容器
实心儿儿8 分钟前
Linux —— 进程控制 - mini shell
linux·运维·服务器
程序员黄老师41 分钟前
Windows文件移动到Linux上的坑
linux·运维·服务器
shizhan_cloud1 小时前
自动化部署Kubernetes集群
运维·kubernetes
mounter6251 小时前
【内核前沿】Linux IPC 迎来大变局?POSIX 消息队列增强、io_uring IPC 与 Bus1 十年回归
linux·运维·服务器·kernel·ipc·io_uring
不怕犯错,就怕不做1 小时前
Linux-Sensor驱动移植与调试(转载)
linux·驱动开发·嵌入式硬件
wzl202612131 小时前
企业微信定时群发技术实现与实操指南(原生接口+工具落地)
java·运维·前端·企业微信
island13142 小时前
最详细VMware Workstation 17 上安装 Ubuntu 系统
linux·数据库·ubuntu
2401_895521342 小时前
Linux下安装Redis
linux·运维·redis
网络小白不怕黑2 小时前
2.1VMware部署Windows_server_2008_R2
运维·服务器