分布式主机日志采集与分析系统的设计与实现

 2022-10-01 08:10

论文总字数:36585字

摘 要

本文基于ELK(Elasticsearch、Logstash、Kibana)开源软件,为中国教育和科研计算机网CERNET华东北地区网络中心开发了一个分布式主机日志采集与分析系统。

本文为了帮助络中心在面对主机故障或是网络入侵时能够及时发现和记录相关信息而开发了本系统。论文首先研究了ELK及Redis软件的原理和使用方法,对于日志采集工具Logstash的配置方法进行了讨论,然后探索了重要日志的存储结构,从而能够通过Logstash的正则匹配对日志信息进行字段分解,并且研究了系统信息的获取方式。之后通过总体设计对系统进行了设计,确定了系统的功能和模块,以及数据结构和可视化页面设计,并在三台实验主机的基础上进行了实际的部署。最后进行了关键的系统完整性和正确性验证,证明了系统完成设计目标,能够完整且正确的采集实验主机上的日志数据。

根据测试验证的结果,证明了本系统在在多主机的情况下也能够正常完成日志采集分析的功能,对于部署到网络中心提供了很好的样例,可以在改善本系统的基础上实际部署。

关键词:分布式系统,Linux系统信息,日志采集,ELK

Abstract

In this thesis, based on ELK (Elasticsearch, Logstash, Kibana) open source software, a distributed host log collection and analysis system has been developed for the Eastern(north) network center of China Education and Research Network.

In order to ensure that the network center in the face of host failure or network intrusion can be found and recorded in time to develop the system. Firstly, I studied the principle and method of ELK and Redis software, and researched the configuration method of Logstash deeply. Then, the storage structure of the important log was explored, so that the log information can be decomposed by Logstash's regular matching, and the way of obtaining the system information is studied. Then I made the design of the system through the overall design, to determine the system functions and modules, as well as data structures and visual design of the page. After that I did the actual deployment in the three experimental hosts. Finally, I made the test to ensure the system’s integrity and correctness, which proves that the system has completed the design goal and can collect the log data on the experimental host completely and correctly.

According to the results of test verification, it is proved that the system can complete the function of log acquisition and analysis in the case of multi-master. It provides a good example for deploying to the network center, and can be actually deployed on the basis of improving the system.

KEY WORDS: distributed system, Linux system information, log collection, ELK

目 录

摘 要 I

Abstract II

第一章 绪论 1

1.1 引言 1

1.2 国内外研究现状 2

1.3 现有工作基础 3

1.4 本文实现目标 3

第二章 相关技术 4

2.1 Linux系统环境 4

2.2 Linux系统日志 4

2.2.1 系统日志 5

2.2.2 应用日志 6

2.3 Linux系统信息 6

2.3.1 进程信息 6

2.3.2 端口信息 6

2.4 相关开源软件 7

2.4.1 Elasticsearch 7

2.4.2 Logstash 7

2.4.3 Kibana 7

2.4.4 Redis 8

2.5 程序语言及库 8

第三章 需求分析 9

3.1 系统目标 9

3.2 原始数据定义 9

3.2.1 系统日志 9

3.2.2 应用日志 12

3.2.3 进程信息 14

3.2.4 端口信息 14

第四章 总体设计 16

4.1 功能设计 16

4.2 模块设计 17

4.2.1 系统信息采集模块 17

4.2.2 日志采集模块 18

4.2.3 日志预处理模块 19

4.2.4 日志存储模块 20

4.2.5 数据展示模块 21

4.3 数据结构设计 21

4.4 可视化页面设计 25

第五章 系统实现 28

5.1 开发与运行环境 28

5.2 软件部署 28

5.3 关键技术实现 30

第六章 系统验证 35

6.1 完整性验证 35

6.2 正确性验证 37

6.3 性能分析 38

第七章 总结 40

参考文献 41

致 谢 42

第一章 绪论

    1. 引言
  1. 背景

随着互联网的发展,高并发网络访问、海量数据处理而造成的服务器压力,使传统的集中式系统面临着可靠性、性能、性价比等严峻的考验。而具有可靠性高、处理能力强、性价比高、可扩展性强等特点的分布式系统,成为大型网站、企业、机构的主流系统架构。中国教育和科研计算机网CERNET华东北地区网络中心(以下简称网络中心)也是采用分布式系统作为中心系统架构。

由于分布式系统的主机是分散的,通信依靠网络,所以虽然系统整体有着高可靠性,但是每台主机的运行情况却难以管理。面对单一主机的主机故障、网络攻击,分布式系统不能像集中式系统一样,具有良好的发现和应对能力,所以需要专门的主机管理系统对所有主机进行统一监测和管理。而针对一般的主机故障和网络攻击,最容易发现的方式就是依靠主机的日志。

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

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

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