[go: up one dir, main page]

CN110647379A - Hadoop cluster automatic scaling deployment and Plugin deployment method based on OpenStack cloud - Google Patents

Hadoop cluster automatic scaling deployment and Plugin deployment method based on OpenStack cloud Download PDF

Info

Publication number
CN110647379A
CN110647379A CN201810682329.9A CN201810682329A CN110647379A CN 110647379 A CN110647379 A CN 110647379A CN 201810682329 A CN201810682329 A CN 201810682329A CN 110647379 A CN110647379 A CN 110647379A
Authority
CN
China
Prior art keywords
cluster
deployment
node
automatic scaling
utilization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810682329.9A
Other languages
Chinese (zh)
Other versions
CN110647379B (en
Inventor
吕智慧
吴杰
强浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fudan University
Original Assignee
Fudan University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fudan University filed Critical Fudan University
Priority to CN201810682329.9A priority Critical patent/CN110647379B/en
Publication of CN110647379A publication Critical patent/CN110647379A/en
Application granted granted Critical
Publication of CN110647379B publication Critical patent/CN110647379B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明属于云计算技术领域,具体涉及一种基于OpenStack云进行Hadoop集群自动化伸缩部署及Plugin部署的方法。本发明方法包括:在Hadoop集群部署阶段,基于资源使用率的集群自动伸缩策略以及基于任务成功率的置换机制。本发明使得OpenStack对集群提供更好的支持,集群规模能够根据不同时段的业务处理量进行调整,保障业务处理的速度。The invention belongs to the technical field of cloud computing, and in particular relates to a method for Hadoop cluster automatic scaling deployment and Plugin deployment based on OpenStack cloud. The method of the invention includes: in the Hadoop cluster deployment stage, a cluster automatic scaling strategy based on resource utilization rate and a replacement mechanism based on task success rate. The invention enables OpenStack to provide better support for the cluster, the cluster scale can be adjusted according to the business processing volume in different periods, and the speed of business processing is guaranteed.

Description

基于OpenStack云进行Hadoop集群自动化伸缩部署及Plugin 部署方法Hadoop cluster automatic scaling deployment and Plugin based on OpenStack cloud Deployment method

技术领域technical field

本发明属于云计算技术领域,涉及一种基于OpenStack云进行Hadoop集群自动化伸缩部署及Plugin部署方法。The invention belongs to the technical field of cloud computing, and relates to a method for Hadoop cluster automatic scaling deployment and Plugin deployment based on OpenStack cloud.

背景技术Background technique

现有技术公开了Sahara可以与第三方管理工具(如Apache Ambari和Cloudera管理控制台)通过插件机制进行整合。Sahara的核心部分负责与用户的交互,同时通过Heat组件提供OpenStack的资源(如虚拟机、服务器、安全组等);Plugin负责在预分配的虚拟机中安装和配置Hadoop集群,另外,Plugin也可以为集群部署管理和监控的工具。Sahara为Plugin在预分配的虚拟机中工作提供了一种统一的机制:一方面,Plugin必须要继承sahara.plugins.provisioning:ProvisioningPluginBase类并且需要实现所有必须的方法/接口;另一方面,Sahara提供的虚拟机对象有一个remote属性,可以用来实现与虚拟机的交互,通过instance.remote语句远程调用命令操作虚拟机(可用的命令可以在sahara.utils.remote.InstanceInteropHelper中找到)。The prior art discloses that Sahara can be integrated with third-party management tools (such as Apache Ambari and Cloudera management console) through a plug-in mechanism. The core part of Sahara is responsible for interacting with users, and provides OpenStack resources (such as virtual machines, servers, security groups, etc.) through Heat components; Plugin is responsible for installing and configuring Hadoop clusters in pre-allocated virtual machines. In addition, Plugin can also Tools for cluster deployment management and monitoring. Sahara provides a unified mechanism for Plugins to work in pre-provisioned virtual machines: on the one hand, Plugins must inherit the sahara.plugins.provisioning:ProvisioningPluginBase class and need to implement all necessary methods/interfaces; on the other hand, Sahara provides The virtual machine object has a remote attribute that can be used to interact with the virtual machine, and remotely invoke commands to operate the virtual machine through the instance.remote statement (available commands can be found in sahara.utils.remote.InstanceInteropHelper).

基于现有技术的现状,本申请的发明人拟提出一种基于OpenStack云进行Hadoop集群自动化伸缩部署及Plugin部署方法,对Hadoop集群相关的部署自动伸缩机制进行补充和优化,其自动伸缩将对于集群规模进行调整,以删除多余节点、替换问题节点、部署新节点。Based on the current state of the prior art, the inventor of the present application proposes a method for automatic scaling deployment and Plugin deployment of Hadoop clusters based on OpenStack cloud to supplement and optimize the automatic scaling mechanism of Hadoop cluster deployment. Scale to remove redundant nodes, replace problem nodes, deploy new nodes.

发明内容SUMMARY OF THE INVENTION

本发明的的目的是基于现有技术的现状,提供一种基于OpenStack云进行Hadoop集群自动化伸缩部署及Plugin部署方法,对Hadoop集群相关的部署自动伸缩机制进行补充和优化,其自动伸缩将对于集群规模进行调整,以删除多余节点、替换问题节点、部署新节点。The purpose of the present invention is to provide a method for Hadoop cluster automatic scaling deployment and Plugin deployment based on OpenStack cloud based on the current state of the prior art, supplement and optimize the deployment automatic scaling mechanism related to Hadoop cluster, and its automatic scaling will be very important to the cluster. Scale to remove redundant nodes, replace problem nodes, deploy new nodes.

本发明的目的通过下述技术方案施现:The object of the present invention is implemented through the following technical solutions:

本发明提出的一种基于OpenStack云进行Hadoop集群自动化伸缩部署方法,其中包括,基于OpenStack云中的Sahara模块,与第三方管理工具通过Plugin机制进行整合,参考需求,结合自动化伸缩部署方法,为所需的Hadoop集群分配适量的虚拟机,在预分配的虚拟机中安装和配置Hadoop集群。A method for automatic scaling and deployment of Hadoop clusters based on OpenStack cloud proposed by the present invention includes, based on the Sahara module in the OpenStack cloud, integrating with third-party management tools through the Plugin mechanism, referring to requirements, and combining with the automatic scaling and deployment method, for all Allocate an appropriate amount of virtual machines to the required Hadoop cluster, and install and configure the Hadoop cluster in the pre-allocated virtual machines.

具体的,本发明的一种基于OpenStack云进行Hadoop集群自动化伸缩部署的方法,其特征在于,其根据预测和实时情况完成云环境下Hadoop集群的自动化伸缩部署;具体包括:Specifically, a method for automatic scaling deployment of Hadoop clusters based on OpenStack cloud of the present invention is characterized in that it completes the automatic scaling deployment of Hadoop clusters in a cloud environment according to prediction and real-time conditions; specifically, it includes:

(1)基于利用率的自动伸缩策略(1) Automatic scaling strategy based on utilization

本发明引入

Figure BDA0001710865990000021
分别代表用户对于集群CPU、内存RAM和硬盘Disk这三个利用率的期待值,而实际情况下这三者利用率值分别为
Figure BDA0001710865990000028
由于用户对于不同的资源之间的重视程度不同,所以在其中引入了λC、λR、λD这三项分别作为三者的权值,由此可以得到以下数据,Introduced by the present invention
Figure BDA0001710865990000021
Represents the user's expected value of the three utilization rates of the cluster CPU, memory RAM, and hard disk Disk, respectively, and the actual utilization values of the three are
Figure BDA0001710865990000028
Since users attach different importance to different resources, three items λ C , λ R , and λ D are introduced as the weights of the three, respectively, and the following data can be obtained:

φ=λC·ηCR·ηRD·ηD (定义2)φ=λ C · η CR · η RD · η D (Definition 2)

其中,定义1代表了各指标下实际利用率与期望利用率之间的差值,该指标可以具体反映各项指标之间的差距;定义2代表了综合这三项与期望之间的差值,这个值的范围也在[0,1)之内,越接近于0,则与期待值越接近,集群的利用率越符合预期;Among them, definition 1 represents the difference between the actual utilization rate and the expected utilization rate under each indicator, and this indicator can specifically reflect the gap between various indicators; definition 2 represents the comprehensive difference between these three items and the expectation , the range of this value is also within [0,1), the closer it is to 0, the closer it is to the expected value, and the more in line with the expected cluster utilization;

基于以上,本发明提出了基于利用率的自动伸缩策略;Based on the above, the present invention proposes an automatic scaling strategy based on utilization;

(2)基于任务成功率的自动伸缩快速部署策略(2) Automatic scaling and rapid deployment strategy based on task success rate

本发明在策略中引入一个变量

Figure BDA0001710865990000023
Figure BDA0001710865990000024
是一个介于[0,1]的百分数,代表了单个节点上任务能够成功运行的比例;在最理想的情况下,各个节点
Figure BDA0001710865990000025
表示所有的任务都能被成功执行,结果也能顺利输出;由于节点任务执行的失败不可避免,不可能只要出错就立刻对该节点进行置换,这是不合理的,也会导致系统开销的增大;所以会对
Figure BDA0001710865990000026
有一个预估值
Figure BDA0001710865990000027
如果该值趋近于0,则代表该节点的任务成功率过于小,这种情况下,该节点的继续使用会降低集群的运行效率,所以将启用节点置换策略;The present invention introduces a variable in the strategy
Figure BDA0001710865990000023
Figure BDA0001710865990000024
is a percentage between [0,1], representing the proportion of tasks that can run successfully on a single node; in the most ideal case, each node
Figure BDA0001710865990000025
Indicates that all tasks can be successfully executed and the results can be output smoothly; since the failure of node task execution is inevitable, it is impossible to replace the node immediately as long as there is an error, which is unreasonable and will also lead to an increase in system overhead. large; so will
Figure BDA0001710865990000026
have an estimate
Figure BDA0001710865990000027
If the value is close to 0, it means that the task success rate of the node is too small. In this case, the continued use of the node will reduce the operating efficiency of the cluster, so the node replacement strategy will be enabled;

基于以上,本发明提出了基于任务成功率的自动伸缩快速部署策略。Based on the above, the present invention proposes an automatic scaling and rapid deployment strategy based on task success rate.

本发明中,基于OpenStack云进行Hadoop集群自动化伸缩部署包括下述两个过程:In the present invention, the automatic scaling deployment of Hadoop clusters based on the OpenStack cloud includes the following two processes:

1.自动伸缩部署机制1. Automatic scaling deployment mechanism

(1)基于利用率的自动伸缩策略(1) Automatic scaling strategy based on utilization

基于云平台资源利用率的自动伸缩策略算法的最终实现的目标是:结合云平台资源与当前应用场景需求,更加合理利用云平台的计算资源,优化Hadoop集群相关的集群部署自动伸缩机制,使得集群的运行效率达到更优的结果;The ultimate goal of the automatic scaling strategy algorithm based on cloud platform resource utilization is to combine cloud platform resources with the current application scenario requirements, make more rational use of cloud platform computing resources, optimize the Hadoop cluster-related cluster deployment automatic scaling mechanism, and make the cluster operating efficiency to achieve better results;

通常CPU、内存、硬盘三个指标的使用情况在基于利用率的自动伸缩功能的实现过程中起到很重要作用,本发明主要从所述的三个指标出发进行使用率的反映;Usually, the usage of the three indicators of CPU, memory and hard disk plays an important role in the realization of the automatic scaling function based on the utilization rate, and the present invention mainly starts from the three indicators to reflect the usage rate;

本发明引入

Figure BDA0001710865990000031
分别代表用户对于集群CPU、内存RAM和硬盘Disk三个利用率的期待值,而实际情况下这三者利用率值分别为
Figure BDA0001710865990000034
由于用户对于不同的资源之间的重视程度不同,所以在其中引入了λC、λR、λD这三项分别作为三者的权值,由此得到以下数据,Introduced by the present invention
Figure BDA0001710865990000031
Represents the user's expected value of the three utilization rates of the cluster CPU, memory RAM, and hard disk Disk, respectively, and the actual utilization values of the three are
Figure BDA0001710865990000034
Since users attach different importance to different resources, three items λ C , λ R , and λ D are introduced as the weights of the three, respectively, and the following data are obtained:

Figure BDA0001710865990000032
Figure BDA0001710865990000032

φ=λC·ηCR·ηRD·ηD (定义2)φ=λ C · η CR · η RD · η D (Definition 2)

定义1代表各指标下实际利用率与期望利用率之间的差值,该指标具体反映各项指标之间的差距,平台据此调整集群资源配置情况;实际情况中,

Figure BDA0001710865990000033
是一个可以的区间范围,故η的计算结果为一个值区间,由于需要计算与用户期望之间的符合程度,一区这个包含在在[0,1)区间的子区间范围内的最小值;定义2代表了综合这三项与期望之间的差值,这个值的范围也在[0,1)之内,越接近于0,则与期待值越接近,集群的利用率越符合预期;Definition 1 represents the difference between the actual utilization rate and the expected utilization rate under each indicator. This indicator specifically reflects the gap between various indicators, and the platform adjusts the cluster resource configuration accordingly;
Figure BDA0001710865990000033
is a possible interval range, so the calculation result of n is a value interval, because the degree of conformity between the calculation and the user's expectation needs to be calculated, the minimum value of one area is included in the sub-interval range of the [0,1) interval; Definition 2 represents the difference between these three items and the expectation. The range of this value is also within [0, 1). The closer it is to 0, the closer it is to the expected value, and the cluster utilization is more in line with expectations;

本发明的算法中,首先获得用户对于集群CPU、内存RAM和硬盘Disk三个利用率的期待值,并于平台中这三者的实际利用率值进行比较,如果实际利用率值小于相应期待值的最小值,则关闭Datanode与Namenode服务,关闭虚拟机,如果实际利用率值大于相应期待值的最小值而小于相应期待值的最大值,则启动虚拟机,部署Hadoop集群,启动;In the algorithm of the present invention, the user's expected value of the three utilization rates of the cluster CPU, memory RAM and hard disk Disk is first obtained, and the actual utilization value of the three in the platform is compared. If the actual utilization value is less than the corresponding expected value If the actual utilization value is greater than the minimum value of the corresponding expected value but less than the maximum value of the corresponding expected value, then start the virtual machine, deploy the Hadoop cluster, and start it;

(2)基于任务成功率的自动伸缩快速部署策略(2) Automatic scaling and rapid deployment strategy based on task success rate

基于Hadoop在设计的过程中,认为任何一个节点都可能出现各种问题而导致所分配的任务执行失败,本发明在此采用置换失败率较高的节点的方式,能避免因为节点自身一些物理方面因素导致的失败;Based on the design process of Hadoop, it is believed that any node may have various problems and cause the execution of the assigned task to fail. The present invention adopts the method of replacing the node with a higher failure rate, which can avoid some physical aspects of the node itself. failure caused by factors;

同时,本发明在取代该节点提供计算服务的节点正式服务于这个集群之前,需要进行点对点的数据块拷贝,确保数据能够正确保存,该种策略的实现,可以对于整个集群的状态进行更好地调整,规避由于单个节点失败导致的对于其他节点负载的增重,甚至出现规模效应的情况;At the same time, before the node that replaces the node that provides computing services officially serves the cluster, the present invention needs to perform point-to-point copying of data blocks to ensure that the data can be stored correctly. The implementation of this strategy can better improve the state of the entire cluster. Adjustment to avoid the increase in the load of other nodes due to the failure of a single node, or even the occurrence of scale effects;

为了实现这个策略,本发明中,首先引入一个变量

Figure BDA0001710865990000041
Figure BDA0001710865990000042
是一个介于[0,1]的百分数,代表了单个节点上任务能够成功运行的比例;在最理想的情况下,各个节点
Figure BDA0001710865990000043
表示所有的任务都能被成功执行,结果也能顺利输出,由于节点任务执行的失败不可避免,不可能只要出错就立刻对该节点进行置换,这不仅是不合理的,也会导致系统开销的增大,所以本发明中,对
Figure BDA0001710865990000044
有一个预估值
Figure BDA0001710865990000045
如果该值趋近于0,则代表该节点的任务成功率过于小,该节点的继续使用会降低集群的运行效率,所以将启用节点置换策略;In order to realize this strategy, in the present invention, a variable is first introduced
Figure BDA0001710865990000041
Figure BDA0001710865990000042
is a percentage between [0,1], representing the proportion of tasks that can run successfully on a single node; in the most ideal case, each node
Figure BDA0001710865990000043
Indicates that all tasks can be successfully executed, and the results can be output smoothly. Since the failure of node task execution is inevitable, it is impossible to replace the node immediately as soon as there is an error. This is not only unreasonable, but also causes system overhead. increases, so in the present invention, the
Figure BDA0001710865990000044
have an estimate
Figure BDA0001710865990000045
If the value is close to 0, it means that the task success rate of the node is too small, and the continued use of the node will reduce the operating efficiency of the cluster, so the node replacement strategy will be enabled;

本发明的算法的过程步骤描述如下:The procedural steps of the algorithm of the present invention are described as follows:

step1:选取一个合适的

Figure BDA0001710865990000046
值作为衡量任务成功率的最低标准step1: choose a suitable
Figure BDA0001710865990000046
value as the minimum standard to measure the success rate of the task

step2:计算在一定时间周期内,节点任务成功率step2: Calculate the success rate of node tasks within a certain period of time value

step3:将值与

Figure BDA0001710865990000049
值进行比较,若大于,则继续下一个节点开始step2;若小于,则进入下一步step3: will value with
Figure BDA0001710865990000049
The value is compared, if it is greater than, continue to the next node to start step2; if it is less than, go to the next step

step4:申请一台新的节点step4: apply for a new node

step5:在新申请的节点上部署Hadoop应用,并将原先节点上的数据进行拷贝step5: Deploy the Hadoop application on the newly applied node and copy the data on the original node

step6:启动新节点上的服务,暂停原节点的服务step6: Start the service on the new node and suspend the service of the original node

step7:启动新节点上的服务,terminate原节点,进入下一个节点的step2step7: Start the service on the new node, terminate the original node, and enter step2 of the next node

通过节点的置换,最终实现整个集群较为优化的任务执行效果,在这个置换过程中,可以最大程度的避免由于虚拟机物理方面带来的失败。Through node replacement, an optimized task execution effect of the entire cluster is finally achieved. During this replacement process, failures caused by the physical aspects of the virtual machine can be avoided to the greatest extent.

2.集群自动部署Plugin实现2. Cluster automatic deployment Plugin implementation

(1)集群Plugin实现接口(1) Cluster Plugin implementation interface

集群作为一个独立的plugin,在sahara/sahara/plugins目录下以一个独立的目录形式存在,其主要的目录结构如图1所示;As an independent plugin, the cluster exists in the form of an independent directory under the sahara/sahara/plugins directory, and its main directory structure is shown in Figure 1;

其中:in:

1.如图2,v2_7_1目录下为沙箱插件2.7.1版本特制的内容,hadoop2中为通用的内容,而最外层versionfactory.py通过正则匹配的方式识别目录名,以得到对应的版本号;1. As shown in Figure 2, the v2_7_1 directory is the special content of the sandbox plugin version 2.7.1, the hadoop2 is the general content, and the outermost versionfactory.py identifies the directory name through regular matching to get the corresponding version number ;

2.plugin.py是核心,负责实现所有必要的接口,具体需要实现的接口如表1所示:2.plugin.py is the core and is responsible for implementing all the necessary interfaces. The specific interfaces to be implemented are shown in Table 1:

3.如图3所示,在功能实现上,主要分为集群的配置和启动两部分。config_helper.py是配置的核心模块,在其中配置了相关配置文件的路径,并进行了环境变量的配置;3. As shown in Figure 3, in terms of function implementation, it is mainly divided into two parts: cluster configuration and startup. config_helper.py is the core module of configuration, in which the path of relevant configuration files is configured, and the configuration of environment variables is performed;

4.如图5所示,versionhandle.py中,根据当前的plugin版本具体完成沙箱的配置和启动;4. As shown in Figure 5, in versionhandle.py, the configuration and startup of the sandbox are completed according to the current plugin version;

5.而run_scripts.py/starting_scripts.py具体实现集群的启动,其中利用instance.remote()方法,通过ssh远程连接至已经启动的虚拟机,并执行相应的linux命令,从而具体操控进程、节点、集群等的启动。5. And run_scripts.py/starting_scripts.py specifically realizes the startup of the cluster, in which the instance.remote() method is used to remotely connect to the virtual machine that has been started through ssh, and execute the corresponding linux command, so as to specifically control the process, node, Startup of clusters, etc.

(2)集群镜像打包制作工具实现(2) Implementation of cluster image packaging and production tools

1.OpenStack虚拟机镜像1. OpenStack virtual machine image

本发明的实施例中,以CentOS操作系统为例,对OpenStack虚拟机镜像的制作过程及原理进行简要介绍;In the embodiment of the present invention, taking the CentOS operating system as an example, the production process and principle of the OpenStack virtual machine image are briefly introduced;

2.集群镜像2. Cluster mirroring

本发明中,使用Diskimage-builder制作集群镜像。In the present invention, Diskimage-builder is used to make a cluster image.

本发明进行了Hadoop集群自动伸缩部署实验,In the present invention, the experiment of automatic scaling deployment of Hadoop cluster is carried out,

选取其中任意一组部署作为实验的代表,进行多次测试,并在此基础上比较优化前后的指标数据,对部署服务进行分析。表2显示了集群配置。Select any set of deployments as the representative of the experiment, conduct multiple tests, and compare the indicator data before and after optimization on this basis, and analyze the deployment services. Table 2 shows the cluster configuration.

表2集群配置Table 2 Cluster Configuration

集群cluster vCPUvCPU RAMRAM diskdisk Node numberNode number Cluster 1Cluster 1 4core4core 10GB10GB 5GB5GB 88 Cluster 2Cluster 2 2core2core 100GB100GB 100GB100GB 1616 Cluster 3Cluster 3 1core1core 5GB5GB 80GB80GB 88 Cluster 4Cluster 4 1core1core 5GB5GB 80GB80GB 1616 Cluster 5Cluster 5 1core1core 5GB5GB 80GB80GB 24twenty four Cluster 6Cluster 6 1core1core 5GB5GB 80GB80GB 4848

试验结果显示,优化后部署的速度相较于优化前有了较为可观的提高,当所需部署的集群节点数较少的情况下,该优化效果不显著,但是当集群节点数增大时,优化之前的部署时间增幅明显,而优化之后的部署服务,随着集群规模的增大部署时间有所增加,但是增幅较为缓和,6次集群部署时间较为接近,部署时间稳定在10分钟到20分钟的区间范围之内,结果显示,优化后的集群部署部署时间上有了明显的改善,且所需时间更为稳定;优化后的部署服务相对于优化之前,即使在规模较小的集群部署过程中,仍旧体现了它的优化效果,在成功率方面,优化之后的效果有了很明显的改善,体现了本发明部署服务优化较为成功。本发明提出的Hadoop集群自动伸缩部署策略,能够优化Hadoop集群的自动部署,使得部署服务更加稳定高效。The test results show that the deployment speed after optimization has been improved considerably compared with that before optimization. When the number of cluster nodes to be deployed is small, the optimization effect is not significant, but when the number of cluster nodes increases, The deployment time before optimization has increased significantly, while the deployment time after optimization has increased as the cluster size increases, but the increase is moderate. The six cluster deployment times are relatively close, and the deployment time is stable at 10 minutes to 20 minutes. The results show that the deployment time of the optimized cluster deployment has been significantly improved, and the required time is more stable; the optimized deployment service is better than before the optimization, even in the small-scale cluster deployment process , it still reflects its optimization effect, and in terms of success rate, the effect after optimization has been significantly improved, which shows that the deployment service optimization of the present invention is relatively successful. The automatic scaling deployment strategy of the Hadoop cluster proposed by the invention can optimize the automatic deployment of the Hadoop cluster and make the deployment service more stable and efficient.

附图说明Description of drawings

图1显示,集群作为一个独立的plugin,在sahara/sahara/plugins目录下以一个独立的目录形式存在的目录结构图。Figure 1 shows the directory structure diagram that the cluster exists as an independent plugin in the sahara/sahara/plugins directory in the form of an independent directory.

图2显示,v2_7_1目录下为沙箱插件2.7.1版本特制的内容,hadoop2中为通用的内容,最外层versionfactory.py通过正则匹配的方式识别目录名,以得到对应的版本号。Figure 2 shows that the v2_7_1 directory is the content specially made for version 2.7.1 of the sandbox plugin, and the general content in hadoop2. The outermost versionfactory.py identifies the directory name through regular matching to get the corresponding version number.

图3显示,在功能实现上,主要分为集群的配置和启动两部分,config_helper.py是配置的核心模块,其中配置了相关配置文件的路径,并进行了环境变量的配置,config_helper.py还负责根据用户配置具体生成相应的配置文件,供即将启动的沙箱使用。Figure 3 shows that in terms of function implementation, it is mainly divided into two parts: cluster configuration and startup. config_helper.py is the core module of configuration, which configures the path of relevant configuration files and configures environment variables. config_helper.py also It is responsible for generating the corresponding configuration file according to the user configuration for the sandbox to be started.

图4为截取了图3所示的一小部分配置spark环境变量时config_helper.py所做的工作。Figure 4 is a screenshot of what config_helper.py does when configuring spark environment variables as shown in Figure 3.

图5显示,versionhandle.py中,根据当前的plugin版本具体完成沙箱的配置和启动,Figure 5 shows that in versionhandle.py, the configuration and startup of the sandbox are completed according to the current plugin version.

其中start_cluster方法中描述了沙箱启动的整体流程。The start_cluster method describes the overall process of sandbox startup.

图6显示,创建了一个qcow2格式的虚拟机镜像,大小为10G。Figure 6 shows that a virtual machine image in qcow2 format is created with a size of 10G.

图7为集群示意图。FIG. 7 is a schematic diagram of a cluster.

图8显示了集群创建服务的web页面,在该页面上进行集群创建的相关需求提交,其中包括Hadoop版本的选择、如表1所列举的节点的配置、镜像的选择等,完成相关的指定之后,集群可以进入部署阶段。Figure 8 shows the web page of the cluster creation service, on which the relevant requirements for cluster creation are submitted, including the selection of the Hadoop version, the configuration of the nodes listed in Table 1, the selection of images, etc. After completing the relevant designations , the cluster can enter the deployment phase.

图9显示,优化后部署的速度相较于优化前有较为可观的提高,优化后的集群部署部署时间有明显的改善,且所需时间更为稳定。Figure 9 shows that the deployment speed after optimization has a considerable improvement compared with that before optimization, and the deployment time of the optimized cluster deployment is significantly improved, and the time required is more stable.

图10显示,优化后的部署服务相对于优化之前,即使在规模较小的集群部署过程中,仍然体现了它的优化效果,在成功率方面,优化后的效果有很明显的改善,体现了本发明部署服务优化的成功。Figure 10 shows that compared to before optimization, the optimized deployment service still reflects its optimization effect even in the small-scale cluster deployment process. In terms of success rate, the optimized effect has been significantly improved, reflecting the The present invention deploys the success of service optimization.

具体实施方式Detailed ways

下面结合附图和实施例对本发明的技术方案具体介绍如下。The technical solutions of the present invention are described below in detail with reference to the accompanying drawings and embodiments.

本发明的目的在于提出一种基于OpenStack云进行Hadoop集群自动化伸缩部署方法。如图1所示,本发明基于OpenStack云中的Sahara模块,与第三方管理工具通过Plugin机制进行整合,参考需求,结合自动化伸缩部署方法,给所需的Hadoop集群分配适量的虚拟机,在预分配的虚拟机中安装和配置Hadoop集群。The purpose of the present invention is to propose a method for automatic scaling and deployment of Hadoop clusters based on OpenStack cloud. As shown in Figure 1, the present invention is based on the Sahara module in the OpenStack cloud, and is integrated with a third-party management tool through the Plugin mechanism. With reference to the requirements, combined with the automated scaling deployment method, an appropriate amount of virtual machines are allocated to the required Hadoop clusters. Install and configure a Hadoop cluster in an assigned virtual machine.

本发明中,基于OpenStack云进行Hadoop集群自动化伸缩部署,具体分为以下两个过程:In the present invention, the automatic scaling deployment of Hadoop clusters based on the OpenStack cloud is specifically divided into the following two processes:

1、自动伸缩部署机制1. Automatic scaling deployment mechanism

(1)基于利用率的自动伸缩策略(1) Automatic scaling strategy based on utilization

本发明的基于云平台资源利用率的自动伸缩策略算法的最终实现的目标是:结合云平台资源与当前应用场景需求,更加合理利用云平台的计算资源,优化Hadoop集群相关的集群部署自动伸缩机制,使得集群的运行效率达到更优的结果。The ultimate goal of the automatic scaling strategy algorithm based on cloud platform resource utilization of the present invention is to combine cloud platform resources and current application scenario requirements, make more rational use of cloud platform computing resources, and optimize Hadoop cluster-related cluster deployment automatic scaling mechanism , so that the operating efficiency of the cluster can achieve better results.

当对虚拟机所占的资源数进行分配时,通常关注CPU、内存、硬盘这3个方面,所以在基于利用率的自动伸缩功能的实现过程中,这三个指标的使用情况,必然是其中很重要的几个方面;在本实施例中,在使用率方面,主要从这三个指标出发进行使用率的反映。When allocating the number of resources occupied by virtual machines, we usually pay attention to three aspects: CPU, memory, and hard disk. Therefore, in the implementation of the automatic scaling function based on utilization, the usage of these three indicators must be among them. There are several important aspects; in this embodiment, in terms of the utilization rate, the utilization rate is mainly reflected from these three indicators.

本发明引入

Figure BDA0001710865990000071
分别代表用户对于集群CPU、内存RAM和硬盘Disk这三个利用率的期待值,而实际情况下这三者利用率值分别为
Figure BDA0001710865990000074
由于用户对于不同的资源之间的重视程度不同,所以在其中引入了λC、λR、λD这三项分别作为三者的权值。由此可以得到以下数据,Introduced by the present invention
Figure BDA0001710865990000071
Represents the user's expected value of the three utilization rates of the cluster CPU, memory RAM, and hard disk Disk, respectively, and the actual utilization values of the three are
Figure BDA0001710865990000074
Since users place different emphasis on different resources, three items λ C , λ R , and λ D are introduced as the weights of the three, respectively. From this, the following data can be obtained,

Figure BDA0001710865990000072
Figure BDA0001710865990000072

φ=λC·ηCR·ηRD·ηD (定义2)φ=λ C · η CR · η RD · η D (Definition 2)

定义1代表了各指标下实际利用率与期望利用率之间的差值,该指标可以具体反映各项指标之间的差距,平台可以据此调整集群资源配置情况;实际情况中,

Figure BDA0001710865990000073
一般会是一个可以的区间范围,故η的计算结果也为一个值区间,由于需要计算与用户期望之间的符合程度,一区这个包含在在[0,1)区间的子区间范围内的最小值;定义2代表了综合这三项与期望之间的差值,这个值的范围也在[0,1)之内,越接近于0,则与期待值越接近,集群的利用率越符合预期;Definition 1 represents the difference between the actual utilization and the expected utilization under each indicator. This indicator can specifically reflect the gap between various indicators, and the platform can adjust the cluster resource configuration accordingly;
Figure BDA0001710865990000073
Generally, it is a valid range, so the calculation result of n is also a value range. Since it is necessary to calculate the degree of compliance with the user's expectation, the first range is included in the sub-range of the [0,1) range. The minimum value; Definition 2 represents the difference between these three items and the expectation. The range of this value is also within [0, 1). The closer it is to 0, the closer it is to the expected value, and the higher the utilization rate of the cluster. In line with expectations;

所述算法首先获得用户对于集群CPU、内存RAM和硬盘Disk这三个利用率的期待值,并于平台中这三者的实际利用率值进行比较,如果实际利用率值小于相应期待值的最小值,则关闭Datanode与Namenode服务,关闭虚拟机;如果实际利用率值大于相应期待值的最小值而小于相应期待值的最大值,则启动虚拟机,部署Hadoop集群,启动,The algorithm first obtains the user's expected values for the three utilization rates of the cluster CPU, memory RAM and hard disk Disk, and compares the actual utilization values of the three in the platform. If the actual utilization value is less than the minimum value of the corresponding expected value. If the actual utilization value is greater than the minimum value of the corresponding expected value but less than the maximum value of the corresponding expected value, then start the virtual machine, deploy the Hadoop cluster, start,

(2)基于任务成功率的自动伸缩快速部署策略(2) Automatic scaling and rapid deployment strategy based on task success rate

Hadoop在设计的过程中,认为任何一个节点都可能出现各种问题而导致所分配的任务执行失败,失败的任务会重新运行,如果节点失败的概率增加,虽然Hadoop能够对于分配任务有其自身的考量标准,但是整个集群的运行时间会有所增长,节点任务失败率越高,增长幅度越大,即使在这种时候,该节点一直在进行任务计算,各资源的利用率也较为合理,但是对于整个任务的运行实际上造成了一定的影响,导致任务失败的原因有很多,为了对整个集群其他的节点造成尽可能小的影响,本发明采用置换失败率较高的节点的方式,避免因为节点自身一些物理方面因素导致的失败;In the design process of Hadoop, it is believed that any node may have various problems and cause the execution of the assigned task to fail, and the failed task will be re-run. If the probability of node failure increases, although Hadoop can assign tasks to its own. Considering the standard, the running time of the entire cluster will increase. The higher the node task failure rate, the greater the growth rate. Even at this time, the node has been performing task calculation, and the utilization rate of each resource is relatively reasonable, but It actually has a certain impact on the operation of the entire task, and there are many reasons for the failure of the task. In order to cause as little impact as possible on other nodes in the entire cluster, the present invention adopts the method of replacing nodes with a higher failure rate to avoid Failure caused by some physical factors of the node itself;

同时,由于移动计算比移动数据经济效益更高的原则,Hadoop会尽量将计算任务分配给已经具有该计算所需数据块的节点,在之前,该节点已经在安全模式下完成了所需数据的存储,如果这些数据直接被删除,必然对于整个集群造成一定的影响,可能会导致集群再次进入安全模式而需要进行等待,所以在取代该节点提供计算服务的节点正式服务于这个集群之前,需要进行点对点的数据块拷贝,确保数据能够正确保存,这种策略的实现,可以对于整个集群的状态进行更好地调整,规避由于单个节点失败导致的对于其他节点负载的增重,甚至出现规模效应的情况;At the same time, due to the principle that mobile computing is more economical than mobile data, Hadoop will try to allocate computing tasks to nodes that already have data blocks required for the calculation. Before, this node has completed the required data in safe mode. Storage, if these data are deleted directly, it will inevitably have a certain impact on the entire cluster, which may cause the cluster to enter the safe mode again and need to wait. The point-to-point copy of data blocks ensures that the data can be stored correctly. The implementation of this strategy can better adjust the state of the entire cluster, avoid the increase in the load of other nodes caused by the failure of a single node, and even cause scale effects. Happening;

为了实现上述策略,本发明首先引入一个变量

Figure BDA0001710865990000091
Figure BDA0001710865990000092
是一个介于[0,1]的百分数,代表单个节点上任务能够成功运行的比例;在最理想的情况下,各个节点
Figure BDA0001710865990000093
表示所有的任务都能被成功执行,结果也能顺利输出,由于节点任务执行的失败不可避免,不可能只要出错就立刻对该节点进行置换,这是不合理的,也会导致系统开销的增大;本发明中对
Figure BDA0001710865990000094
有一个预估值
Figure BDA0001710865990000095
如果该值趋近于0,则代表该节点的任务成功率过于小,此时,该节点的继续使用会降低集群的运行效率,所以本发明将启用节点置换策略;In order to realize the above strategy, the present invention first introduces a variable
Figure BDA0001710865990000091
Figure BDA0001710865990000092
is a percentage between [0,1], representing the proportion of tasks that can run successfully on a single node; in the most ideal case, each node
Figure BDA0001710865990000093
Indicates that all tasks can be successfully executed and the results can be output smoothly. Since the failure of node task execution is inevitable, it is impossible to replace the node immediately as long as there is an error. This is unreasonable and will also lead to an increase in system overhead. large; in the present invention
Figure BDA0001710865990000094
have an estimate
Figure BDA0001710865990000095
If the value is close to 0, it means that the task success rate of the node is too small. At this time, the continued use of the node will reduce the operating efficiency of the cluster, so the present invention will enable the node replacement strategy;

算法的过程步骤描述如下:The process steps of the algorithm are described as follows:

step1:选取一个合适的

Figure BDA0001710865990000096
值作为衡量任务成功率的最低标准step1: choose a suitable
Figure BDA0001710865990000096
value as the minimum standard to measure the success rate of the task

step2:计算在一定时间周期内,节点任务成功率

Figure BDA0001710865990000097
值step2: Calculate the success rate of node tasks within a certain period of time
Figure BDA0001710865990000097
value

step3:将

Figure BDA0001710865990000098
值与
Figure BDA0001710865990000099
值进行比较,若大于,则继续下一个节点开始step2;若小于,则进入下一步step3: will
Figure BDA0001710865990000098
value with
Figure BDA0001710865990000099
The value is compared, if it is greater than, continue to the next node to start step2; if it is less than, go to the next step

step4:申请一台新的节点step4: apply for a new node

step5:在新申请的节点上部署Hadoop应用,并将原先节点上的数据进行拷贝step5: Deploy the Hadoop application on the newly applied node and copy the data on the original node

step6:启动新节点上的服务,暂停原节点的服务step6: Start the service on the new node and suspend the service of the original node

step7:启动新节点上的服务,terminate原节点,进入下一个节点的step2step7: Start the service on the new node, terminate the original node, and enter step2 of the next node

通过节点的置换,最终实现整个集群较为优化的任务执行效果,在此置换过程中,由于虚拟机物理方面带来的失败可以最大程度的避免。Through node replacement, a more optimized task execution effect for the entire cluster is finally achieved. During this replacement process, failures caused by the physical aspects of the virtual machine can be avoided to the greatest extent.

3.集群自动部署Plugin实现3. Cluster automatic deployment Plugin implementation

(3)集群Plugin实现接口(3) Cluster Plugin implementation interface

集群作为一个独立的plugin,在sahara/sahara/plugins目录下以一个独立的目录形式存在,其主要的目录结构如图1所示,As an independent plugin, the cluster exists in the form of an independent directory under the sahara/sahara/plugins directory. Its main directory structure is shown in Figure 1.

其中:in:

如图2所示,v2_7_1目录下为沙箱插件2.7.1版本特制的内容,hadoop2中为通用的内容,而最外层versionfactory.py通过正则匹配的方式识别目录名,以得到对应的版本号。As shown in Figure 2, the v2_7_1 directory is the content specially made for version 2.7.1 of the sandbox plugin, the general content in hadoop2, and the outermost versionfactory.py identifies the directory name through regular matching to get the corresponding version number .

plugin.py是核心,负责实现所有必要的接口,具体需要实现的接口如表1所示:plugin.py is the core and is responsible for implementing all the necessary interfaces. The specific interfaces to be implemented are shown in Table 1:

表1Table 1

Figure BDA0001710865990000101
Figure BDA0001710865990000101

Figure BDA0001710865990000111
Figure BDA0001710865990000111

(cluster,instances)(cluster,instances)

Figure BDA0001710865990000121
Figure BDA0001710865990000121

Figure BDA0001710865990000131
Figure BDA0001710865990000131

图3显示了在功能实现上,主要分为集群的配置和启动两部分,config_helper.py是配置的核心模块,在其中配置了相关配置文件的路径,并进行了环境变量的配置;此外,config_helper.py还负责根据用户配置具体生成相应的配置文件,供即将启动的沙箱使用,图4中截取了一小部分配置spark环境变量时config_helper.py所做的工作;Figure 3 shows that in terms of function implementation, it is mainly divided into two parts: cluster configuration and startup. config_helper.py is the core module of configuration, in which the path of relevant configuration files is configured, and environment variables are configured; in addition, config_helper .py is also responsible for generating the corresponding configuration file according to the user's configuration for the sandbox to be started. Figure 4 intercepts a small part of the work done by config_helper.py when configuring the spark environment variables;

如图5显示了versionhandle.py中,根据当前的plugin版本具体完成沙箱的配置和启动,其中start_cluster方法中写明了沙箱启动的整体流程;As shown in Figure 5, in versionhandle.py, the configuration and startup of the sandbox are completed according to the current plugin version. The start_cluster method specifies the overall process of sandbox startup;

而run_scripts.py/starting_scripts.py具体实现集群的启动,其中利用instance.remote()方法,通过ssh远程连接至已经启动的虚拟机,并执行相应的linux命令,从而具体操控进程、节点、集群等的启动。And run_scripts.py/starting_scripts.py specifically implements the startup of the cluster, in which the instance.remote() method is used to remotely connect to the virtual machine that has been started through ssh, and execute the corresponding linux commands, so as to specifically control the process, node, cluster, etc. start.

(4)集群镜像打包制作工具实现(4) Implementation of cluster image packaging and production tools

OpenStack虚拟机镜像:OpenStack virtual machine image:

以CentOS操作系统为例,本实施例中OpenStack虚拟机镜像的制作过程及原理如下述:Taking the CentOS operating system as an example, the production process and principle of the OpenStack virtual machine image in this embodiment are as follows:

1)下载CentOS安装ISO镜像;1) Download the CentOS installation ISO image;

