flume java客户端_flume使用(一):入门demo

注:windows的flume安装运行传送门:windows上安装运行flume

环境

Centos7+jdk7+flume1.7+telnet客户端

注:最新版flume1.8需要jdk1.8支持

安装

jdk的安装不多赘述,flume1.7的安装。

进入官网:http://flume.apache.org/

然后找到1.7版本下载放到centos系统解压即可

根据官方文档quickStart

解压文件中打开docs文件夹中的index.html即可本地查看文档

官方文档地址(PDF版):http://flume.apache.org/releases/content/1.7.0/FlumeUserGuide.pdf

进入Flume 1.7.0 User Guide 根据stepup进行操作:根据A simple example的步骤。这里就不一一翻译原文,直接上实际步骤

1.在apache-flume-1.7.0-bin\conf目录下创建一个example.conf配置文件

然后把官文档中的案例内容复制到example.conf文件中,如下内容:

# 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

2.进入到解压flume目录中执行命令文档中的执行命令如下:

[root@mini3 apache-flume-1.7.0-bin]# bin/flume-ng agent --conf conf --conf-file conf/example.conf --name a1 -Dflume.root.logger=INFO,console

参数的简要说明:指明conf文件路径、指明conf文件、指定agent、指明log打印信息级别和位置

更加详细的参数说明可查看文档中的介绍

执行效果:</

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值