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

相关推荐
慾玄13 分钟前
ce复习,例行性工作
linux
jixunwulian16 分钟前
边缘计算网关在空压机数据采集与远程运维中的解决方案
运维·人工智能·边缘计算
我在人间贩卖青春21 分钟前
网络软件相关命令
linux·软件管理
源码技术栈23 分钟前
Java智能诊所管理系统源码 SaaS云门诊运维平台源码
java·大数据·运维·人工智能·源码·诊所·门诊
CIb0la29 分钟前
Complete Bug Bounty tool List for free
linux·运维·bug
ytadpole32 分钟前
若依验证码渲染失效问题
java·linux·后端
wadesir34 分钟前
Nginx反向代理错误处理(从零开始配置自定义错误页面与故障应对)
运维·nginx
一念一花一世界34 分钟前
CI/CD工具选型:Jenkins与Arbess全面对比指南
运维·ci/cd·jenkins·arbess
zt1985q35 分钟前
本地部署开源运维工具 MyIP 并实现外部访问
运维·服务器·网络协议·开源
上78将35 分钟前
什么是Stream流
linux·开发语言·python