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

相关推荐
运维_攻城狮1 天前
openeuler-24.3欧拉系统mysql开机自启报错
linux·mysql
杭州泽沃电子科技有限公司1 天前
在线监测系统:农药精细化工的“安全锁”与“效率引擎”
运维·人工智能·科技·物联网·化工
shizhan_cloud1 天前
Linux 进程调度管理
linux·运维
我有毓毓症1 天前
nginx作业
运维·nginx
JiMoKuangXiangQu1 天前
Linux 网络:邻居子系统
linux·网络·邻居子系统
孙同学_1 天前
【Linux篇】信号机制深度剖析:从信号捕捉到SIGCHLD信号处理
linux·信号处理
多来哈米1 天前
Jenkins配置vue前端项目(最简单的操作)
运维·前端·jenkins
玖剹1 天前
多线程编程:从日志到单例模式全解析
java·linux·c语言·c++·ubuntu·单例模式·策略模式
Monody_R1 天前
rhce作业
linux·服务器·apache
dessler1 天前
MYSQL-外键(Foreign Key)
linux·运维·mysql