2)通过virt-manager工具或者virt-install命令进行安装。图6是一个使用命令行安装的例子;2) Install through the virt-manager tool or the virt-install command. Figure 6 is an example of installation using the command line;

图6显示了创建,了一个qcow2格式的虚拟机镜像,大小为10G,如果使用virt-manager,则可以通过图形化的提示进行逐步安装,安装过程中,需要进行一些额外的配置,如变更以太网状态、主机名设置、指定安装源和存储设备、进行磁盘分区、设置root密码等;Figure 6 shows the creation of a virtual machine image in qcow2 format with a size of 10G. If virt-manager is used, it can be installed step-by-step through graphical prompts. During the installation process, some additional configurations are required, such as changing the Ethernet Network status, hostname settings, specifying installation sources and storage devices, partitioning disks, setting root passwords, etc.;

3)经步骤2)后,通过root用户登录刚安装的虚拟机,进行相关的配置,如ACPI服务的安装、cloud-init包的安装、进行分区调整大小支持的配置、禁用zeroconf路由、配置控制台日志输出等;3) After step 2), log in to the newly installed virtual machine through the root user, and perform related configurations, such as installation of ACPI services, installation of cloud-init packages, configuration of partition resizing support, disabling of zeroconf routing, configuration control log output, etc.;

