当前位置:网站首页>流数据
流数据
2022-06-25 22:02:00 【bingoabin】
一、架构思路
思考一下,正常情况下我们会如何收集并分析日志呢?
首先,业务日志会通过Nginx(或者其他方式,我们是使用Nginx写入日志)每分钟写入到磁盘中,现在我们想要使用Spark分析日志,就需要先将磁盘中的文件上传到HDFS上,然后Spark处理,最后存入Hive表中,如图所示:
我们之前就是使用这种方式每天分析一次日志,但是这样有几个缺点:
首先我们的日志是通过Nginx每分钟存成一个文件,这样一天的文件数很多,不利于后续的分析任务,所以先要把一天的所有日志文件合并起来。
合并起来以后需要把该文件从磁盘传到Hdfs上,但是我们的日志服务器并不在Hadoop集群内,所以没办法直接传到Hdfs上,需要首先把文件从日志服务器传输到Hadoop集群所在的服务器,然后再上传到Hdfs。
最后也是最重要的,滞后一天分析数据已经不能满足我们新的业务需求了,最好能控制在一个小时的滞后时间。
可以看出来我们以前收集分析日志的方式还是比较原始的,而且比较耗时,很多时间浪费在了网络传输上面,如果日志量大的话还有丢失数据的可能性,所以在此基础上改进了一下架构:
<
边栏推荐
- 28 rounds of interviews with 10 companies in two and a half years (including byte, pinduoduo, meituan, Didi...)
- CAD中图纸比较功能怎么用
- Qlabel text scrolling horizontally
- 二进制、16进制、大端小端
- 信息学奥赛一本通 1353:表达式括号匹配(stack) | 洛谷 P1739 表达式括号匹配
- .user.ini文件导致的php网站安装问题
- 库项目和App项目中清单文件的包名不要相同
- excel如何实现中文单词自动翻译成英文?这个公式教你了
- C1. k-LCM (easy version)-Codeforces Round #708 (Div. 2)
- 中序线索二叉树
猜你喜欢
UE4 learning record 2 adding skeleton, skin and motion animation to characters
jdbc常见异常及错误解决办法汇总
Graduation trip | recommended 5-day trip to London
Pointer strengthening and improvement
Reprint: detailed explanation of qtablewidget (style, right-click menu, header collapse, multiple selection, etc.)
Uni app -- listen for the exit of the return key
28 rounds of interviews with 10 companies in two and a half years (including byte, pinduoduo, meituan, Didi...)
1.8 billion pixel Mars panorama Ultra HD released by NASA, very shocking
提取系统apk
先序线索二叉树
随机推荐
Share a downloaded osgeo4w64 Library Based on qgis3.10
ACM. Hj16 shopping list ●●
[untitled] open an item connection. If it cannot be displayed normally, Ping the IP address
UE4 learning record 2 adding skeleton, skin and motion animation to characters
后序线索二叉树
Episode 3: thread synchronization using thread lock
#23class介绍
期末复习【机器学习】
#24class静态成员
转载: QTableWidget详解(样式、右键菜单、表头塌陷、多选等)
字符串
CSDN原力值
cookie、session、token
提取系统apk
hiberate实体类CURD、事务操作汇总
UE4 学习记录一 创建角色,并控制其移动
Windows安装Redis及简单使用
C. Planar Reflections-CodeCraft-21 and Codeforces Round #711 (Div. 2)
Classic image segmentation network: UNET supports libtorch deployment reasoning [with code]
森林的先序和中序遍历