外文翻译-基于ssh的选课系统的设计与实现_第1页
外文翻译-基于ssh的选课系统的设计与实现_第2页
外文翻译-基于ssh的选课系统的设计与实现_第3页
外文翻译-基于ssh的选课系统的设计与实现_第4页
外文翻译-基于ssh的选课系统的设计与实现_第5页
已阅读5页,还剩16页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、1 外文资料翻译译文 Java自动配置的研究与应用和基于XML元数据部署工具吴海李,龚任斌,王从斌石油化工科学研究院勘探开发,西北地区,中石油,535号严而湾路,甘肃省兰州市730020,中国,Ph./Fax:8823/51551390*通讯作者,电子信箱:wuhl_xb摘要随着上线A11的生产管理体系和验收,业务工作正在成为管理分布式系统越来越重要。如何保证系统的版本更新工作速度快,稳定,高效,成为迫切需要解决的问题。我们设计和实现ConfigTool这是基于由执行的XML元数据的自动配置和部署工具Java的。 ConfigTool实现解压,修改,压缩的自动化流程

2、和包的部署。另外,我们也研究和优化文件压缩算法,这是在ConfigTool使用。通过ConfigTool,业务工作会变得简单,提高工作效率。关键字:分布式系统;XML;自动配置和部署;压缩算法。1、 介绍随着上线验收A11的生产管理体系,业务工作正在成为管理分布式系统越来越重要。 如何确保系统的版本更新速度快的工作,稳定,高效,成为一个亟待解决的问题是解决了。由于以下原因,我们开发ConfigTool。首先,分布式系统使用具有数万的服务器有时数千不同的油田,除了与系统升级有关的配置文件分布在许多不同以 “.properties” 结束的文件,所以当手动配置,这些配置文件将不可避免地产生很难找到

3、的错误。其次,关系数据库,实时数据库和域名地址是在不同油田不同。这样的配置项是数不胜数。这些条件有增加了维护工作量,并且所需的工作,以确保准确性。 从图1 A11的生产管理系统之间的关系,你可以想象这是多少配置文件和物品!图1.A11的关系图第三,当开发人员发布程序(war或jar)的新版本,这只是一个某油田。要部署该程序的另一油田,运营人们不得不解压缩这场war或jar,然后找到合适的配置文件,并修改正确的项目,所有的压缩解压缩的文件和修改的文件到目标war包或jar包,最后,部署在目标war包/ jar包到目标油田的应用服务器。在这业务工作,解压缩,压缩和部署是重复性的工作。而在更大的意义

4、上,修改配置文件也是重复性工作;但在微范围内,操作人员需要了解每个配置文件是什么具体的定义,需要找到正确的配置文件和项目进行修改。在这种情况下,这是正常的维护一个配置文件,为每个油田的每一个环境。这样做很容易通过犯错误,而且成本和操作时间会随的增加而线性增长部署环境。具有重大的现实意义的Soitis开发出智能自动配置和部署工具1。有许多关于软件开发和测试的许多配置工具。自动配置WEBX的工具包,它是淘宝的开源Web框架,定义变量配置项目作为模板文件,运行该工具时,可以生成特定的配置文件基座上的相应的模板文件4。但是,使用这些工具需要通过命令线或行家,它不具有一个违反直觉的界面和它的复杂配置自动

5、配置本身。 Ansible是Python实现自动化运营管理工具。它包含了一些维修工具(puppet, Cfengine, chef, func)的优点,但它仅适用于Linux系统。木偶是基于C / S的配置管理工具的基础框架。当使用这个工具,你必须在中央服务器上安装木偶大师,安装在目标主机上的傀儡客户端软件。当客户端连接的木偶大师,在木偶大师所定义的配置文件进行编译,并在客户端上运行。如果使用这个工具,其通信方式将影响A11的生产管理系统而这并不适用于我们的系统2-3。我们的目标是设计自动化配置和部署工具,它完全没有或很少需要人工作业。我们实现自动化配置和部署工具基于与Java XML元数据。

6、通过使用它,我们配置和部署每个程序版本的A11容易,并有效地降低了系统的运行时间,使的概率失误,极大地提高了工作效率。2.设计工具实现自动化配置和部署工具(称为ConfigTool),我们设计了程序如下基于所有我们的研究和实际需要的。首先,选择需要配置和部署war包/ jar包(是)(称为A)需要配置和部署。第二,读取并解析XML配置模板(称为B),其中标签“CONF文件”(称为C)对应的配置文件的名称,子标记“CONF”使用键值对,以表达相关的配置项。而密钥(称为D)是配置项的 “.properties”配置文件中的名称,值(称为E)是这样的配置项的值。三,解压缩,并在压缩文件中找到C,在C