4)完成配置后,关闭虚拟机;4) After completing the configuration, shut down the virtual machine;

5)清除MAC地址信息;5) Clear the MAC address information;

6)压缩镜像。6) Compress the image.

完成上述步骤后,一个普通的OpenStack虚拟机镜像就制作完成,可上传到OpenStack平台上使用。After completing the above steps, a common OpenStack virtual machine image is created and can be uploaded to the OpenStack platform for use.

集群镜像:Cluster image:

针对不同类型和版本的集群,需要对应类型和版本的镜像作为支持,在制作集群镜像时,除了基本的OpenStack镜像制作步骤之外,还需要在镜像中进行所有相关软件包(如Hadoop、Spark)的下载安装和配置,本发明中,使用Diskimage-builder制作集群镜像。For clusters of different types and versions, images of corresponding types and versions are required to support them. When creating a cluster image, in addition to the basic OpenStack image creation steps, all related software packages (such as Hadoop and Spark) need to be performed in the image. Download, install and configure, in the present invention, use Diskimage-builder to make cluster image.

本发明进行了Hadoop集群自动伸缩部署实验The present invention conducts the experiment of automatic scaling deployment of Hadoop cluster

选取其中任意一组部署作为实验的代表,进行多次测试,并在此基础上比较优化前后的指标数据,对部署服务进行分析。Select any set of deployments as the representative of the experiment, conduct multiple tests, and compare the indicator data before and after optimization on this basis, and analyze the deployment services.

