


技术领域technical field
本发明涉及GIS应用技术领域,尤其涉及一种基于PaaS的GIS应用部署方法及系统。The invention relates to the technical field of GIS applications, in particular to a PaaS-based GIS application deployment method and system.
背景技术Background technique
PaaS(Platform-as-a-Service),平台即服务,是指把计算环境、开发环境等平台作为一种服务提供的商业模式。它是一种介于IaaS(Infrastructure-as-a-Service,基础设施即服务)和SaaS(Software-as-a-Service,应用即服务)之间的一种云计算模式。PaaS (Platform-as-a-Service), platform as a service, refers to a business model that provides computing environment, development environment and other platforms as a service. It is a cloud computing model between IaaS (Infrastructure-as-a-Service, infrastructure as a service) and SaaS (Software-as-a-Service, application as a service).
传统开发部署一套GIS应用系统通常是一个漫长的过程。首先需要选定一个GIS平台进行GIS应用开发;然后在测试环境中进行测试;最后,当GIS应用系统需要上线的时候,还需要进行硬件申请、购买、运输、软硬件的安装与配置等过程。The traditional development and deployment of a GIS application system is usually a long process. First, you need to select a GIS platform for GIS application development; then test it in the test environment; finally, when the GIS application system needs to go online, it also needs to go through the process of hardware application, purchase, transportation, installation and configuration of software and hardware.
传统的GIS应用的运维模式主要存在以下几个问题:The operation and maintenance mode of traditional GIS applications mainly has the following problems:
无法应对快速、多变的业务需求。开发部署期间需要研发部、测试部、物资部、财务部、运维部等多个部门相互协作才能够顺利完成。这将影响了系统发布周期,使得应用的更新无法适应业务需求变化的速度。Inability to respond to fast, changing business needs. During the development and deployment period, the R&D department, the testing department, the material department, the finance department, the operation and maintenance department and other departments need to cooperate with each other to complete the project smoothly. This will affect the system release cycle, making application updates unable to adapt to the speed at which business needs change.
资源利用率低,维护成本高。在传统的部署模式下,不同的GIS应用系统不能共享硬件资源,测试环境和生产环境也无法共享硬件资源。当迎来业务高峰的时候,只能通过购买新的服务器资源来扩展系统能力,但是当过了业务高峰以后,又会造成许多服务器被闲置,资源的利用率低。同时又会为企业带来额外的供电、冷却等方面的费用支出。Low resource utilization and high maintenance costs. In the traditional deployment mode, different GIS application systems cannot share hardware resources, nor can test environments and production environments share hardware resources. When the business peak is ushered in, the system capacity can only be expanded by purchasing new server resources. However, after the business peak, many servers will be idle and the resource utilization rate will be low. At the same time, it will bring additional expenses for power supply, cooling and other aspects of the enterprise.
手工部署系统,效率低。现有系统通常是分布式系统,因此需要为每台服务器重复安装与配置软硬件资源。这是一项繁重的工作,费时费力,大量的重复人工配置工作,极易导致部署的失败。Manual deployment of the system is inefficient. Existing systems are usually distributed systems, so it is necessary to repeatedly install and configure hardware and software resources for each server. This is a heavy work, time-consuming and laborious, and a lot of repetitive manual configuration work, which can easily lead to the failure of deployment.
系统部署困难。在传统的开发模式下,GIS应用系统的研发环境、测试环境和生产环境不尽相同。运维人员按照研发人员编写的部署手册一步步进行系统部署,但是由于研发环境和生产环境的差异,可能导致部署手册无效,而无法在生产环境中进行部署。System deployment is difficult. In the traditional development mode, the R&D environment, test environment and production environment of GIS application system are different. The operation and maintenance personnel deploy the system step by step according to the deployment manual written by the R&D personnel. However, due to the difference between the R&D environment and the production environment, the deployment manual may be invalid and cannot be deployed in the production environment.
系统监控困难,在生产环境下难以跟踪定位问题。在分布式环境下,当系统遇到问题的时候,运维人员需要分别登录不同的服务器下载系统日志,然后交予研发人员,研发人员面对海量离散的日志,采用人工的方式搜索日志进行问题定位,这种运维方式很难有效而准确地定位到系统问题发生的位置和产生的原因。System monitoring is difficult, and it is difficult to track and locate problems in a production environment. In a distributed environment, when the system encounters a problem, the operation and maintenance personnel need to log in to different servers to download the system log, and then hand it over to the R&D personnel. Faced with a large number of discrete logs, the R&D personnel manually search for the log to solve the problem. It is difficult to effectively and accurately locate the location and cause of system problems.
发明内容SUMMARY OF THE INVENTION
本发明所要解决的技术问题是:提供一种能够快速部署GIS应用的基于PaaS的GIS应用部署方法及系统。The technical problem to be solved by the present invention is to provide a PaaS-based GIS application deployment method and system capable of rapidly deploying GIS applications.
为了解决上述技术问题,本发明采用的技术方案为:一种基于PaaS的GIS应用部署方法,包括:In order to solve the above-mentioned technical problems, the technical solution adopted in the present invention is: a PaaS-based GIS application deployment method, comprising:
创建GIS应用的实例,申请GIS应用的实例所需硬件资源;Create an instance of GIS application and apply for hardware resources required by the instance of GIS application;
为GIS应用的实例分配硬件资源,启动指定数量的容器;Allocate hardware resources to instances of GIS applications and start a specified number of containers;
在所述容器自动镜像部署所述GIS应用的实例;Deploy the instance of the GIS application automatically in the container;
将启动的GIS应用的实例的地址注册到智能路由器中。Register the address of the instance of the launched GIS application in the intelligent router.
本发明还涉及一种基于PaaS的GIS应用部署系统,包括:The present invention also relates to a PaaS-based GIS application deployment system, comprising:
创建模块,用于创建GIS应用的实例;Create modules for creating instances of GIS applications;
申请模块,用于申请GIS应用的实例所需的硬件资源;The application module is used to apply for the hardware resources required by the instance of the GIS application;
分配模块,用于分配硬件资源;Allocation module for allocating hardware resources;
启动模块,用于启动容器;The startup module is used to start the container;
部署模块,用于镜像部署所述GIS应用的实例;a deployment module for mirroring and deploying the instance of the GIS application;
注册模块,用于将启动的实例的地址注册到智能路由器中。The registration module is used to register the address of the launched instance to the smart router.
本发明的有益效果在于:在分配的指定容器中自动部署GIS应用的实例,避免了繁重的手工部署的缺陷,部署效率高,并且部署成功率高,业务通过智能路由器便可访问所有的GIS应用,使用方便灵活。The beneficial effect of the present invention is that: the instance of GIS application is automatically deployed in the assigned designated container, the defect of heavy manual deployment is avoided, the deployment efficiency is high, and the deployment success rate is high, and the business can access all GIS applications through the intelligent router , easy to use and flexible.
附图说明Description of drawings
图1为本发明基于PaaS的GIS应用部署流程图;Fig. 1 is the GIS application deployment flow chart based on PaaS of the present invention;
图2为本发明实施例的基于PaaS的GIS应用部署流程图;Fig. 2 is the flow chart of the GIS application deployment based on PaaS of the embodiment of the present invention;
图3为本发明实施例的基于PaaS的GIS应用部署系统框图;3 is a block diagram of a PaaS-based GIS application deployment system according to an embodiment of the present invention;
标号说明:Label description:
1、创建模块;2、申请模块;3、分配模块;4、启动模块;5、部署模块;6、注册模块。1. Create a module; 2. Apply for a module; 3. Assign a module; 4. Start a module; 5. Deploy a module; 6. Register a module.
具体实施方式Detailed ways
为详细说明本发明的技术内容、所实现目的及效果,以下结合实施方式并配合附图予以说明。In order to describe in detail the technical content, achieved objects and effects of the present invention, the following descriptions are given with reference to the embodiments and the accompanying drawings.
本发明最关键的构思在于:在分配的指定容器中部署GIS应用的实例,避免了繁重的手工部署的缺陷,部署效率高,并且部署成功率高。The key concept of the present invention is: deploying the instance of GIS application in the assigned designated container, avoiding the defect of heavy manual deployment, high deployment efficiency, and high deployment success rate.
请参照图1至图3,一种基于PaaS的GIS应用部署方法,包括:Please refer to Fig. 1 to Fig. 3, a kind of GIS application deployment method based on PaaS, including:
创建GIS应用的实例,申请GIS应用的实例所需硬件资源;Create an instance of GIS application and apply for hardware resources required by the instance of GIS application;
为GIS应用的实例分配硬件资源,启动指定数量的容器;Allocate hardware resources to instances of GIS applications and start a specified number of containers;
在所述容器自动镜像部署所述GIS应用的实例;Deploy the instance of the GIS application automatically in the container;
将启动的GIS应用的实例的地址注册到智能路由器中。Register the address of the instance of the launched GIS application in the intelligent router.
从上述描述可知,本发明的有益效果在于:在分配的指定容器中部署GIS应用的实例,避免了繁重的手工部署的缺陷,部署效率高,并且部署成功率高,业务通过智能路由器便可访问所有的GIS应用,使用方便灵活。As can be seen from the above description, the beneficial effects of the present invention are: deploying the instance of GIS application in the assigned designated container, avoiding the defects of heavy manual deployment, high deployment efficiency, and high deployment success rate, and services can be accessed through intelligent routers All GIS applications are easy and flexible to use.
进一步的,生成并保存GIS应用的镜像文件。Further, the image file of the GIS application is generated and saved.
进一步的,获取所述GIS应用的镜像文件,利用镜像文件启动虚拟机,并分配指定的资源,所述虚拟机采用容器隔离技术。Further, an image file of the GIS application is acquired, a virtual machine is started by using the image file, and specified resources are allocated, and the virtual machine adopts the container isolation technology.
由上述描述可知,虚拟机采用容器隔离技术,同一台服务器上的不同虚拟机之间的资源是相互隔离的,即一个虚拟机不能访问另一个虚拟机的资源,其中一个虚拟机的崩溃也不会影响其他虚拟机的正常运行。It can be seen from the above description that the virtual machine adopts the container isolation technology, and the resources between different virtual machines on the same server are isolated from each other, that is, one virtual machine cannot access the resources of another virtual machine, and the crash of one virtual machine will not It will affect the normal operation of other virtual machines.
进一步的,周期性地检测GIS应用的实例是否正常运行,若否,则关闭所述实例,并部署新的实例。Further, it is periodically detected whether the instance of the GIS application is running normally, if not, the instance is closed and a new instance is deployed.
由上述描述可知,对GIS应用进行周期性地检测,可以保证GIS应用正常运行。It can be seen from the above description that the periodic detection of the GIS application can ensure the normal operation of the GIS application.
进一步的,当GIS应用的性能负载过大时,增加GIS应用的实例数。Further, when the performance load of the GIS application is too large, the number of instances of the GIS application is increased.
由上述描述可知,增加GIS应用实例数可以多分配资源,减轻每一个GIS应用实例的负担。It can be seen from the above description that increasing the number of GIS application instances can allocate more resources and reduce the burden of each GIS application instance.
进一步的,当GIS应用的实例宕机时,创建新的实例。Further, when the instance of the GIS application goes down, a new instance is created.
由上述描述可知,实例宕机时创建新的实例可以保障GIS应用持续高可用地运行。It can be seen from the above description that creating a new instance when the instance is down can ensure that the GIS application continues to run with high availability.
进一步的,当升级GIS应用时,部署新的实例,所述新的实例启动成功后,关闭升级前的实例。Further, when the GIS application is upgraded, a new instance is deployed, and after the new instance is successfully started, the instance before the upgrade is closed.
由上述描述可知,可实现GIS应用不停机平滑升级,保证其随时正常运行。It can be seen from the above description that the GIS application can be smoothly upgraded without downtime to ensure its normal operation at any time.
进一步的,记录并保存GIS应用的相关日志。Further, record and save relevant logs of the GIS application.
由上述描述可知,将GIS应用的相关日志进行保存,方便后续进行调用和查询。It can be seen from the above description that the relevant logs of the GIS application are saved to facilitate subsequent calls and queries.
进一步的,在创建GIS应用的实例之前,还包括:Further, before creating an instance of the GIS application, it also includes:
对GIS应用进行注册;Register GIS applications;
识别GIS应用中的服务接口,并以协议的方式对GIS应用进行发布;Identify service interfaces in GIS applications, and publish GIS applications by protocol;
对发布的GIS应用进行测试;Test the published GIS application;
对通过测试的所述GIS应用进行审核,并发布到生产环境中。The GIS application that passes the test is reviewed and released to the production environment.
由上述描述可知,GIS应用发布到生产环境之前需要先通过测试和审核,以保证GIS应用的可靠性。As can be seen from the above description, GIS applications need to be tested and reviewed before they are released to the production environment to ensure the reliability of GIS applications.
进一步的,属于同一云平台的所有GIS应用共享云平台上的软硬件资源。Further, all GIS applications belonging to the same cloud platform share software and hardware resources on the cloud platform.
由上述描述可知,GIS应用共享软硬件资源可以提高资源利用率,降低成本。It can be seen from the above description that sharing software and hardware resources in GIS applications can improve resource utilization and reduce costs.
进一步的,所述云平台包括未注册的第一GIS应用和已注册的第二GIS应用,所述第一GIS应用可调用第二GIS应用的接口jar包。Further, the cloud platform includes an unregistered first GIS application and a registered second GIS application, and the first GIS application can call the interface jar package of the second GIS application.
由上述描述可知,其中GIS应用之间是可以相互依赖的。It can be seen from the above description that GIS applications can be interdependent.
进一步的,在对第一GIS应用进行单元测试时,为第二GIS应用接口创建远程代理对象,通过所述远程代理对象访问第二GIS应用的实例,并将结果返回给第一GIS应用。Further, when unit testing the first GIS application, a remote proxy object is created for the second GIS application interface, the instance of the second GIS application is accessed through the remote proxy object, and the result is returned to the first GIS application.
由上述描述可知,在对第一GIS应用进行部署时,第二GIS应用实例的部署并不影响其测试。As can be seen from the above description, when the first GIS application is deployed, the deployment of the second GIS application instance does not affect its testing.
进一步的,当第一GIS应用通过单元测试后,对所述第一GIS应用进行注册。Further, after the first GIS application passes the unit test, the first GIS application is registered.
一种基于PaaS的GIS应用部署系统,包括:A PaaS-based GIS application deployment system, including:
创建模块,用于创建GIS应用的实例;Create modules for creating instances of GIS applications;
申请模块,用于申请GIS应用的实例所需的硬件资源;The application module is used to apply for the hardware resources required by the instance of the GIS application;
分配模块,用于分配硬件资源;Allocation module for allocating hardware resources;
启动模块,用于启动容器;The startup module is used to start the container;
部署模块,用于镜像部署所述GIS应用的实例;a deployment module for mirroring and deploying the instance of the GIS application;
注册模块,用于将启动的实例的地址注册到智能路由器中。The registration module is used to register the address of the launched instance to the smart router.
实施例Example
请参照图1至图3,本发明的实施例一为:如图1和图2所示,一种基于PaaS的GIS应用部署方法及系统,包括如下内容:Please refer to FIG. 1 to FIG. 3, the first embodiment of the present invention is: as shown in FIG. 1 and FIG. 2, a PaaS-based GIS application deployment method and system, including the following content:
本实施例中,在对GIS应用进行部署的时候主要通过中央仓库、资源管理中心、云平台、开发框架/远程代理框架来实现。所述中央仓库主要是对GIS应用进行管理,包括站点管理、应用管理、开发商管理和租户管理等;所述资源管理中心主要是对软硬件资源进行监控,提供GIS应用实例管理、服务器监控、日志查询、应用性能分析等;所述云平台主要用于为GIS应用提供软硬件资源,提供资源的动态分配,资源隔离、智能路由、故障转移、日志收集与分析、硬件资源监控等;所述开发框架/远程代理框架,主要是为GIS应用提供技术支撑,开发框架主要是提供无侵入式编程、多协议发布服务、参数校验、服务的自动注册预发布、参数配置组件、日志组件等功能,远程代理框架提供自动生成代理、远程通讯、本地负载均衡、安全调用等功能。In this embodiment, the deployment of the GIS application is mainly implemented through a central warehouse, a resource management center, a cloud platform, and a development framework/remote agent framework. The central warehouse mainly manages GIS applications, including site management, application management, developer management and tenant management; the resource management center mainly monitors software and hardware resources, and provides GIS application instance management, server monitoring, Log query, application performance analysis, etc.; the cloud platform is mainly used to provide software and hardware resources for GIS applications, provide dynamic allocation of resources, resource isolation, intelligent routing, failover, log collection and analysis, hardware resource monitoring, etc.; The development framework/remote agent framework mainly provides technical support for GIS applications. The development framework mainly provides functions such as non-intrusive programming, multi-protocol publishing services, parameter verification, automatic registration and pre-release of services, parameter configuration components, and log components. , the remote proxy framework provides functions such as automatic proxy generation, remote communication, local load balancing, and secure invocation.
首先对GIS应用进行注册;本实施例中,当通过开发框架对GIS应用完成开发后,将GIS应用注册到中央仓库中,所述GIS应用由多个GIS服务组成,所述GIS服务主要包括接口和逻辑实现。First, the GIS application is registered; in this embodiment, after the GIS application is developed through the development framework, the GIS application is registered in the central warehouse, and the GIS application is composed of multiple GIS services, and the GIS services mainly include interfaces and logic implementation.
识别GIS应用中的服务接口,并以协议的方式对GIS应用进行发布;在启动GIS应用时,开发框架将自动识别GIS应用的服务接口,将这些服务以json、amf、avro等协议进行发布。然后对发布的GIS应用进行测试,主要是对GIS应用进行功能测试。Identify the service interfaces in the GIS application and publish the GIS application by protocol; when starting the GIS application, the development framework will automatically identify the service interface of the GIS application, and publish these services in json, amf, avro and other protocols. Then the released GIS application is tested, mainly the function test of the GIS application.
由于属于同一云平台的GIS应用共享云平台上的软硬件资源,所以GIS应用之间可以是相互依赖的,假设云平台包括未注册的第一GIS应用和已注册的第二GIS应用,所述第一GIS应用可调用第二GIS应用的接口jar包,当启动第一GIS应用进行单元测试时,远程代理框架将为第二GIS应用接口创建远程代理对象,当第一GIS应用调用第二GIS应用的接口时,远程代理对象将访问部署在云平台上的第二GIS应用的实例,并将返回结果发送给第一GIS应用,可以在本地对第一GIS应用进行单元测试,无需关心第二GIS应用的部署。第一GIS应用通过单元测试后注册到中央仓库中,然后进行上述的发布和测试。Since GIS applications belonging to the same cloud platform share software and hardware resources on the cloud platform, GIS applications can be interdependent. Suppose the cloud platform includes an unregistered first GIS application and a registered second GIS application, the The first GIS application can call the interface jar package of the second GIS application. When the first GIS application is started for unit testing, the remote proxy framework will create a remote proxy object for the second GIS application interface. When the first GIS application calls the second GIS application When the interface of the application is used, the remote proxy object will access the instance of the second GIS application deployed on the cloud platform, and send the returned result to the first GIS application. Deployment of GIS applications. After the first GIS application passes the unit test, it is registered in the central warehouse, and then the above-mentioned publishing and testing are performed.
创建GIS应用的实例,申请GIS应用的实例所需硬件资源;通过审核后,GIS应用程序会发布到生产环境中,然后需要对GIS应用进行部署,首先要为GIS应用创建实例,申请GIS应用的实例所需的硬件资源,例如CPU核数、内存数、实例数等。Create an instance of a GIS application and apply for the hardware resources required for the instance of the GIS application; after passing the review, the GIS application will be released to the production environment, and then the GIS application needs to be deployed. First, create an instance for the GIS application and apply for the GIS application Hardware resources required by the instance, such as the number of CPU cores, memory, and instances.
为GIS应用的实例分配硬件资源,启动指定数量的容器;云平台根据资源调度算法为GIS应用的实例分配足够的硬件资源,使用虚拟化技术,启动指定数量的容器。本实施例中,云平台会根据云平台上的资源使用情况,采用DRF(Dominant Resource Fairness)算法为GIS应用在云平台上分配资源。DRF算法是一种针对不同资源类型的max-min fairness算法。这种算法会最大化云平台上的GIS应用收到最小分配。这样每台服务器上面可以部署不同的GIS应用,充分利用服务器资源。GIS云平台还支持其他多种资源分配策略。例如唯一分配策略,每台服务器有且只能部署一个GIS应用;集群分配策略,云平台可以将GIS应用分配到具有共同属性值的服务器上面,比如,GIS应用需要特殊的服务器作为支撑,那么可以为这些服务器打上特殊的标签属性,使GIS应用在部署的时候可以部署到这些特殊的服务器上;分组策略,云平台可以把GIS应用分配到不同的组的服务器上,以达到高可用的目标,比如,将同一机架上面的服务器做为一个组,那么GIS云平台将GIS应用分别部署到不同的机架上,保证一个机架停电,不会影响GIS应用的正常运行。云平台提供资源的统一调度,可以较好地解决液位高峰期时服务器资源紧张,在其他时间服务器资源被浪费的情况。例如,当业务高峰期来临时,可以将测试环境的资源和一些非重要业务应用的部分资源释放出来,分配给关键业务应用;当业务高峰期过后,再将所述资源从关键业务应用中释放出来。Allocate hardware resources to instances of GIS applications and start a specified number of containers; the cloud platform allocates enough hardware resources to instances of GIS applications according to resource scheduling algorithms, and uses virtualization technology to start a specified number of containers. In this embodiment, the cloud platform will use the DRF (Dominant Resource Fairness) algorithm to allocate resources for the GIS application on the cloud platform according to the resource usage on the cloud platform. The DRF algorithm is a max-min fairness algorithm for different resource types. This algorithm maximizes the minimum allocation received by GIS applications on the cloud platform. In this way, different GIS applications can be deployed on each server to make full use of server resources. The GIS cloud platform also supports various other resource allocation strategies. For example, in the unique allocation strategy, each server has and can only deploy one GIS application; in the cluster allocation strategy, the cloud platform can allocate GIS applications to servers with common attribute values. For example, GIS applications need special servers as support, then you can Mark these servers with special label attributes, so that GIS applications can be deployed on these special servers during deployment; grouping strategy, the cloud platform can assign GIS applications to different groups of servers to achieve high availability. For example, if the servers on the same rack are regarded as a group, the GIS cloud platform will deploy the GIS applications to different racks respectively to ensure that the power failure of one rack will not affect the normal operation of the GIS applications. The cloud platform provides unified scheduling of resources, which can better solve the situation that server resources are tight during the peak period of liquid level, and server resources are wasted at other times. For example, when the business peak period comes, the resources of the test environment and some resources of some non-important business applications can be released and allocated to key business applications; when the business peak period is over, the resources can be released from the key business applications. come out.
在所述容器自动镜像部署所述GIS应用的实例,然后将启动的GIS应用的实例的地址注册到智能路由器中。本实施例中,云平台将启动的所述GIS应用的实例注册到智能路由器中,业务用户通过智能路由器就可以访问运行在云平台上的GIS应用。智能路由器根据业务用户的请求URL,将请求分发到正确的GIS应用实例上,智能路由器会根据GIS应用指定的策略在所述GIS应用的实例之间实行负载均衡策略,所述负载均衡策略包括:轮询策略、iphash策略和cookie策略等。The instance of the GIS application is automatically mirrored and deployed in the container, and then the address of the instance of the GIS application that is started is registered in the intelligent router. In this embodiment, the cloud platform registers the activated instance of the GIS application in the intelligent router, and the business user can access the GIS application running on the cloud platform through the intelligent router. The intelligent router distributes the request to the correct GIS application instance according to the request URL of the business user, and the intelligent router implements a load balancing strategy among the instances of the GIS application according to the strategy specified by the GIS application, and the load balancing strategy includes: Polling strategy, iphash strategy and cookie strategy, etc.
本实施例中,GIS应用部署包会上传至云平台,云平台使用镜像模板文件自动生成GIS应用的镜像文件,并将所述镜像文件存放到镜像仓库中,并在云平台数据库中进行注册。In this embodiment, the GIS application deployment package is uploaded to the cloud platform, and the cloud platform uses the image template file to automatically generate the image file of the GIS application, stores the image file in the image warehouse, and registers it in the cloud platform database.
服务器可以从镜像仓库中拉去GIS应用的镜像文件,使用镜像文件启动虚拟机,并分配指定的资源。本实施例中,虚拟机采用容器隔离技术,同一台服务器上的不同虚拟机之间的资源是相互隔离的,即其中一个虚拟机不能访问另一个虚拟机中的资源,一个虚拟机的崩溃也不会影响其他虚拟机的正常运行。The server can pull the image file of the GIS application from the image warehouse, use the image file to start the virtual machine, and allocate the specified resources. In this embodiment, the virtual machine adopts the container isolation technology, and the resources between different virtual machines on the same server are isolated from each other, that is, one virtual machine cannot access the resources in the other virtual machine, and the crash of one virtual machine will also It will not affect the normal operation of other virtual machines.
周期性地检测GIS应用的实例是否正常运行,若否,则关闭所述实例,并部署新的实例。本实施例中云平台使用探针技术周期性地检测部署的GIS应用的实例是否正常运行,当部署新的实例后,重新为其分配资源。Periodically detect whether the instance of the GIS application is running normally, if not, close the instance and deploy a new instance. In this embodiment, the cloud platform uses the probe technology to periodically detect whether the deployed instance of the GIS application is running normally, and when a new instance is deployed, resources are allocated to it again.
当GIS应用的性能负载过大时,增加GIS应用的实例数。增加了新的实例后,云平台会根据资源分配策略,为新的实例分配新的资源。When the performance load of the GIS application is too large, increase the number of instances of the GIS application. After a new instance is added, the cloud platform will allocate new resources to the new instance according to the resource allocation policy.
当GIS应用的实例宕机时,创建新的实例,可以保证GIS应用持续高可用地运行。When an instance of a GIS application goes down, creating a new instance can ensure that the GIS application continues to run with high availability.
当升级GIS应用时,部署新的实例,所述新的实例启动成功后,关闭升级前的实例。当GIS应用进行版本升级时,云平台可以实现GIS应用不停机平滑升级,在切换GIS应用的版本时,云平台为新版本的GIS应用部署新的实例,当实例部署成功后,云平台会将GIS应用旧版本的应用实例逐一关闭。When the GIS application is upgraded, a new instance is deployed, and after the new instance is successfully started, the instance before the upgrade is closed. When the GIS application is upgraded, the cloud platform can realize the smooth upgrade of the GIS application without downtime. When the version of the GIS application is switched, the cloud platform deploys a new instance for the new version of the GIS application. After the instance is successfully deployed, the cloud platform will The application instances of the old version of the GIS application are closed one by one.
记录并保存GIS应用的相关日志。云平台还记录和保存GIS应用相关的海量日志,运行GIS应用时,运行框架提供日志组件,当业务调用GIS应用上发布的服务时,运行框架拦截服务请求,读取请求的RequestId(服务请求ID)参数,如果RequestId为空,那么运行框架生成RequestId,并使用RequestId创建请求调用上下文。Record and save relevant logs of GIS applications. The cloud platform also records and saves massive logs related to GIS applications. When running a GIS application, the running framework provides a log component. When a business calls a service published on a GIS application, the running framework intercepts the service request and reads the RequestId (service request ID) of the request. ) parameter, if the RequestId is empty, the runtime framework generates the RequestId and uses the RequestId to create the request invocation context.
运行框架使用容器名、应用名、应用版本号、应用实例名初始化请求调用上下文时,把请求调用上下文保存到线程变量中,生成ServiceId(服务调用ID),使用ServiceId创建服务调用上下文,然后从服务请求上下文的服务调用上下文的栈中读出栈中第一个服务调用上下文,使用该服务调用上下文的ServiceId设置当前的服务调用上下文的referenceServiceId(调用当前服务的服务调用的ServiceId),把当前服务调用的上下文压入服务请求上下文的服务调用上下文的栈中When the running framework uses the container name, application name, application version number, and application instance name to initialize the request invocation context, save the request invocation context to the thread variable, generate the ServiceId (service invocation ID), use the ServiceId to create the service invocation context, and then use the ServiceId to create the service invocation context. Read the first service invocation context in the stack of the service invocation context of the request context, use the ServiceId of the service invocation context to set the referenceServiceId of the current service invocation context (the ServiceId of the service invocation of the current service), and call the current service The context of the service request context is pushed onto the stack of the service invocation context of the service request context
运行框架使用服务分组、服务、服务方法、服务开始时间初始化当前服务调用上下文时,首先调用服务逻辑代码,从请求服务上下文的服务调用上下文的栈中弹出第一个服务调用请求上下文,设置服务调用上下文的服务结束时间。When the running framework initializes the current service call context with service group, service, service method, and service start time, it first calls the service logic code, pops the first service call request context from the stack of the service call context requesting the service context, and sets the service call The service end time for the context.
本实施例中,运行框架使用日志组件服务请求上下文和服务调用上下文的内容写入系统日志中,日志内容包括:日志时间、容器名、应用名,应用版本号、应用实例名、所属系统、日志等级、日志类型、请求ID(RequestId)、当前服务调用ID(serviceId),、调用当前服务的服务调用ID(referenceServiceId)、服务分组、服务、服务方法、服务开始时间、服务结束时间、错误代码和信息等。其中日志类型为性能日志,日志组件将日志写入到日志收集器中,然后日志收集器将日志发送到分布式的存储系统中。In this embodiment, the running framework uses the content of the log component service request context and service call context to be written into the system log, and the log content includes: log time, container name, application name, application version number, application instance name, system to which it belongs, and log content. Level, log type, request ID (RequestId), current service call ID (serviceId), service call ID (referenceServiceId) calling the current service, service group, service, service method, service start time, service end time, error code and information, etc. The log type is performance log, the log component writes the log to the log collector, and then the log collector sends the log to the distributed storage system.
客户端查询日志时,首先使用查询应用实时日志获取日志游标,然后循环使用游标滚动查询应用日志。本实施例中,所述游标的格式为:RSA(<queryTime>|<taskId>|<timeout>|<pageSize>|<logTime>|<logId>)queryTime表示查询实时应用日志的时间,精确到毫秒;taskId为容器名(marathon的任务id)timeout为游标超时时间,如果queryTime+timeout<当前时间,那么游标失效;pageSize表示返回最大日志数;logTime表示最后一条日志的时间,精确到毫秒;logId表示最后一条日志的id。When the client queries logs, first use the real-time log of the query application to obtain the log cursor, and then use the cursor to scroll through the query application log. In this embodiment, the format of the cursor is: RSA(<queryTime>|<taskId>|<timeout>|<pageSize>|<logTime>|<logId>) queryTime indicates the time for querying the real-time application log, accurate to milliseconds ; taskId is the container name (task id of marathon) timeout is the cursor timeout time, if queryTime+timeout < current time, then the cursor is invalid; pageSize indicates the maximum number of logs returned; logTime indicates the time of the last log, accurate to milliseconds; logId indicates The id of the last log.
查询应用实时日志接口时,将queryTime和logTime设置为当前服务器时间,logId为空;滚动查询应用实时日志接口时,使用queryTime和timeout判断是否游标是否超时,如果超时,那么返回超时错误;如果logId为空,查询大于等于logTime的日志,查询日志条数为pageSize,然后执行第5步;如果logId不为空,查询大于等于logTime的日志,查询日志条数为2*pageSzie;查找日志中是否包含logId,如果不存在,那么返回前pageSize条数的日志,如果存在,那么返回logId之后的pageSize条数的日志。When querying the real-time log interface, set queryTime and logTime to the current server time, and logId is empty; when scrolling querying the real-time log interface, use queryTime and timeout to determine whether the cursor has timed out. If it times out, return a timeout error; if logId is Empty, query logs greater than or equal to logTime, the number of query logs is pageSize, and then go to
若要生成新的游标,那么设置queryTime为服务器当前时间,logTime为最后一条日志的时间,logId为最后一条日志的id。To generate a new cursor, set queryTime to the current server time, logTime to the time of the last log, and logId to the id of the last log.
请求调用链分析方法是:获取一次服务请求的RequestId;查询所有这个RequestId的性能日志,并以ServiceId为key将日志存储在Map对象中;循环Map所有的日志,读取日志的referenceServiceId;如果referenceServiceId为空,那么将该日志的ServiceId保存在FirstId变量中,如果referenceServiceId不为空,那么使用referenceServiceId在Map对象中找到对应的调用日志,然后将该日志加入到调用日志对象的调用列表ServiceIds中;使用FirstId获取调用日志对象,遍历ServiceIds调用列表深度优先遍历调用日志,并生成xml文件;客户端解析xml文件以树形的方式展示服务的调用关系。The request call chain analysis method is: obtain the RequestId of a service request; query all performance logs of this RequestId, and store the logs in the Map object with ServiceId as the key; loop through all the logs of the Map, and read the referenceServiceId of the log; if the referenceServiceId is If it is empty, then save the ServiceId of the log in the FirstId variable. If the referenceServiceId is not empty, use the referenceServiceId to find the corresponding call log in the Map object, and then add the log to the call list ServiceIds of the call log object; use FirstId Obtain the call log object, traverse the ServiceIds call list depth-first traverse the call log, and generate an xml file; the client parses the xml file to display the calling relationship of the service in a tree-like manner.
本实施例中,研发、测试、运维、业务用户可以共享云平台上的GIS应用,使异地协作开发应用成为可能;并且研发、测试和生产为同一云平台环境,降低了GIS应用的部署难度,提高了部署成功率,并且避免了繁重的手工部署的缺陷,实现了GIS应用的灵活、快速部署。In this embodiment, R&D, testing, operation and maintenance, and business users can share GIS applications on the cloud platform, making it possible to develop applications in collaboration in different places; and R&D, testing, and production are in the same cloud platform environment, which reduces the difficulty of deploying GIS applications , which improves the success rate of deployment, avoids the defects of heavy manual deployment, and realizes flexible and rapid deployment of GIS applications.
如图3所示,与上述的GIS应用部署方法相对应,本实施例还涉及一种基于PaaS的GIS应用部署系统,包括:As shown in Figure 3, corresponding to the above-mentioned GIS application deployment method, the present embodiment also relates to a PaaS-based GIS application deployment system, including:
创建模块1,用于创建GIS应用的实例,一个GIS应用可创建多个实例,可根据需要进行选择;
申请模块2,用于申请GIS应用的实例所需的硬件资源,每一个实例都需要足够的资源空间;The
分配模块3,用于分配硬件资源,本实施例中,云平台统一调度分配GIS应用所需要的资源;The
启动模块4,用于启动容器,启动容器的数量按指定的数量进行;The
部署模块5,用于镜像部署所述GIS应用的实例;
注册模块6,用于将启动的实例的地址注册到智能路由器中。The
综上所述,本发明提供的一种基于PaaS的GIS应用部署方法及系统,在分配的指定容器中部署GIS应用的实例,避免了繁重的手工部署的缺陷,部署效率高,并且部署成功率高,业务通过智能路由器便可访问所有的GIS应用,使用方便灵活;GIS应用共享软硬件资源可以提高资源利用率,降低成本;研发、测试、运维、业务用户可以共享云平台上的GIS应用,使异地协作开发应用成为可能。To sum up, the present invention provides a PaaS-based GIS application deployment method and system, which deploys GIS application instances in assigned designated containers, avoids the defects of heavy manual deployment, has high deployment efficiency, and has a high deployment success rate. High, business can access all GIS applications through intelligent routers, which is convenient and flexible to use; GIS applications share software and hardware resources to improve resource utilization and reduce costs; R&D, testing, operation and maintenance, and business users can share GIS applications on the cloud platform , making it possible to develop applications collaboratively in different places.
以上所述仅为本发明的实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等同变换,或直接或间接运用在相关的技术领域,均同理包括在本发明的专利保护范围内。The above descriptions are only examples of the present invention, and are not intended to limit the scope of the patent of the present invention. Any equivalent transformations made by using the contents of the description and drawings of the present invention, or directly or indirectly applied in related technical fields, are similarly included in the within the scope of patent protection of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710004696.9ACN106843945B (en) | 2017-01-04 | 2017-01-04 | PaaS-based GIS application deployment method and system |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710004696.9ACN106843945B (en) | 2017-01-04 | 2017-01-04 | PaaS-based GIS application deployment method and system |
| Publication Number | Publication Date |
|---|---|
| CN106843945A CN106843945A (en) | 2017-06-13 |
| CN106843945Btrue CN106843945B (en) | 2020-12-01 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201710004696.9AActiveCN106843945B (en) | 2017-01-04 | 2017-01-04 | PaaS-based GIS application deployment method and system |
| Country | Link |
|---|---|
| CN (1) | CN106843945B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107766050B (en)* | 2017-10-31 | 2021-12-07 | 新华三云计算技术有限公司 | Heterogeneous application deployment method and device |
| CN107766569A (en)* | 2017-11-10 | 2018-03-06 | 泰瑞数创科技(北京)有限公司 | GIS management methods and system based on cloud platform |
| CN108319482B (en)* | 2018-02-11 | 2021-07-06 | 北京恒华伟业科技股份有限公司 | JavaWeb module management method and device |
| WO2019227313A1 (en)* | 2018-05-29 | 2019-12-05 | Nokia Shanghai Bell Co., Ltd. | Method, apparatus and computer readable media for policy distribution |
| CN109445802B (en)* | 2018-09-25 | 2022-08-26 | 众安信息技术服务有限公司 | Privatized Paas platform based on container and method for publishing application thereof |
| CN109725920B (en)* | 2018-12-29 | 2022-05-06 | 咪咕文化科技有限公司 | Service instance updating method and device and storage medium |
| CN112084040B (en)* | 2020-09-28 | 2021-07-20 | 上海道客网络科技有限公司 | Container resource planning system and method based on application mirror image data identification |
| CN113765983B (en)* | 2021-01-04 | 2024-09-24 | 北京沃东天骏信息技术有限公司 | Site service deployment method and device |
| CN115550210B (en)* | 2022-09-27 | 2025-02-25 | 中国联合网络通信集团有限公司 | Cloud network service performance detection method, device, equipment and storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101803328A (en)* | 2007-09-13 | 2010-08-11 | 空中客车运作股份公司 | The ACARS router that is used for long-range aviation electronics application program |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105867955A (en)* | 2015-09-18 | 2016-08-17 | 乐视云计算有限公司 | Deployment system and deployment method of application program |
| CN105468362B (en)* | 2015-11-17 | 2019-03-08 | 广州杰赛科技股份有限公司 | Application deployment method and cloud computing system |
| CN106020930B (en)* | 2016-05-13 | 2019-07-23 | 深圳市中润四方信息技术有限公司 | A kind of application management method and system based on application container |
| CN106202429A (en)* | 2016-07-13 | 2016-12-07 | 武大吉奥信息技术有限公司 | GIS cloud service based on mixing container with virtualized host provides method and device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101803328A (en)* | 2007-09-13 | 2010-08-11 | 空中客车运作股份公司 | The ACARS router that is used for long-range aviation electronics application program |
| Title |
|---|
| "基于开源PaaS技术的互联网业务平台自动部署方案";何震苇等;《电信科学》;20151031(第10期);第2015259-1至2015259-8页* |
| Publication number | Publication date |
|---|---|
| CN106843945A (en) | 2017-06-13 |
| Publication | Publication Date | Title |
|---|---|---|
| CN106843945B (en) | PaaS-based GIS application deployment method and system | |
| US11307890B2 (en) | Methods and apparatus to manage virtual machines | |
| CN107689953B (en) | A container security monitoring method and system for multi-tenant cloud computing | |
| AU2014311782B2 (en) | Scalable distributed storage architecture | |
| US11467874B2 (en) | System and method for resource management | |
| US9535754B1 (en) | Dynamic provisioning of computing resources | |
| US10860385B2 (en) | Method and system for allocating and migrating workloads across an information technology environment based on persistent memory availability | |
| CN104917815A (en) | Heterogeneous cloud isolation system and method for in-cloud GIS service computing | |
| CN109347716B (en) | Instantiation method and device of consumer VNF | |
| WO2021208844A1 (en) | Virtualized container management method and system, and storage medium | |
| CN107301088A (en) | A kind of method and apparatus for managing virtual machine batch migration | |
| CN111666034A (en) | Container cluster disk management method and device | |
| CN114489985A (en) | Data processing method, device and storage medium | |
| CN113934525A (en) | Hadoop cluster task scheduling method based on positive and negative feedback load scheduling algorithm | |
| US20110023018A1 (en) | Software platform and method of managing application individuals in the software platform | |
| CN109343935A (en) | Instantiation method and apparatus for consumer VNF | |
| CN120066949B (en) | Compatibility testing methods, related devices and media | |
| CN112395076A (en) | Network data processing method, equipment and storage medium | |
| CN116028217B (en) | Method, device and electronic device for determining optimal path for data reading | |
| Nikitas | Development of large-scale big data system with state management on serverless cloud architectures | |
| CN111126936A (en) | Cloud model architecture for power system emergency analysis | |
| CN114579317A (en) | Model testing method and system | |
| CN118487943A (en) | IT resource automatic discovery and cloud loading method and device | |
| CN118377682A (en) | Method, device and system for monitoring resource configuration and readable storage medium | |
| CN120540834A (en) | Cloud application management method, device and computer program product |
| 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 |