7、中修改D的值作为E。压缩所有文件为目标的war包/ jar包(称为F)。最后,部署F到目标应用程序服务器。2.1构建和解析配置模板配置模板,其中包含了大量的配置XML文件信息,我们需要提取的配置文件,配置项目和目标值需要从配置模板进行修改。XML配置模板设计如下:标签“LIB”表示此配置模板是哪个油田或生产区。标签的“模板”,包括所有程序软件包配置文件需要修改。每个程序包是一个“模板”标签,在其中的“应用程序”属性显示的名称这个程序包,“类型”属性标识的环境(开发,测试或类型生产),“版本”属性指定程序的版本号。标签的“源”属性“CONF文件”表示当前程序包的配置文件需要修改。 标签“CONF

8、”表示配置项和当前配置文件的目标值需要修改,其中“关键”属性指示要修改哪些配置项,“值”属性指示对应的目标修改后的值。上面提到的所有的标签和属性都是需要的。ConfigTool抽象的XML文件作为一个阶级的每个标签,实现XML的分析基于JDOM配置模板,使用属性类来实现阅读和配置文件的修改。图2. ConfigTool的 配置模板2.2压缩,解压缩算法ConfigTool使用Java的Ant库完成减压压缩操作。在前面的算法,我们解压缩war/jar中的所有文件包,然后根据配置模板的分析结果修改配置文件配置项。最后压缩所有文件到目标war/jar包。优化算法主要用于压缩过程,因为以前算法是耗时的

9、压缩处理。获得目标war/jar包通过两种途径。一个是修改所需要的配置文件 - 先压缩,然后进行修改,最后压缩。另一种是对所有剩余的文件,只需在原来的war包/jar包将这些文件复制由字节流的目标。因为所有剩余的文件的数量远远超过该修改的配置文件,所以效率大大地提高4-6。我们做了两种算法之间的比对。使用两种算法使得在war包的配置时间相差不大。但他们在配置jar包有大的变化。由于jar的文件结构比war更为复杂。当然,副本更轻松。通过使用优化算法,jar分组的共同的压缩时间从最初的1-2分钟减少到数秒。2.3自动部署ConfigTools自动部署功能可以单独使用,也就是,用户可以不要在课2.

10、1和2.2中引入的功能。我们定义在ConfigTool一个标志,当用户使用以前的功能,标记=1,否则标志=0。如果flag=1,ConfigTool使用哈德森完成包的自动结构,它在自动减压配置过程,然后部署构造应用到应用服务器。 如果标志为0,用户应该选择节目包先部署。在本节中,我们使用哈德森它支持分布式结构和抽象应用服务器控制台。 数字图3是应用服务器控制台“抽象接口7-9中的一个。图4显示了ConfigTool的全自动部署过程。首先拿到一揽子方案的部署,然后选择你要部署的应用服务器(如:Tomcat/ WebSphere),然后使用哈德森使包装的自动构建,上传构造程序到应用服务器,根据程序

11、的施工结构,以确定是否要部署包仓库10。同时,应用该资源部署和代理中间件容器,然后部署应用程序包,一小会儿后,ConfigTool将返回访问地址并报告部署成功的。图3.IBM WebSphere 应用服务器的抽象接口图4. ConfigTools自动部署的流程图3、 结果与分析ConfigTool是自动配置和部署工具一个独立的程序由Java实现,视XML文件作为信息库,其核心功能是自动从原始WAR/ WAR包到完成配置过程目标的。随着中国石油的油田运行试验的经验,采用ConfigTool能够顺利管理配置的数百套的过程和部署环境在数十个领域的当前。表1. ConfigTool的原理表1示出了该工

12、具的基本原理是:A代表油田的参数库,每个油田都有一个图书馆。 B代表这是对应于一个系统的配置的模板。其内容涉及开发,测试和生产环境的结构。 C代表的目录这是完全对应的war/ jar包的配置文件。 D代表其中包括原装包和C文件的目标程序包。从左至右,ConfigTool自动生成部署的war/ jar包。 一个和B可以在XML/ Excel的编辑器进行编辑。 C能快速生成相应的通过ConfigTool配置文件目录。 D程序将自动覆盖在原包C目录的配置文件,并获得目标部署包。ConfigTool主要包含四个面板分别是“原包”,“配置参数”,“包”和“部署”。图5显示了“原包”面板,选择程序的原包装