表2集群配置Table 2 Cluster Configuration

集群cluster vCPUvCPU RAMRAM diskdisk Node numberNode number Cluster 1Cluster 1 4core4core 10GB10GB 5GB5GB 88 Cluster 2Cluster 2 2core2core 100GB100GB 100GB100GB 1616 Cluster 3Cluster 3 1core1core 5GB5GB 80GB80GB 88 Cluster 4Cluster 4 1core1core 5GB5GB 80GB80GB 1616 Cluster 5Cluster 5 1core1core 5GB5GB 80GB80GB 24twenty four Cluster 6Cluster 6 1core1core 5GB5GB 80GB80GB 4848

实验中,将部署六个不同的Hadoop集群,如图6所示,研究了六个规模、配置不同的集群,本实验的物理计算节点共有6台,由于Openstack会资源使用情况对于虚拟机位置进行一定的控制,所以在第一、第二个集群中,会出现虚拟机均匀分布在各个节点上,为了减少其他因素带来的不确定性,本实施例中直接在6台相同的机器上进行集群部署,表2展示了这两个集群的具体节点资源配置情况;In the experiment, six different Hadoop clusters will be deployed. As shown in Figure 6, six clusters of different scales and configurations are studied. There are 6 physical computing nodes in this experiment. Since Openstack will determine the resource usage for the location of the virtual machine. Therefore, in the first and second clusters, the virtual machines will be evenly distributed on each node. In order to reduce the uncertainty caused by other factors, in this embodiment, it is directly performed on 6 identical machines. Cluster deployment, Table 2 shows the specific node resource configuration of these two clusters;

图8显示了集群创建服务的web页面,在该页面上进行集群创建的相关需求提交,其中包括Hadoop版本的选择、如表1所示的节点的配置、镜像的选择等,对这些都完成相关的指定之后,集群可进入部署阶段,在本次实验中,实验结果就部署速度、成功率这两个方面对于优化前后进行比较;Figure 8 shows the web page of the cluster creation service, on which the relevant requirements for cluster creation are submitted, including the selection of Hadoop version, the configuration of nodes as shown in Table 1, the selection of images, etc. After the designation of , the cluster can enter the deployment stage. In this experiment, the experimental results are compared before and after optimization in terms of deployment speed and success rate;

在这两组对比试验中,分别部署了六个Hadoop集群,每个集群的部署进行多次,将其中异常或是失败的情况摒除,取平均值作为该集群部署的时间,图9显示结果,优化后部署的速度相较于优化前有较为可观的提高,当所需部署的集群节点数较少的情况下,该优化效果不显著,但是当集群节点数增大时,优化之前的部署时间增幅明显,而优化之后的部署服务,随着集群规模的增大部署时间有所增加,但是增幅较为缓和,6次集群部署时间较为接近,部署时间稳定在10分钟到20分钟的区间范围之内,结果显示,本发明优化后的集群部署部署时间上有明显的改善,且所需时间更为稳定;如图10显示,优化后的部署服务相对于优化之前,即使在规模较小的集群部署过程中,仍体现了它的优化效果;结果显示,随着集群规模的增大,各种不确定性导致集群部署的成功率出现了一定程度的降低,在优化前,这种降幅表现明显,部署服务的稳定性较差;在优化之后,虽然成功率也同样降低,但是降幅较小,且降幅也趋于平缓,仍维持在一个很高的水平上;实验结果证实,在成功率方面,优化之后的效果显然是有明显的改善,本次部署服务优化较为成功。本发明的Hadoop集群自动伸缩部署策略,能够优化Hadoop集群的自动部署,使得部署服务更加稳定高效。In these two sets of comparative experiments, six Hadoop clusters were deployed respectively. The deployment of each cluster was carried out several times, and the abnormal or failed situations were excluded, and the average value was taken as the deployment time of the cluster. Figure 9 shows the results. Compared with before optimization, the deployment speed after optimization is significantly improved. When the number of cluster nodes to be deployed is small, the optimization effect is not significant, but when the number of cluster nodes increases, the deployment time before optimization The increase is obvious, and the deployment time after the optimization increases with the increase of the cluster size, but the increase is relatively moderate. The six cluster deployment times are relatively close, and the deployment time is stable within the range of 10 minutes to 20 minutes. , the results show that the deployment time of the optimized cluster deployment of the present invention is significantly improved, and the required time is more stable; as shown in Figure 10, the optimized deployment service is compared to before the optimization, even in a small-scale cluster deployment In the process, its optimization effect is still reflected; the results show that with the increase of cluster size, various uncertainties lead to a certain reduction in the success rate of cluster deployment. Before optimization, this decline is obvious. The stability of the deployment service is poor; after optimization, although the success rate is also reduced, the decline is small, and the decline tends to be gentle, still maintained at a high level; the experimental results confirm that in terms of the success rate, After optimization, the effect is obviously improved, and this deployment service optimization is relatively successful. The automatic scaling deployment strategy of the Hadoop cluster of the present invention can optimize the automatic deployment of the Hadoop cluster, so that the deployment service is more stable and efficient.

