基于Ansible CSR API Jekins的应用流路径自动感知和切换的设计与实现

 2022-12-07 11:12

论文总字数:28210字

摘 要

近年来,随着互联网的迅猛发展,网络规模和应用的不断扩展,网络通信的服务质量变得很难实现。例如当网络出现故障后,不能及时发现,从网络故障的出现到问题的解决可能会消耗大量的时间,造成巨大的损失;业务量的增加导致网络设备的数量急剧上升,以及对网络设备的管理、配置变得越来越繁重。因此很难实现高效的网络管理与运维工作,传统的网络运维方式不再适用于当今复杂的网络架构,

人们需要一些自动化的网络运维方式来完成这一系列的工作。本课题致力于自动化感知网络故障以及部署网络设备的相关命令,解决了网络工程师必须得通过硬件来配置网络设备的缺陷。

本课题针对以上问题进行开发,并基于Ansible开发工具,结合思科云平台以及免费开源的软件Jekins,开发出一套能够实现网络路径故障自动感知并自动切换路径的工具。

具体实现的功能如下:

1、远程服务器能够使用Jenkins通过思科CSR API及Anible工具远程配置设备。

2、通过eem(嵌入式事件管理器)、sla(服务等级协议)联动实现网络路劲自动感知故障及切换到备用线路。

3、线路发送故障时,远程服务器能够收到异常信息并且运行本地的脚本文件用来收取设备运行中的某些信息,包括接口状态信息、路由表、以及设备日志等。

关键词:Jenkins,远程部署;CSR云服务路由器;Ansible自动化运维;eem、sla联动。

Design and implementation of application flow path automatic sensing and switching based on Ansible CSR API Jenkins

ABSTRACT

In recent years, with the rapid development of the Internet and the continuous expansion of network scale and application, the quality of service of network communication becomes very difficult to achieve. For example, when the network failure, can not be found in time, from the emergence of network failure to solve the problem may consume a lot of time, resulting in huge losses; The increase of traffic leads to the sharp rise of the number of network devices, and the management and configuration of network devices become more and more onerous. Therefore, it is difficult to achieve efficient network management and operation and maintenance. The traditional network operation and maintenance mode is no longer suitable for today's complex network architecture,

People need some automatic network operation and maintenance methods to complete this series of work. This project is dedicated to the automatic perception of network failures and the deployment of network equipment related commands, to solve the network engineer must be through hardware to configure network equipment defects.

Based on ansible development tools, combined with Cisco cloud platform and free and open source software jekins, this paper develops a set of tools that can realize the network path fault automatic sensing and automatic path switching.

The specific functions are as follows:

1. The remote server can use Jenkins to remotely configure devices through Cisco CSR API and anible tools.

2. Through the EEM (embedded event manager) and SLA (service level agreement) linkage, the network road power can automatically sense the fault and switch to the standby line.

3. When the transmission line fails, the remote server can receive abnormal information and run the local script file to collect some information during the operation of the device, including interface status information, routing table, and device log.

Key words: Jenkins, remote deployment; CSR cloud service router; Ansible automatic operation and maintenance; EEM, SLA linkage.

目 录

第一章 引言 1

1.1研究课题背景与意义 1

1.2课程任务要求 1

1.3 网络运维自动化的发展 1

1.4论文的主要内容和框架 2

第二章 主要工具及环境介绍 3

2.1 ansible基本介绍 3

2.1.1 Ansible概述 3

2.1.2 Ansible的基本框架 3

2.1.3 Ansible的特点 4

2.1.4 Ansible的任务执行 4

2.2 Cisco API的使用 4

2.2.1 Guestshell 4

2.2.2 Python API 5

2.2.3 CLI Python模块 5

2.3 Service Level Aggreements(SLA)服务等级协议 6

2.3.1 SLA概述 6

2.3.2 SLA的优点 6

2.3.3 SLA特性 6

2.3.4 SLA用法 6

2.4 Embedded Event Manager (EEM) 嵌入式事件管理器 6

