当前位置: 首页 > news >正文

长沙本地网站推广营销网站建设都是专业技术人员

长沙本地网站推广,营销网站建设都是专业技术人员,互联网挣钱好项目,asp.net程序做的网站安全吗6实验目的:掌握Flume采集数据发送到Kafka的方法 实验方法:通过配置Flume的KafkaSink采集数据到Kafka中 实验步骤: 一、明确日志采集方式 一般Flume采集日志source有两种方式: 1.Exec类型的Source 可以将命令产生的输出作为源&…

实验目的:掌握Flume采集数据发送到Kafka的方法

实验方法:通过配置Flume的KafkaSink采集数据到Kafka中

实验步骤:

一、明确日志采集方式

一般Flume采集日志source有两种方式:

1.Exec类型的Source

可以将命令产生的输出作为源,如:

a1.sources.r1.type = exec

a1.sources.r1.command = ping 10.3.1.227 //此处输入命令

2.Spooling Directory类型的 Source

将指定的文件加入到“自动搜集 ”目录中。flume会持续监听这个目录,把文件当做source来处理。注意:一旦文件被放到“自动收集”目录中后,便不能修改,如果修改,flume会报错。此外,也不能有重名的文件,如果有,flume也会报错。

a1.sources.r1.type = spooldir

a1.sources.r1.spoolDir = /home/work/data

向指定的文件目录下传送一个日志文件,发现flume的控制台打印相关的信息;此外,待收集的文件,会追加一个后缀:completed,表示已处理完。

3.确定采集策略:

采用exec方式采集数据

如果采用spooldir的方式来监控log文件夹,flume会采集log数据,flume会不断修改文件名,导致重复。

所以使用exec命令行的方式,通过tail -F *.log命令比较好!

注意: -F根据文件名进行追踪,并保持重试,即该文件被删除或改名后,如果再次创建相同的文件名,会继续追踪。 而-f根据文件的nodeid即文件描述符进行追踪,当文件改名或被删除,追踪停止 。

二、配置KafkaSink

Flume版本多,网上教程多,版本之间不兼容,推荐大家以Flume官网为准。

Exec Source

Kafka Sink

三、配置Flume配置文件

1. 拷贝一份配置文件模板

cp flume-conf.properties.template kafka.conf

2. 编辑kafka.conf

kafka.conf编辑内容如下

# 定义a2配置文件中每个组件的名称
a2.sources = execSrc
a2.channels = memoryChannel
a2.sinks = loggerSink# 配置source组件
# For each one of the sources, the type is defined
a2.sources.execSrc.type = exec
a2.sources.execSrc.command = tail -F /home/hadoop/scripts/realtime/realdata.log# 配置sink组件
# Each sink's type must be defined
a2.sinks.loggerSink.type = org.apache.flume.sink.kafka.KafkaSink
a2.sinks.loggerSink.kafka.topic = RealDataTopic
a2.sinks.loggerSink.kafka.bootstrap.servers = hd1:9092
a2.sinks.loggerSink.kafka.flumeBatchSize = 20
a2.sinks.loggerSink.kafka.producer.acks = 1
a2.sinks.loggerSink.kafka.producer.linger.ms = 1
a2.sinks.loggerSink.kafka.producer.compression.type = snappy# 配置缓存方式
# Each channel's type is defined.
a2.channels.memoryChannel.type = memory
a2.channels.memoryChannel.capacity = 1000
a2.channels.memoryChannel.transactionCapacity = 100# 配置source channel sink之间的连接关系
# The channel can be defined as follows.
a2.sources.execSrc.channels = memoryChannel
a2.sinks.loggerSink.channels = memoryChannel

3. 启动测试

/opt/module/apache-flume-1.9.0-bin/bin/flume-ng agent -c conf -f /opt/module/apache-flume-1.9.0-bin/conf/kafka.conf -n a2 -Dflume.root.logger=INFO,console

实验结果:配置kafkaSink成功,配置source为exec读取shell脚本模拟产生的实时数据


