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 分钟前
linux测试端口是否可被外部访问
linux·运维·服务器·python·测试·端口测试·临时服务器
愚润求学21 分钟前
【Linux】自旋锁和读写锁
linux·运维
大锦终23 分钟前
【Linux】常用基本指令
linux·运维·服务器·centos
IT项目管理34 分钟前
达梦数据库DMHS介绍及安装部署
linux·数据库
知北游天1 小时前
Linux:多线程---深入互斥&&浅谈同步
linux·运维·服务器
Gappsong8741 小时前
【Linux学习】Linux安装并配置Redis
java·linux·运维·网络安全
try2find1 小时前
移动conda虚拟环境的安装目录
linux·运维·conda
码农101号2 小时前
Linux中容器文件操作和数据卷使用以及目录挂载
linux·运维·服务器
PanZonghui2 小时前
Centos项目部署之Nginx 的安装与卸载
linux·nginx
PanZonghui2 小时前
Centos项目部署之安装数据库MySQL8
linux·后端·mysql