Claims (2)

1.一种基于OpenStack云进行Hadoop集群自动化伸缩部署方法,其特征在于,其包括,基于OpenStack云中的Sahara模块,与第三方管理工具通过Plugin机制进行整合,参考需求,结合自动化伸缩部署方法,为所需的Hadoop集群分配适量的虚拟机,在预分配的虚拟机中安装和配置Hadoop集群。1. a Hadoop cluster automatic scaling deployment method is carried out based on OpenStack cloud, it is characterized in that, it comprises, based on the Sahara module in OpenStack cloud, integrates by Plugin mechanism with third-party management tool, with reference to requirements, in conjunction with automatic scaling deployment method, Allocate the right amount of virtual machines for the desired Hadoop cluster, install and configure the Hadoop cluster in the pre-allocated virtual machines. 2.按权利要求1所述的方法,其特征在于,该方法根据预测和实时情况完成云环境下Hadoop集群的自动化伸缩部署,包括:2. by the described method of claim 1, it is characterized in that, this method completes the automatic scaling deployment of Hadoop cluster under cloud environment according to prediction and real-time situation, comprising: (1)基于利用率的自动伸缩策略(1) Automatic scaling strategy based on utilization 引入
Figure FDA0001710865980000012
分别代表用户对于集群CPU、内存RAM和硬盘Disk该三个利用率的期待值,替换该三者利用率值分别为lC、lR、lD的实际情况,根据用户对于不同的资源之间的重视程度不同,在其中引入λC、λR、λD三项分别作为所述三者的权值;由此得到以下数据,
introduce
Figure FDA0001710865980000012
Represents the user's expected value of the three utilization rates of the cluster CPU, memory RAM and hard disk Disk, respectively. Replace the actual situation of the three utilization values as l C , l R , and l D respectively. The importance of λ C , λ R , and λ D are different, and three items λ C , λ R , and λ D are introduced as the weights of the three respectively; thus the following data are obtained,
φ=λC·ηCR·ηRD·ηD (定义2)φ=λ C · η CR · η RD · η D (Definition 2) 其中,定义1代表各指标下实际利用率与期望利用率之间的差值,该指标具体反映各项指标之间的差距;定义2代表综合所述三项与期望之间的差值,该值的范围在[0,1)之内,越接近于0,则与期待值越接近,集群的利用率越符合预期;Among them, Definition 1 represents the difference between the actual utilization rate and the expected utilization rate under each indicator, and this indicator specifically reflects the gap between various indicators; Definition 2 represents the comprehensive difference between the three items and the expectation, the The range of the value is within [0, 1), the closer it is to 0, the closer it is to the expected value, and the more in line with the expected cluster utilization; (2)基于任务成功率的自动伸缩快速部署策略(2) Automatic scaling and rapid deployment strategy based on task success rate 在策略中引入一个变量
Figure FDA0001710865980000013
Introduce a variable into the strategy
Figure FDA0001710865980000013
是一个介于[0,1]的百分数,代表单个节点上任务能够成功运行的比例;各个节点
Figure FDA0001710865980000015
表示所有的任务能被成功执行,结果能顺利输出;
is a percentage between [0,1], representing the proportion of tasks that can run successfully on a single node; each node
Figure FDA0001710865980000015
Indicates that all tasks can be successfully executed and the results can be output smoothly;
基于节点任务执行的失败不可避免,对
Figure FDA0001710865980000016
设一个预估值
Figure FDA0001710865980000017
如果该值趋近于0,则代表该节点的任务成功率过于小,该节点的继续使用会降低集群的运行效率,将启用节点置换策略。
The failure of node-based task execution is inevitable.
Figure FDA0001710865980000016
set an estimate
Figure FDA0001710865980000017
If the value is close to 0, it means that the task success rate of this node is too small, and the continued use of this node will reduce the operating efficiency of the cluster, and the node replacement strategy will be enabled.
CN201810682329.9A 2018-06-27 2018-06-27 Automatic scaling deployment and Plugin deployment method of Hadoop cluster based on OpenStack cloud Active CN110647379B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810682329.9A CN110647379B (en) 2018-06-27 2018-06-27 Automatic scaling deployment and Plugin deployment method of Hadoop cluster based on OpenStack cloud

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810682329.9A CN110647379B (en) 2018-06-27 2018-06-27 Automatic scaling deployment and Plugin deployment method of Hadoop cluster based on OpenStack cloud

