摘要
云计算时代,越来越多的企业开始采用微服务架构进行软件开发或者传统巨石应用改造。然而,微服务系统具有较高的复杂性和动态性,当系统出现故障时,目前没有方法或者工具能够有效支持对故障根源的定位。为此,文中首次提出通过调用链信息关联单次业务请求在所有服务上产生的业务日志,并在此基础上研究基于日志可视化分析的微服务系统调试方法。首先定义了微服务的日志模型,规范化微服务日志可视化分析所需要的数据信息;然后针对4种典型的微服务故障(有异常抛出的普通故障、无异常抛出的逻辑故障、服务异步调用序列未控制导致的故障以及服务多实例版本或状态不一致导致的故障)总结出5种可视化调试策略,用于支持对故障根源的定位,5种策略包括:单条调用链日志查看、不同调用链对比、服务异步调用分析、服务多实例分析以及调用链分段。为了实现服务异步调用分析和服务多实例分析,文中设计了两个算法,同时,设计并实现了一个原型工具LogVisualization。LogVisua-lization可以收集微服务系统运行时产生的日志信息、调用链数据以及集群的节点和服务实例信息,能够以较小的代码侵入性,实现通过调用链信息关联所有业务日志,支持用户使用5种策略进行可视化调试。最后,将该原型工具应用于实际的微服务系统,通过与现有工具(Zipkin+ELK)的实验对比,验证了该原型工具在4种微服务故障根源定位上的有用性和高效性。
In the era of cloud computing,more and more enterprises are adopting microservice architecture for software development or traditional monolithic application transformation.However,microservice system has high complexity and dynamism.When microservice system fails,there is currently no method or tool that can effectively support the location of the root cause of failure.To this end,the paper first proposed that all business log generated on all of the ser-vices by a single request can be associated by the trace information.And on this basis,this paper studied the method of microservice system debugging based on log visualization analysis.Firstly,the model of microservice log is defined.So the data information required for log visualization analysis can be specified.Then five kinds of visual debug strategies are summarized to support the location of four kinds of typical microservice fault’s root cause.The four kinds of microservice faults are ordinary fault with exceptions,logical fault with no exceptions,fault caused by unexpected service asynchronous invocation sequences and faults caused by service multi-instances.The strategies include single trace with log information,comparison of different traces,service asynchronous invocation analysis,service multi-instances analysis and trace segmentation.Among them,in order to realize service asynchronous invocation analysis and service multi-instances analysis,this paper designed two algorithms.At the same time,a prototype tool named LogVisualization was designed and implemented.LogVisualization can collect log information,trace data,nodes information and service instance information of the cluster,generated by the microservice system runtime.It can associate the business log with trace information by less code intrusion.And it supports users to use five strategies for visual debug.Finally,the prototype tool is applied to the actual micro-service system.Compared with the existing tools(Zipkin+ELK),the usefulness and effectiveness of prototype tool in the root location of four micro-service faults are verified.
作者
李文海
彭鑫
丁丹
向麒麟
郭晓峰
周翔
赵文耘
LI Wen-hai;PENG Xin;DING DAN;XIANG Qi-lin;GUO Xiao-feng;ZHOU Xiang;ZHAO Wen-yun(School of Computer Science,Fudan University,Shanghai 201203,China;Shanghai Key Laboratory of Data Science,Fudan University,Shanghai 201203,China)
出处
《计算机科学》
CSCD
北大核心
2019年第11期145-155,共11页
Computer Science
基金
国家重点研发计划项目(2018YFB1004803)资助
关键词
微服务
调用链
日志
可视化
故障
调试
Microservice
Trace
Log
Visualization
Fault
Debugging