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

相关推荐
maosheng11465 分钟前
linux的综合教程(搭建论坛教程)
linux
IpdataCloud8 分钟前
效果广告中点击IP与转化IP不一致?用IP查询怎么做归因分析?
运维·服务器·网络
Deitymoon19 分钟前
linux——TCPIP协议原理
linux·网络
独小乐28 分钟前
018.使用I2C总线EEPROM|千篇笔记实现嵌入式全栈/裸机篇
linux·笔记·单片机·嵌入式硬件·arm·信息与通信
SPC的存折38 分钟前
2、Docker命令与镜像、容器管理
linux·运维·服务器·docker·容器·eureka
D4c-lovetrain42 分钟前
Linux个人心得26 (redis主从复制全流程,详细版)
linux·运维·服务器
晴天¥1 小时前
达梦数据库共享存储集群搭建(DSC双节点+Openfiler-IP SAN存储)
linux·数据库·达梦数据库
吃着火锅x唱着歌1 小时前
LeetCode 150.逆波兰表达式求值
linux·算法·leetcode
Bert.Cai1 小时前
Linux whoami命令详解
linux·运维
x***r1511 小时前
驱动精灵离线版使用指南:免联网快速安装驱动(万能网卡版)
linux·运维·服务器