flume 1.7
flume 1.7
柯里昂 发表于6个月前
flume 1.7
  • 发表于 6个月前
  • 阅读 15
  • 收藏 0
  • 点赞 0
  • 评论 0

新睿云服务器60天免费使用,快来体验!>>>   

# 官网 简单的入门例子
# 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
# 启动 flume agent
bin/flume-ng agent --conf conf --conf-file example.conf --name a1 -Dflume.root.logger=INFO,console
# 同节点,另起一个终端
nc localhost 44444
# 同时输出到终端和文件
# example.conf: A single-node Flume configuration

# Name the components on this agent
a1.sources = r1
a1.sinks = k2 k1
a1.channels = c1 c2

# Describe/configure the source
a1.sources.r1.type = netcat
a1.sources.r1.bind = dn7
a1.sources.r1.port = 44444

# Describe the sink
a1.sinks.k1.type = logger
a1.sinks.k2.type = file_roll
a1.sinks.k2.sink.directory=/tmp/k2/

# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

# Use a channel which buffers events in memory
a1.channels.c2.type = memory
a1.channels.c2.capacity = 1000
a1.channels.c2.transactionCapacity = 100

# Bind the source and sink to the channel
a1.sources.r1.channels = c1 c2

a1.sinks.k1.channel = c1
a1.sinks.k2.channel = c2
# 同时在控制台,hdfs,file-roll
# example.conf: A single-node Flume configuration

# Name the components on this agent
a1.sources = r1
a1.sinks = k2 k1 k3
a1.channels = c1 c2 c3

# Describe/configure the source
a1.sources.r1.type = netcat
a1.sources.r1.bind = dn6
a1.sources.r1.port = 44444

# Describe the sink
a1.sinks.k1.type = logger

a1.sinks.k2.type = file_roll
a1.sinks.k2.sink.directory=/tmp/k2/

a1.sinks.k3.type=hdfs
a1.sinks.k3.hdfs.path=hdfs://nn2:8020/tmp/test/flume/
a1.sinks.k3.hdfs.filePrefix=test-
a1.sinks.k3.hdfs.round=true
a1.sinks.k3.hdfs.roundValue=10
a1.sinks.k3.hdfs.roundUnit=second
a1.sinks.k3.hdfs.fileType=DataStream

# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

# Use a channel which buffers events in memory
a1.channels.c2.type = memory
a1.channels.c2.capacity = 1000
a1.channels.c2.transactionCapacity = 100

# Use a channel which buffers events in memory
a1.channels.c3.type = memory
a1.channels.c3.capacity = 1000
a1.channels.c3.transactionCapacity = 100

# Bind the source and sink to the channel
a1.sources.r1.channels = c1 c2 c3

a1.sinks.k1.channel = c1
a1.sinks.k2.channel = c2
a1.sinks.k3.channel = c3
# 将agent的配置文件上传到 zk后,所有运行agent的节点都可从zk获取
bin/flume-ng agent –conf conf -z zkhost:2181,zkhost1:2181 -p /flume –name a1 -Dflume.root.logger=INFO,console

第三方插件

Flume Channels: Memory Channel

Flume Sinks: logger

# -Dorg.apache.flume.log.printconfig=true -Dorg.apache.flume.log.rawdata=true
标签: flume 1.7
  • 打赏
  • 点赞
  • 收藏
  • 分享
共有 人打赏支持
粉丝 21
博文 129
码字总数 72647
×
柯里昂
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: