全链路监控系统开发

 2022-06-23 08:06

论文总字数:24433字

摘 要

如今的互联网服务正在向着分布式和微服务方向发展,这些应用服务模块分布在不同的服务器上,可能由不同的团队开发,可能由不同的编程语言实现。因此一个服务的调用可能横跨多个软件模块,仅通过日志进行运维需要投入大量的人力,且系统初期很难对开发人员要求在编码时输出用于运维阶段定位分析问题的日志,即使有了成熟的日志规范,也很难保证落实到位。尤其是系统成熟之后,如果还要考虑维护系统日志,这是非常麻烦的。本文将就微服务分布式系统设计出一个链路调用监控系统。

本文首先将对互联网应用的分布式和微服务化的迅猛发展进行一个简短的说明,分析链路监控系统的需求和应用前景。在就互联网服务的链路调用监控系统的相关理论基础和技术进行一个简单的介绍,分析一下行业内几个著名的分布式跟踪系统。结合KXD企业开发框架,结合企业运维需求,设计并介绍全链路监控系统的架构设计与技术选型。再就系统中的跟踪数据采集brave模块、跟踪数据存储storage模块、跟踪数据展示dashboard模块的实现进行一个详细的叙述。最后,对这次设计做出总结以及对此设计的未来可研究处提出一些自己的想法。

关键词:微服务,链路监控,业务监控,消息队列

Abstract

Today’s Internet services are moving toward distributed and microservices, these application service modules are distributed on different servers and may be developed by different teams and may be implemented in different programming languages. Therefore, the invocation of a service may span multiple software modules. It takes a lot of manpower to operate and maintain only the logs. In the initial stage of the system, it is difficult for the developer to request the log for the positioning and analysis of the operation and maintenance phase during coding. With mature log specifications, it is difficult to ensure that it is in place. Especially after the system is mature, if you also want to consider maintaining the system log, this is very troublesome. This paper will design a link call monitoring system for microservices distributed systems.

This paper first gives a brief description of the rapid development of distributed applications and microservices for Internet applications, and analyzes the requirements and application prospects of link monitoring systems. A brief introduction on the relevant theoretical basis and technology of the link call monitoring system for Internet services is provided, and several well-known distributed tracking systems in the industry are analyzed. Combined with the KXD enterprise development framework, combined with the needs of the company's operation and maintenance, it designs and introduces the architecture design and technology selection of the full-link monitoring system. Then a detailed description is given on the implementation of the trace data collection brave module, the trace data storage storage module, and the trace data display dashboard module in the system.Finally, a summary of the design and the future research department of the design put forward some of their own ideas.

KEY WORDS: microservices, link monitoring, business monitoring, message queue

目录

摘要 I

Abstract II

第一章 引言 1

1.1 选题背景和意义 1

1.2 研究现状 1

1.3 主要内容和难点 2

1.4 论文组织结构 3

第二章 技术综述 4

2.1 技术选型 5

2.2 logback日志组件 5

2.2.1 Logger 5

2.2.2 Appender 6

2.2.3 Layout 6

2.3 kafka 6

2.4 HBase 6

2.5 Elasticsearch 7

第三章 系统设计与实现 7

3.1 架构设计 8

3.2 数据采集 8

3.2.1 数据格式 9

3.2.2 Interceptor 11

3.2.3 Collector 12

3.2.4 采样率 12

3.2.5 自定义采集 12

3.3 数据存储 13

3.3.1 日志上报 13

3.3.2 kafka消息队列 13

3.3.3 数据存储 14

3.4 数据展示 15

3.4.1 调用链搜索 15

3.4.2 调用链展示 15

3.4.3 系统健康度 15

3.5 本章总结 16

第四章 系统测试 17

4.1 测试设计 17

4.2 接入说明 17

4.2.1 运行环境 17

4.2.2 配置说明 17

4.2.3 采集说明 17

4.3 测试过程 17

4.4 本章总结 19

第五章 总结和展望 20

5.1 总结 20

5.2 展望 20

参考文献 23

    1. 引言

选题背景和意义

最近几年,互联网应用服务越来越普及,从日常生活到国防科技,应用越来越广泛。随着用户量的增加,并发量增大,服务的并发吞吐量需求增大。随着应用场景越来越多,需求越来越复杂。且用户对服务响应速度越来越敏感,企业对系统的可扩展性、可用性需求越来越强烈。在计算机领域,当单机性能达到瓶颈时,有两种方式可以解决问题,一是使用性能更好的硬件设备,提高机器配置,二是分布式应用部署,水平扩展。由于硬件一定存在某个极限,不足以匹配日益复杂的用户需求,所以互联网应用架构正在逐渐由传统的集中式向分布式转变。“分布式系统是组件分布在网络计算机上且通过消息传递进行通信和动作协调的系统”[1]。使用分布式系统可以增大系统吞吐量。一台机器的系统性能已经不可能满足绝大部分市场上的互联网服务,需要多台机器通过分布式处理才能应对大规模的应用场景。同时可以增加系统容错性。互联网应用中的业务越来越关键,在系统架构中不能存在单系统组件出故障而导致整个系统瘫痪,因此需要从系统架构层面提高系统可用性,可以通过分布式架构来提高系统冗余。模块化同样也是计算机领域未来的发展方向,由于互联网应用模块被拆分,开发和部署可以并行且系统模块的重用度增加,从而加快了开发和发布的速度,同时系统的可扩展性也有所增加。

传统的互联网应用软件大多是由各种独立系统堆叠而成,在系统规模较小时有很好的表现,但在业务复杂、用户量大的系统中它却会出现很多问题。例如由于所有模块耦合在一起,造成代码量大,逻辑混乱,维护困难,将导致技术债务越来越多,部署越来越繁琐,系统扩展性差,后续无法根据需求变化伸缩,系统复杂性越来越高。且单体架构在存储方式和开发框架上的选择需要统一,不利于系统的扩展,而微服务架构在这些方面显得更加灵活。微服务架构是一种将服务分解开发部署的架构模式,这些分解的服务相互协调构成整个系统。每个服务可以独立开发部署,独自完成自己业务模块上的职责,通过轻量级的通信机制交换数据。“另外,应尽量避免统一的、集中式的服务管理机制,对具体的一个服务而言,应根据业务上下文,选择合适的语言、工具对其进行构建”[2]。所以对于那些服务之间是松耦合的,可以独立的部署和运行,使用轻量级的通信机制和架构的互联网应用,微服务架构是其最好的选择。

剩余内容已隐藏,请支付后下载全文,论文总字数:24433字

您需要先支付 80元 才能查看全部内容!立即支付

该课题毕业论文、开题报告、外文翻译、程序设计、图纸设计等资料可联系客服协助查找;