13、在此面板的路径,ConfigTool可以自动列出所有在这条道路的包,然后用户可以选择他们想要的配置和部署的包。图5.ConfigTool的Original Package面板图6显示了“配置参数”面板。在这个面板中,选择的路径配置模板和目标包部署,配置工具可以将环境解析该路径的所有配置模板,并列出结果。并根据环境ConfigTool可以生成相应的包。在“包”面板中,单击“包”按钮,ConfigTool先解压缩原包装,然后解析配置模板,根据该分析结果修改相应的在配置文件中的配置项,最后压缩所有原始的和修改过的文件到目标包。为确保安全,一些私人信息已经覆盖如图6所示。图6 ConfigTool的

14、Configuration Parameters 面板图7示出了“包”面板。在“包”面板中,单击“启动包”按钮,ConfigTool先解压缩原包装,然后解析配置模板,根据分析结果修改的配置对应的配置项文件,最后压缩所有原始的和修改过的文件到目标包。图7 ConfigTool的 Package 面板图8示出了“部署”面板。在这个面板中,选择应用程序服务器的类型,在服务器IP,用户名,密码,以及部署路径补,ConfigTool将使用哈德森来自动创建目标包并上传,然后调用相应的应用程序服务器的抽象类来完成目标包的自动部署。图8 ConfigTool的Deploy 面板使用ConfigTool可以解决

15、的运行和维护的问题,对于A11项目,简化的所有油田A11系统的配置和部署的工作石油,有效地降低误差率和配置的部署时间,大大提高了的工作效率和工具是容易使用。表2示出的对比度之前的影响,并后ConfigTool的应用。表2对比前后ConfigTool为A11项目应用后的效果对于A11项目,ConfigTool的应用程序之前,每个油田的每一个版本程序(包括4个war和10个 jar包),需要解压,修改配置文件,压缩,然后部署到服务器,在零错误率的情况下,这过程将需要1-2天的每个版本,如果发生错误,这将持续较长时间,通常为约一个星期。在使用ConfigTool只有近零差率花费15分钟。该从各油田1

16、-2人(S)的操作和维护人员数量减少1-2人(S)的所有油田。使用ConfigTool后,不仅降低了错误率,但也不需要的培训时间。因为操作和维护人员不需要了解每个包和配置文件的关系和含义。更多重要的是,ConfigTool适用于所有的J2EE项目的配置和部署,它具有广阔的应用前景,用户所要做的只是为每个包按照与前面介绍的格式写配置模板。4. 结论和进一步研究从我们的一切工作,我们可以看到,XML配置模板中包含了大量的项目的配置信息。使用ConfigTool可以有效地减少配置和维护人员的部署时间,也有助于通过手动避免降低错误率更改配置文件,提高了工作效率。要修复耗时在压缩过程中的挑战,我们描述了

17、一个高度可用的算法。该减压过程算法的改进是比以往更加实用,并且使ConfigTools界面更人性化也很重要。【参考文献】1郭安.研究软件配置管理中的应用项目开发.第六届全国会议计算机应用.中国北京. 2002; 3:1082至1084年.2滇西时,博鼎,魏翠,亦名张,王王怀民.研究与实现部署和配置工具轻质组件.计算机科学. 2011; 06:165-168.3张一鸣,石滇西,鼎博,殷罡.研究和部署的执行情况配置工具普适计算中间件.第四Jiont会议上和谐人机环境.中国武汉. 2008; 1:574-580.4 Pham Duc-Son, Venkatesh Svetha. Efficient

18、Algorithms for Robust Recovery of Images from Compressed Data. IEEE Transactions on Image Processing. 2013; 41(6): 2212-2221. 5 BL Kess, DR Steinwand, SE Reichenbach. Compression of the Global Land 1-km AVHRR Dataset. International Journal of Remote Sensing. 1996; 39(2): 1715-1723.6 Hach Faraz, Numa

19、nagic Ibrahim, Alkan Can, Sahinalp S Cenk. SCALCE: Boosting Sequence Compression Algorithms Using Locally Consistent Encoding. Oxford Journal of Science and athematics. 2012; 21(4): 2823-2830. 7林波,周名辉,刘天成,黄钢,梅虹. Web容器集成框架的J2EE应用程序服务器. Journal of Softwar. 2006; 17(5):1195至1203年.8李冰硼散,孙长岐,兰阳.软件智能部署方法.

20、杂志计算机应用. 2009年; 01:248-252.9张元,张云勇,房秉.云系统的自动部署体系结构基于工作流.电信科学. 2014年; 11:14-21.10赵天齐.在云计算的Web应用程序的自动部署和资源配置环境.哈尔滨工业大学. 2014年Telkomnika的版权是电气工程,艾哈迈德系的财产达赫兰大学,未经版权所有人明确的书面许可,其内容不得复制或通过电子邮件发送给多个站点或发布到一个群发功能。但是,用户可以打印,下载,或电邮文章以供个人使用2.外文原文 TELKOMNIKA, Vol.13, No.3, September 2015, pp. 10621068ISSN: 1693-6