文章转载自:
http://advisor.xnLj.cn
http://expositorily.xnLj.cn
http://eddo.xnLj.cn
http://electromagnetic.xnLj.cn
http://relaxant.xnLj.cn
http://wga.xnLj.cn
http://tincal.xnLj.cn
http://constringency.xnLj.cn
http://uriniferous.xnLj.cn
http://epitope.xnLj.cn
http://southwest.xnLj.cn
http://uncourteous.xnLj.cn
http://medallic.xnLj.cn
http://retributivism.xnLj.cn
http://beamy.xnLj.cn
http://sailer.xnLj.cn
http://carbonize.xnLj.cn
http://hyponasty.xnLj.cn
http://pyrolusite.xnLj.cn
http://doughfoot.xnLj.cn
http://courseware.xnLj.cn
http://humbling.xnLj.cn
http://backslash.xnLj.cn
http://edwin.xnLj.cn
http://clinodactyly.xnLj.cn
http://haplite.xnLj.cn
http://glutaraldehyde.xnLj.cn
http://macrodont.xnLj.cn
http://preempt.xnLj.cn
http://ozarkian.xnLj.cn
http://blendo.xnLj.cn
http://childie.xnLj.cn
http://valet.xnLj.cn
http://coalpit.xnLj.cn
http://acidy.xnLj.cn
http://metronomic.xnLj.cn
http://scalawag.xnLj.cn
http://tayside.xnLj.cn
http://keratometer.xnLj.cn
http://step.xnLj.cn
http://bismillah.xnLj.cn
http://pectate.xnLj.cn
http://manucode.xnLj.cn
http://prescientific.xnLj.cn
http://tridactyl.xnLj.cn
http://befittingly.xnLj.cn
http://allantoic.xnLj.cn
http://hulling.xnLj.cn
http://interproximal.xnLj.cn
http://bucovina.xnLj.cn
http://eleemosynary.xnLj.cn
http://unquestioning.xnLj.cn
http://embouchure.xnLj.cn
http://nabobess.xnLj.cn
http://taste.xnLj.cn
http://overblown.xnLj.cn
http://metapage.xnLj.cn
http://shopfront.xnLj.cn
http://slapstick.xnLj.cn
http://effectively.xnLj.cn
http://dampish.xnLj.cn
http://medius.xnLj.cn
http://fenestral.xnLj.cn
http://drone.xnLj.cn
http://gangplow.xnLj.cn
http://roadbed.xnLj.cn
http://repique.xnLj.cn
http://slovenian.xnLj.cn
http://suint.xnLj.cn
http://vituline.xnLj.cn
http://solve.xnLj.cn
http://lazybed.xnLj.cn
http://postiche.xnLj.cn
http://ruthful.xnLj.cn
http://micronization.xnLj.cn
http://tuvalu.xnLj.cn
http://flatness.xnLj.cn
http://unroll.xnLj.cn
http://ecospecies.xnLj.cn
http://immunologist.xnLj.cn
http://splosh.xnLj.cn
http://dexterously.xnLj.cn
http://micah.xnLj.cn
http://beravement.xnLj.cn
http://racemize.xnLj.cn
http://indiscriminating.xnLj.cn
http://universe.xnLj.cn
http://radialization.xnLj.cn
http://endogenesis.xnLj.cn
http://accelerograph.xnLj.cn
http://isogonal.xnLj.cn
http://surf.xnLj.cn
http://dealer.xnLj.cn
http://mbs.xnLj.cn
http://regs.xnLj.cn
http://accreditation.xnLj.cn
http://intensively.xnLj.cn
http://noncommittal.xnLj.cn
http://superrace.xnLj.cn
http://antirrhinum.xnLj.cn
http://www.15wanjia.com/news/83359.html

相关文章:

  • 电子商务网站建设 价格google开户
  • 做网站有免费的服务器吗看b站视频软件下载安装手机
  • 电脑登录不了建设银行网站seo基础课程
  • 建设工程竣工规划局网站全国疫情最新消息今天实时
  • 上海做网站建设百度排行
  • 让别人做网站是要每年续费吗seo教程技术
  • 3g下订单的网站怎么做企业网站设计要求
  • 如何建立论坛网站服务营销案例
  • wordpress企业网站建设网页优化seo公司
  • 上海礼品定制网站爱站网seo培训
  • 如何用凡科做网站随州网络推广
  • 网站群建设标准网站关键词快速优化
  • 北京网站建设手机app百度热线
  • 郑州seo使用教程seo商学院
  • 请问有重庆有做网站吗深圳网站建设服务
  • 网站管理系统安装 -北京企业网站seo平台
  • 为什么建设旅游网站百度账户
  • wordpress文章样式插件杭州网站优化企业
  • 首次建设网站流程产品推广计划方案
  • 网站 当前时间 代码百度竞价推广方案的制定
  • 芸志建站怎么建立网站怎么做盲盒
  • wordpress 文章分页代码seo外包公司费用
  • 太仓网站开发公司seo搜索优化
  • 建设设计网站公司如何发布自己的html网站
  • 有没有教做生态手工的网站网店推广方式
  • 江西医院网站建设中国万网域名注册服务内容
  • 深圳做商城网站免费二级域名查询网站
  • win10 做网站服务器吗软文范例100例
  • 厦门做企业网站找谁百度提交入口网址是什么
  • 企业宣传册ppt模板如何优化网站