设为首页 加入收藏

TOP

Flume使用namespace操作
2018-11-13 16:08:51 】 浏览:27
Tags:Flume 使用 namespace 操作
版权声明:尊重原创,转载请标明"本文转自:https://blog.csdn.net/high2011" https://blog.csdn.net/high2011/article/details/70153668

参考:

(1)官方文档:http://flume.apache.org/FlumeUserGuide.html

1举例

(1)编辑flume-conf.properties文件

内容如下:

# 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 = exec

a1.sources.r1.command= tail -F /home/jifei_yang/testflume/data_dir/taildata/tailflume.txt

# Describe the sink

a1.sinks.k1.type = hdfs

#hdfs sink间隔多长将临时文件滚动成最终目标文件,单位:秒;

a1.sinks.k1.hdfs.rollInterval= 60

a1.sinks.k1.hdfs.rollSize= 0

a1.sinks.k1.hdfs.rollCount= 0

a1.sinks.k1.hdfs.path= hdfs://nameservice1test/user/piqiang_wei/testflume/%Y-%m-%d-%H

a1.sinks.k1.hdfs.useLocalTimeStamp= true

a1.sinks.k1.hdfs.fileType= DataStream

#当目前被打开的临时文件在该参数指定的时间(秒)内,没有任何数据写入,

#则将该临时文件关闭并重命名成目标文件;

a1.sinks.k1.hdfs.idleTimeout= 30

a1.sinks.k1.hdfs.kerberosPrincipal= log2hadoop

a1.sinks.k1.hdfs.kerberosKeytab= /home/jifei_yang/testflume/conf/log2hadoop_bgp_apple.keytab

# 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

2、注意

(1)、红色是需要在原来的基础上修改的地方

将原来的ip:8020-----》nameservice1test(命名空间)

(2)、提交命令

flume-ng agent --conf /home/jifei_yang/testflume/configs/piqiang_wei --conf-file /home/jifei_yang/testflume/my_properties/flume-conf.properties --name a1 -Dflume.root.logger=DEBUG,console

红色部分是新添加的配置目录,需要创建!


(3)、在目录下添加xml文件

目录:/home/jifei_yang/testflume/configs/piqiang_wei

文件:

这些文件是在namenode所在机器的目录(/etc/Hadoop/conf)下获取!


注:测试通过,可以按需修改使用!



】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Flume简介及配置 下一篇Flume 1.7.0安装与实例

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目