21、930, accredited A by DIKTI, Decree No: 58/DIKTI/Kep/2013DOI: 10.12928/TELKOMNIKA.v13i3.1977 n 1062Received March 10, 2015; Revised June 5, 2015; Accepted June 24, 2015Research and Application of Java Auto-Configuration and Deployment Tool Based on XML MetadataWu Hailli*, Gong Renbin, Wang CongbinRes

22、earch Institute of Petroleum Exploration & Development-Northwest, PetroChina,No.535 Yanerwan Road, LanZhou, GanSu 730020, China, Ph./Fax: 8823/51551390*Corresponding author, e-mail: wuhl_xbAbstractWith the on-line and acceptance of A11s production management system, the operational wor

23、k is becoming increasingly critical to managing distributed system. How to ensure system version update work fast, stable and efficient, become an urgent problem to be solved. We design and implement ConfigTool which is a auto-configuration and deployment tool based on XML metadata implemented by Ja

24、va. ConfigTool realizes the automated processes of decompression, modification, compression and deployment of packages. In additon, we also study and optimize the file compression algotithm which is used in ConfigTool. Through ConfigTool, operational work can become simple and improving work efficie

25、ncy.Keywords: distributed system, XML, auto-configuration and deployment, compresssion algotithmCopyright 2015 Universitas Ahmad Dahlan. All rights reserved.1. IntroductionWith the on-line and acceptance of A11s production management system, the operational work is becoming increasingly critical to

26、managing distributed system. How to ensure system version update work fast, stable and efficient, become an urgent problem to be solved. Because of the following reasons, we developed ConfigTool.Firstly, the distributed system is used with tens of servers sometimes thousands in different oilfield, b

27、esides configuration files associated with system upgrading are distributed in many different files end with ”.properties”, so when configure these profiles manually will inevitably produce errors which are hard to find.Secondly, relational database, real-time database and domain name address are di

28、fferent in different oilfiled. Configuration items like these are countless. These conditions have increased the maintenance workload, and the work is needed to ensure the accuracy. From Figure 1 the relationship of A11s production management system, you can image how many configuration files and it

29、ems they are!Figure 1. The relationship of A11project.Thirdly, When developers release a new version of program (war or jar), its only for a certain oilfield. To deploy this program to another oilfield, operational people have to decompress this war or jar, then find the right configuration files an

30、d modify the right items, compressed all the extracted files and modified files into the target war or jar packages, finally, deploy the target war/jar package to the application server of the target oilfield. In this operational work, decompression, compression and deployment are repetitive work. W

31、hile in the larger sense, modify configuration files is also the repetitive work; but in the micro-scope, operational people need to understand each configuration file is what specific defined, and need to find the correct configuration files and items to modify. In this condition, its normal to mai

32、ntain one configuration files for every environment of every oilfield. Its very easy to make mistakes by doing this, and the cost and operational time will grow linearly along with the increase of deployment environments. Soitis of great practical significancetothe develop a intelligent autoconfigur

33、ation and deployment tool 1.There are many configuration tools about software development and testing. Autoconfig Toolkit of WebX which is Taobaos open-source web framework, define the variable configuration items as a template file, when running the tool can generate the specific profiles base on t

34、he corresponding template file 4. But to use the tools needs through the command line or maven, it doesnt have a counterintuitive interface and its complex to configure Autoconfig itself. Ansible is an automation operation management tool implemented by Python. It Contains the advantages of a number

35、 of maintenance tools (puppet, Cfengine, chef, func), but it is only applicable to Linux system. Puppet is a configuration management tools base on C/S framework. When using this tool, you have to Install Puppet master on a central server, Install the puppet client software on the target host. When

36、the client is connected on the Puppet master, the configuration files Defined in the Puppet master are compiled, and run on the client. If use this tool, its way of communication will affect the A11s production management system and its not applicable for our system 2-3.Our goal is to design automat

37、ion configuration and deployment tool which completely dont or need little manual work. We implement automation configuration and deployment tool based on XML metadata with Java. By using it we configure and deploy every program version of A11 easily, and effectively reduces the system operation tim

38、e and the probability of making mistakes, which greatly improves the work efficiency.2. Design and Implementation of ToolAutomation configuration and deployment tool (called as ConfigTool), we design its procedures as follows based on all of our research and the actual needs.First, select the war/ja

