[Flume基础]-- 配置 HDFS 的namespace 方法

 参考:

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

(2)中文文档:http://download.csdn.net/download/high2011/9812414

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)下获取!

 

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

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

往事随风ing

你的鼓励将是我创作的最大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值