Publications (2)

Publication Number Publication Date
CN110647379A true CN110647379A (en) 2020-01-03
CN110647379B CN110647379B (en) 2023-10-17

Family

ID=68988861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810682329.9A Active CN110647379B (en) 2018-06-27 2018-06-27 Automatic scaling deployment and Plugin deployment method of Hadoop cluster based on OpenStack cloud

Country Status (1)

Country Link
CN (1) CN110647379B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104320460A (en) * 2014-10-24 2015-01-28 西安未来国际信息股份有限公司 Big data processing method
US20150063166A1 (en) * 2013-08-27 2015-03-05 Futurewei Technologies, Inc. System and Method for Mobile Network Function Virtualization
CN104734892A (en) * 2015-04-02 2015-06-24 江苏物联网研究发展中心 Automatic deployment system for big data processing system Hadoop on cloud platform OpenStack
CN106982137A (en) * 2017-03-08 2017-07-25 中国人民解放军国防科学技术大学 Hadoop cluster Automation arranging methods based on kylin cloud computing platform

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150063166A1 (en) * 2013-08-27 2015-03-05 Futurewei Technologies, Inc. System and Method for Mobile Network Function Virtualization
CN104320460A (en) * 2014-10-24 2015-01-28 西安未来国际信息股份有限公司 Big data processing method
CN104734892A (en) * 2015-04-02 2015-06-24 江苏物联网研究发展中心 Automatic deployment system for big data processing system Hadoop on cloud platform OpenStack
CN106982137A (en) * 2017-03-08 2017-07-25 中国人民解放军国防科学技术大学 Hadoop cluster Automation arranging methods based on kylin cloud computing platform

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
ANTONIO CORRADI ET AL.: "Elastic provisioning of virtual Hadoop clusters in OpenStack-based Clouds", 《IEEE ICC 2015 - WORKSHOP ON CLOUD COMPUTING SYSTEMS, NETWORKS, AND APPLICATIONS (CCSNA)》 *
张新朝: "基于云平台虚拟集群的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
王炳旭: "基于IaaS云平台的Hadoop资源调度策略研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Also Published As

