flume1.7.0的安装与使用
- 官网下载flume1.7.0
- 安装Java,与前文hadoop安装的方法相同
- 解压并进入flume1.7.0
$ tar -zxvf apache-flume-1.7.0-bin.tar.gz
$ cd apache-flume-1.7.0-bin
4、创建flume-env.sh文件
cp conf/flume-env.sh.template conf/flume-env.sh
5、配置java的环境变量
vim conf/flume-env.sh
export JAVA_HOME=/usr/java/latest/
6、创建配置文件
$ cp conf/flume-conf.properties.template conf/flume.conf
7、编辑文件flume.conf:
$ vim conf/flume.conf
a1.sources = s1
a1.channels = c1
a1.sinks = k1
# define the source
a1.sources.s1.type = spooldir #上传目录类型
a1.sources.s1.spoolDir = /ttt #上传该目录下的所有文件
a1.sources.files_source.fileHeader = true
a1.sources.files_source.fileHeaderKey = fileName
#define the channel
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 1000
# define the sink
a1.sinks.k1.type = hdfs
a1.sinks.k1.hdfs.path = hdfs://master:9000/aaa #上传的文件保存在hdfs的/aaa目录下
a1.sinks.k1.hdfs.fileType = SequenceFile
a1.sinks.hdfs_sink.hdfs.filePrefix = %{fileName}
# zuhe
a1.sources.s1.channels = c1
a1.sinks.k1.channel = c1
8、拷贝jar包
将/home/hadoop/hadoop-2.7.2/中的以下文件拷贝到目录/apache-flume-1.7.0-bin/lib下
share/hadoop/common/hadoop-common-2.7.2.jar
share/hadoop/common/lib/commons-configuration-1.6.jar
share/hadoop/common/lib/hadoop-auth-2.7.2.jar
share/hadoop/hdfs/hadoop-hdfs-2.7.2.jar
share/hadoop/common/lib/htrace-core-3.1.0-incubating.jar
share/hadoop/common/lib/common-io-2.4.jar
9、启动flume1.7.0
bin/flume-ng agent --conf ./conf/ -f ./conf/flume.conf --name a1 -Dflume.root.logger=DEBUG,console 注意该命令的a1,要与配置文件中的a1相同
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· .NET Core 中如何实现缓存的预热?
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性