2.4.1 EEM概述 6

2.4.2 EEM 应用 7

2.5 Jenkins 7

2.5.1 Jenkins概述 7

2.5.2 Jenkins特点 7

第三章 网络平台搭建 8

3.1 整体架构概述 8

3.2 CSR1000v配置 10

3.2.1 启用IOX(IOs linux) 10

3.2.2 使用应用程序主机管理GuestShell 11

3.3 Ubuntu虚拟机配置 12

3.3.1 GNS3 VM配置 12

3.3.2 Ubuntu虚拟机网络设置 14

3.3.3 安装Docker 14

3.3.4 Jenkins安装 15

3.3.5 Jenkins配置 16

第四章 仿真实验过程 17

4.1脚本概述 17

4.1.1 python CLI脚本 17

4.1.2 Ansible脚本 19

4.2 Jenkins工程构建 20

4.2.1 脚本发送 20

4.2.2 构建过程 20

4.2.3 构建结果 21

第五章 仿真实验结果及分析 22

5.1 实验结果验证 22

5.1.1 工程构建结果 22

5.1.2 结果验证 23

5.2 实验结果分析 29

5.3 本章小结 30

第六章 优化与改进 31

结束语 32

致谢 33

参考文献 34

附录 35

第一章 引言

1.1研究课题背景与意义

随着企业网络经营规模和业务应用的不断扩大增加,相关企业网络运维管理工作也越来越繁重,传统企业网络的一些缺点也越来越完全不可能被忽视:不能及时了解传统网络设备运行状况,当网络设备突然出现网络故障后,不能及时发现;网络设备类型多、数量多,设备的不可编程性造成网络设备配置管理非常复杂;由于无法正确实现真正的网络流量管理监控,主流的传统网络流量管理软件协议,更多的是侧重于流量监控,而不是正确分配和合理部署。也就是说,若是在网络路劲中出现线路故障,通过监控系统检测到并发出告警,最终还是要管理人员去排查并解决。因此,传统网络迫切需要一种自动化的管理手断,来实现设备的可编程性,并能够自动监测网络路径的故障并实现自动切换。

首先,自动感知网络路径的故障和网络延迟,以及自动切换路径解决所发生的问题,提高了网络运维的时效性,并减少传统一对一人为配置所产生的人为失误,提高配置效率;其次,让企业网络环境更适合网络服务器管理环境,多年来大量企业网络运维开发团队都在努力使用网络自动化技术来重新创建一套高度安全动态的企业服务器管理系统。鉴于自动化能够及时提供所需的网络连接和数据的安全性,还可基于国际标准的开源协议和其他开源企业自动化管理框架实现开放性和互操作性。再有,使用自动化方式运营网络符合现代社会的发展趋势,是具有新时代效应的新型网络发展方向。

1.2课程任务要求

本课题针对传统网络所存在的问题,在ubuntu下使用免费开源的软件Jenkins部署Ansible脚本利用思科CSR API在GNS3模拟器下模拟实现设备的可编程性,解决传统网络数量多,配置多,需要投入大量人工成本的缺陷,减少传统网络一对一人为配置所产生的人为失误,提高配置效率;同时使用eem(嵌入式事件管理器)、sla(服务等级协议)联动实现网络路径故障的自动感知和自动切换,使用sla监测线路的状态,当检测到线路故障后,触发eem事件自动切换到另一条备用线路,同时发送一条指令到远程ubuntu服务器运行Ansible脚本收集网络设备的状态信息文件,存储在本地,当检测到主线路恢复时,会再次触发eem事件将线路切换回主线路,同时再次产生网络设备的状态信息文件存储在本地。

1.3 网络运维自动化的发展

网络运维已经人们的探索中跌跌撞撞的走了十几载,现在这项工作正已一种新的方式出现在人们的面前,就是网络运维的自动化,这是网络技术发展到一定阶段的必然结果。现在企业网架构的规模和数量已必须要求网络运维能够实现自动化。

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

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

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