Publication number Publication date
CN110647379B (en) 2023-10-17

Similar Documents

Publication Publication Date Title
CN111290834B (en) Method, device and equipment for realizing high service availability based on cloud management platform
JP2013168140A (en) Method for deploying virtual machines
CN107566165B (en) Method and system for discovering and deploying available resources of power cloud data center
CN102546256B (en) System and method used for monitoring cloud computation service
CN102882909B (en) Cloud computing service monitoring system and method thereof
WO2017206667A1 (en) Method and device for distributively deploying hadoop cluster
US11886905B2 (en) Host upgrade method and device
US20140310703A1 (en) Multi-machine deployment and configuration of multi-tiered applications
CN115220874B (en) Kubernetes cluster deployment method, device, equipment and storage medium
CN111741134A (en) A system and method for rapid construction of virtual machines in large-scale scenes of network shooting range
CN110008005B (en) Cloud platform-based power grid communication resource virtual machine migration system and method
CN103200036A (en) Automated configuration method of electrical power system cloud computing platform
Teixeira et al. Datacenter in a box: Test your SDN cloud-datacenter controller at home
CN113835834B (en) A capacity expansion method and system based on K8S container cluster computing nodes
EP3011474A1 (en) Monitoring a computing network
CN107493184B (en) Virtualized network function deployment method and system
CN114466030B (en) Management method and device of data distributed storage strategy and distributed storage system
CN111786810A (en) A method and system for automatic deployment of large-scale test bed nodes
CN108897603B (en) A memory resource management method and device
CN112527450B (en) Super-fusion self-adaptive method, terminal and system based on different resources
CN105933136A (en) Resource scheduling method and system
CN110162312B (en) BeeGFS configuration method and device based on IML
CN118394523A (en) Method, device, computer equipment and storage medium for improving resource allocation
CN110647379A (en) Hadoop cluster automatic scaling deployment and Plugin deployment method based on OpenStack cloud
Rangarajan et al. Managing the availability of VNFs with the availability management framework

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant