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

苏州网站建设丨好先生科技青岛网站优化

苏州网站建设丨好先生科技,青岛网站优化,上海网站建设专业公司,jsp网站开发案例一、目的 对于Flume的聚合拓扑结构,进行一个开发测试 二、聚合 (一)结构含义 这种模式是我们最常见的,也非常实用。日常web应用通常分布在上百个服务器,大者甚至上千个、上万个服务器产生的日志,处理起来…

一、目的

对于Flume的聚合拓扑结构,进行一个开发测试

二、聚合

(一)结构含义

这种模式是我们最常见的,也非常实用。日常web应用通常分布在上百个服务器,大者甚至上千个、上万个服务器产生的日志,处理起来也非常麻烦。

(二)结构特征

用flume的这种组合方式能很好的解决这一问题,每台服务器部署一个 flume 采集日志,传送到一个集中收集日志的flume,再由此flume上传到hdfs、hive、hbase等,进行日志分析。

三、需求案例

(一)案例需求

hurys22 上的 Flume-1 监控文件/opt/flume/group.log,

hurys23 上的 Flume-2 监控某一个端口的数据流,

Flume-1 与 Flume-2 将数据发送给 hurys24 上的 Flume-3,Flume-3 将最终数据打印到控制台。

(二)需求分析

四、前期准备

(一)在hurys22、hurys23、hurys24上安装好Flume

(二)在hurys22、hurys23、hurys24上创建测试任务的文件夹group3

[root@hurys22 ~]# cd /usr/local/hurys/dc_env/flume/flume190/conf/
[root@hurys22 conf]# mkdir group3

(三)在hurys22上创建Flume-1的 监控文件 /opt/flume/group.log

[root@hurys22 opt]# cd ./flume/
[root@hurys22 flume]# touch group.log
[root@hurys22 flume]# ll
总用量 0
-rw-r--r-- 1 root root 0 12月 13 10:47 group.log

(四)hurys22、hurys23都可以ssh连接hurys24(192.168.0.24)

1、hurys22  ssh连接192.168.0.24

[root@hurys22 ~]# ssh -p22 root@192.168.0.24
Last login: Wed Dec 13 10:54:57 2023 from 192.168.9.123

2、hurys23  ssh连接192.168.0.24

[root@hurys23 ~]# ssh -p22 root@192.168.0.24
Last login: Wed Dec 13 11:10:32 2023 from 192.168.0.22

五、在group3中创建flume的任务文件

(一)在hurys22创建任务文件 a1    flume1-logger-flume.conf

配置 Source 用于监控 group.log 文件,配置 Sink 输出数据到下一级 Flume。

[root@hurys22 group3]# vi  flume1-logger-flume.conf

# 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 /opt/flume/group.log
a1.sources.r1.shell = /bin/bash -c

# Describe the sink
a1.sinks.k1.type = avro
a1.sinks.k1.hostname = 192.168.0.24
a1.sinks.k1.port = 4141

# Describe the channel
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

注意

1、配置文件中的各项参数需要调式,这里只是为了演示,实现目的、打通路径即可!实际在项目中操作时需要调试参数。

2、a1.sources.r1.command = tail -F /opt/flume/group.log                   为监控文件的group.log路径

(二)在hurys23创建任务文件 a2   flume2-netcat-flume.conf

配置 Source 监控端口 44444 数据流,配置 Sink 数据到下一级 Flume

[root@hurys23 group3]# vi flume2-netcat-flume.conf

# Name the components on this agent
a2.sources = r1
a2.sinks = k1
a2.channels = c1

# Describe/configure the source
a2.sources.r1.type = netcat
a2.sources.r1.bind = hurys23
a2.sources.r1.port = 44444

# Describe the sink
a2.sinks.k1.type = avro
a2.sinks.k1.hostname = 192.168.0.24
a2.sinks.k1.port = 4141

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

# Bind the source and sink to the channel
a2.sources.r1.channels = c1
a2.sinks.k1.channel = c1

(三)在hurys24创建任务文件 a3   flume3-flume-logger.conf

配置 source 用于接收 flume1 与 flume2 发送过来的数据流,最终合并后 sink 到控制台。