39、r package(s) (called A) which need(s) to configure and deploy.Second, read and parse the XML configuration template (called B), in which tag ”conffile” (called C) corresponds tothe name of the configuration file, subtag “conf” uses keyvalue pairs to express the associated configuration items. While

40、Key (called D) is a configuration items name in the “.properties” configuration file, value (called E) is this configuration items value.Third, decompress A, and find C in the decompressed files, modify Ds value as E in C. Compress all the files as target war/jar package (called F).At last, deploy F

41、 to the target application server.2.1. Build and Parse Configuration TemplateConfiguration Templateisa XML file which contains a large number of configuration information, we need to extract the configuration files, configuration items and the target values needed to modify from the configuration te

42、mplate.The XML configuration template is designed as follows:Tag “lib” indicates this configuration template is for which oillfield or production area. Tag “templates” includes all the program packages whose configuration files needs to modify. Each program package is a “template” tag, in which the

43、“app” property indicates the name of this program package, “type” property identifies the type of environment (development, test or production), “version” property specifies the programs version number. The “src” property of tag “conffile” indicates which configuration files of the current program p

44、ackage need to modify. Tag “conf” indicates which configuration items and their target values of the current configuration file need to modify, in which “key” property indicates which configuration item you want to modify, “value” property indicates the corresponding target modified value. All the t

45、ags and properties mentioned above are required.Figure 2. The Configuration Template of ConfigToolConfigTool abstract each tag of the XML file as a class, implements the analysis of XML Configuration Template based on JDOM, uses the Properties Class to achieve the reading and modifying of the config

46、uration file.2.2. Compression-Decompression AlgorithmsConfigTool uses the Ant library of Java to complete the decompression and compression operation. In the previous algorithm, we decompress all the files of war/jar package, then according to the analysis results of the configuration template modif

47、y the configuration items of configuration files. Finally compress all the files into target war/jar package.The optimized algorithmis mainly for the compression process, because the previous algorithm is time-consuming in the compression process. The target war/jar package is obtained by two ways.

48、One is for the configuration files needed to modify-first decompress, then modify, last compress. The other is for all the remaining files, just copy these files in the original war/jar to the target by the byte stream. Because the number of all the remaining files is far more than that of modified

49、configuration files, so the efficiency is greatly raised 4-6.We made a intercomparison between two algorithms. Using the two algorithms makes Little difference onthe configuration time of war package. But they have large variations in configuring jar package. Because the file structure of jar is mor

50、e complicated than that of war. Of course, copy is easier. By using the optimized algorithm, the compression time of a common jar packet from initial 1-2 minutes reduced to a few seconds.2.3. Automatic DeploymentConfigTools automatic deployment function can be used separately, that is, user can not

51、use the function introduced in lesson 2.1 and 2.2. We define a flag in ConfigTool, when user uses the previous functions, flag=1, otherwise flag=0. If flag=1, ConfigTool use Hudson to complete the automatic construction of package which is decompressed in the automatic configuration process, then de

52、ploy the constructed application to the application server. If flag=0, user should select the program package to deploy first. In this section, we use Hudson which supports the distributed construction and abstract the application server consoles. Figure 3 is one of the application server consoles a

53、bstract interface 7-9.Figure 4 shows the ConfigTool whole automatic deployment process. First get the program package to deploy, then select the application server you want to deploy (eg: Tomcat/WebSphere), then use the Hudson make the automatic construction of the package, upload the constructed pr

54、ogram to the application server, according to programs construction structure to determine whether to deploy package warehouse 10. At the same time, apply the resource deployment and agent middleware container, then deploy the application package, after a little while, ConfigTool will return the acc

55、ess address and report that deployment is successful. Figure 3. The Abstract Interface of IBMWebSphere Application ServerFigure 4. Flow Chart of ConfigTools Automatic Deployment 3. Results and AnalysisConfigTool is a stand-alone program on auto-configuration and deployment tool implemented by Java,

56、regards XML file as information repositories, its core function is to automatically complete the configuration process from the original WAR/WAR package to the target ones. With the experience of the trial run in the oilfields of Petro China, using ConfigTool can smoothly manage the process of confi

57、guration and deployment of hundreds of sets of environment in dozens of areas currently. Table 1 shows the basic principle of the tool: Table 1. Principle of ConfigToolA represents the parameter library of oilfield, each oilfield has one library. B representsthe configuration template which is corre

58、sponding to one system. Its contents involve the configuration of development, test and production environment. C represents the directory of configuration files which are exactly corresponding to that of war/jar package. D represents target program package which consists of original package and the files in C.From left to rig

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论