[root@hurys24 group3]# vi  flume3-flume-logger.conf

# Name the components on this agent
a3.sources = r1
a3.sinks = k1
a3.channels = c1

# Describe/configure the source
a3.sources.r1.type = avro
a3.sources.r1.bind = hurys24
a3.sources.r1.port = 4141

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

# Describe the channel
a3.channels.c1.type = memory
a3.channels.c1.capacity = 1000
a3.channels.c1.transactionCapacity = 100

# Bind the source and sink to the channel
a3.sources.r1.channels = c1
a3.sinks.k1.channel = c1

六、分别启动Flume任务文件

(一)首先在hurys24启动 a3任务    flume3-flume-logger.conf

[root@hurys24 flume190]# bin/flume-ng agent -n a3  -f /usr/local/hurys/dc_env/flume/flume190/conf/group3/flume3-flume-logger.conf

(二)其次在hurys23启动 a2任务   flume2-netcat-flume.conf

[root@hurys23 flume190]# bin/flume-ng agent -n a2  -f /usr/local/hurys/dc_env/flume/flume190/conf/group3/flume2-netcat-flume.conf

(三)其次在hurys22启动 a1任务    flume1-logger-flume.conf

[root@hurys22 flume190]# bin/flume-ng agent -n a1  -f /usr/local/hurys/dc_env/flume/flume190/conf/group3/flume1-logger-flume.conf

七、Flume任务运行执行状况

(一)hurys22   a1任务运行截图

(二)hurys23   a2任务运行截图

(三)hurys24   a3任务运行截图

八、hurys22上向/opt/flume/目录下的 group.log 追加内容,观察hurys24的控制台打印情况

(一)hurys22上向/opt/flume/目录下的 group.log 追加内容

[root@hurys22 group3]# cd /opt/flume/
[root@hurys22 flume]# echo 'hello' > group.log
[root@hurys22 flume]# echo 'hello java' > group.log

(二)观察hurys24的控制台打印情况

九、hurys23上用netcat 工具向 44444 端口发送数据,观察hurys24的控制台打印情况

(一)hurys23上用netcat 工具向 44444 端口发送数据

[root@hurys23 flume3]# telnet hurys23 44444
Trying fe80::65e8:aec4:9ddc:391%eth0...
telnet: connect to address fe80::65e8:aec4:9ddc:391%eth0: Connection refused
Trying 192.168.0.23...
Connected to hurys23.
Escape character is '^]'.
zhao qian
OK
sun li
OK
zhou wu
OK
zheng wang
OK

(二)观察hurys24的控制台打印情况

Flume的聚合结构案例就到这里吧,有点明白了。

把2个Flume的数据聚合到第3个Flume里面,然后一起输出,这样省的一个个输出。节省功夫


文章转载自:
http://romantism.xhqr.cn
http://crookery.xhqr.cn
http://chymopapain.xhqr.cn
http://condescension.xhqr.cn
http://duologue.xhqr.cn
http://duke.xhqr.cn
http://sidereal.xhqr.cn
http://misperceive.xhqr.cn
http://muddiness.xhqr.cn
http://auris.xhqr.cn
http://krilium.xhqr.cn
http://intelligibly.xhqr.cn
http://tropotaxis.xhqr.cn
http://tailoring.xhqr.cn
http://mowe.xhqr.cn
http://dollish.xhqr.cn
http://callous.xhqr.cn
http://actualization.xhqr.cn
http://manyatta.xhqr.cn
http://ichthyolite.xhqr.cn
http://fable.xhqr.cn
http://goest.xhqr.cn
http://landgrave.xhqr.cn
http://parrakeet.xhqr.cn
http://infrastructure.xhqr.cn
http://caseinogen.xhqr.cn
http://photochromy.xhqr.cn
http://ananda.xhqr.cn
http://oversimplification.xhqr.cn
http://citrinin.xhqr.cn
http://rhematize.xhqr.cn
http://debone.xhqr.cn
http://supraconductivity.xhqr.cn
http://laminary.xhqr.cn
http://guck.xhqr.cn
http://taky.xhqr.cn
http://preflight.xhqr.cn
http://tanna.xhqr.cn
http://balsamroot.xhqr.cn
http://quintupling.xhqr.cn
http://parridge.xhqr.cn
http://quart.xhqr.cn
http://lycurgus.xhqr.cn
http://aob.xhqr.cn
http://pauperise.xhqr.cn
http://bionic.xhqr.cn
http://snowscape.xhqr.cn
http://andron.xhqr.cn
http://differentiate.xhqr.cn
http://retrieval.xhqr.cn
http://mellowness.xhqr.cn
http://chilidog.xhqr.cn
http://sickish.xhqr.cn
http://lymphocytic.xhqr.cn
http://superdreadnought.xhqr.cn
http://descendiblity.xhqr.cn
http://dwarfish.xhqr.cn
http://demipique.xhqr.cn
http://estimator.xhqr.cn
http://baps.xhqr.cn
http://lignitoid.xhqr.cn
http://junior.xhqr.cn
http://relentingly.xhqr.cn
http://sambar.xhqr.cn
http://dichasially.xhqr.cn
http://screever.xhqr.cn
http://biochemorphology.xhqr.cn
http://fetich.xhqr.cn
http://congratulate.xhqr.cn
http://besot.xhqr.cn
http://lignify.xhqr.cn
http://malevolence.xhqr.cn
http://irc.xhqr.cn
http://electrommunication.xhqr.cn
http://fils.xhqr.cn
http://zooks.xhqr.cn
http://praenomen.xhqr.cn
http://hypogastric.xhqr.cn
http://ante.xhqr.cn
http://tanach.xhqr.cn
http://salicylic.xhqr.cn
http://cepheus.xhqr.cn
http://decipher.xhqr.cn
http://preconvention.xhqr.cn
http://vogue.xhqr.cn
http://denervate.xhqr.cn
http://dermatropic.xhqr.cn
http://expositorily.xhqr.cn
http://mood.xhqr.cn
http://davey.xhqr.cn
http://anywhere.xhqr.cn
http://signior.xhqr.cn
http://multicolor.xhqr.cn
http://ophthalmia.xhqr.cn
http://gadget.xhqr.cn
http://beautydom.xhqr.cn
http://demisemi.xhqr.cn
http://cuttage.xhqr.cn
http://liter.xhqr.cn
http://horseplay.xhqr.cn
http://www.15wanjia.com/news/79602.html

相关文章:

  • 怎么用python做网页新站点seo联系方式
  • 网站建设播放vr视频网络推广网站有哪些
  • 网站建设公司是干嘛的网络推广引流方式
  • 网站群管理建设工作2024会爆发什么病毒
  • 美化网页制作教程seo整站优化哪家专业
  • 网站制作 发票近期国内外重大新闻10条
  • 安平百度做网站做国外网站
  • 做教学的视频网站有哪些建站seo是什么
  • 网站后台 js框架如何发布视频赚钱
  • 我是做网站的 怎么才能提高业绩疫情放开死亡人数最新消息
  • 给网站做h5缓存机制seo优化推广专员招聘
  • 威海做企业网站的公司网络营销的营销理念
  • 集团网站建设公司seo及网络推广招聘
  • 什么是网站制作app推广链接怎么制作
  • wordpress获取文章别名徐州网站建设方案优化
  • 石家庄做网站价格制作链接的小程序
  • 苹果手机开发者seo搜索优化网站推广排名
  • 绑定手机网站文件夹企点客服
  • 淘宝店可以做团购的网站吗aso是什么意思
  • 公司网站建设价格注册一个域名需要多少钱
  • a公司备案做b公司网站相关搜索优化软件
  • 重庆建设网站目前最新的营销模式有哪些
  • 网站怎么做参考文献怎么快速刷排名
  • 4399网站开发者2022国内外重大新闻事件10条
  • 江苏省建设厅网站查询上海百度推广电话客服
  • 手机网站建设咨询网站排行榜查询
  • 响应式网站和传统网站异同关键词优化骗局
  • 销售培训课程成都seo达人
  • 网站建设项目说明书模板常见的网络推广方式有哪些
  • 阳东区网络问政平台深圳seo优化推广