CN108600282A - Micro services dissemination method, device, storage medium and computer equipment - Google Patents

Micro services dissemination method, device, storage medium and computer equipment Download PDF

Info

Publication number
CN108600282A
CN108600282A CN201711240906.0A CN201711240906A CN108600282A CN 108600282 A CN108600282 A CN 108600282A CN 201711240906 A CN201711240906 A CN 201711240906A CN 108600282 A CN108600282 A CN 108600282A
Authority
CN
China
Prior art keywords
port
micro services
configuration
information
file
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.)
Withdrawn
Application number
CN201711240906.0A
Other languages
Chinese (zh)
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.)
Shenzhen Dingfeng Cattle Technology Co Ltd
Original Assignee
Shenzhen Dingfeng Cattle Technology Co Ltd
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 Shenzhen Dingfeng Cattle Technology Co Ltd filed Critical Shenzhen Dingfeng Cattle Technology Co Ltd
Priority to CN201711240906.0A priority Critical patent/CN108600282A/en
Publication of CN108600282A publication Critical patent/CN108600282A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The present invention relates to a kind of micro services dissemination method, device, storage medium and computer equipments.It is the port information that micro services are distributed in the planning information table of port according to micro services posting request, allocated port information is marked in the planning information table of port.The mirror image built in advance for micro services is obtained according to micro services posting request, includes configuration port template file in mirror image.By the port information distributed for micro services and be micro services structure mirror image in configuration port template file be sent on corresponding server, to generate the configuration file of micro services according to port information and configuration port template file, micro services are issued according to configuration file.It uses port planning information table and has carried out unified management to port, avoid port arbitrarily use and caused by it is chaotic, allocated port information is marked simultaneously, duplicate allocation when distributing port for service next time is avoided, to ensure that the normal publication of micro services.

Description

Micro services dissemination method, device, storage medium and computer equipment
Technical field
The present invention relates to Internet technical field, more particularly to a kind of micro services dissemination method, device, storage medium and Computer equipment.
Background technology
Micro services are a kind of one group of mutually matched services by constructed by large-scale, complicated, long-term running application program. With the process of product micro services, originally a single service, several or dozens of component may be split into.Due to micro- The framework of service derives from the network architecture, therefore micro services component all externally provides service by HTTP or RPC agreements substantially, i.e., Each micro services component is required for occupying one or more ports when starting operation.This makes micro services in the framework Under pattern, the management of port is extremely complex.The use of different port duplicate allocation or port often occur, arbitrarily use causes to lead The problems such as machine resource management is chaotic.
Invention content
Based on this, it is necessary in view of the above technical problems, provide it is a kind of effectively port assignment can be managed it is micro- Service issuing method, device, storage medium and computer equipment.
A kind of micro services dissemination method, the method includes:
It is the port information that the micro services are distributed in the planning information table of port according to micro services posting request;
Allocated port information is marked in the port planning information table;
The mirror image built in advance for the micro services is obtained according to the micro services posting request, includes to match in the mirror image Set port template file;
By the port information distributed for the micro services and be micro services structure mirror image in configuration port template File is sent on corresponding server, with described in being generated according to the port information and configuration port template file in incognito The configuration file of business;
The micro services are issued according to the configuration file.
It is in one of the embodiments, that micro services distribute port planning information table according to micro services posting request described In port information before, including:
Unappropriated port information is planned;
By port planning information table described in the port information typing after planning.
In one of the embodiments, described in the port planning information table to the allocated port information After being marked, including:
The allocated port information of the label is deleted from the port planning information table.
The position of port information is configured with placeholder in the configuration port template file in one of the embodiments, Form is replaced;
It is described by the port information distributed for the micro services and be micro services structure mirror image in configuration port Template file is sent on corresponding server, described in being generated according to the port information and configuration port template file The configuration file of micro services, including:
The port information of the micro services and configuration port template file are sent on corresponding server;
Placeholder in the configuration port template file is replaced with to the port information of the micro services on the server, Generate the configuration file of the micro services.
It is described in one of the embodiments, on the server to replace the placeholder in the configuration port template file For the port information of the micro services, the configuration file of the micro services is generated, including:
It is using Dockerize tools that configuration port template is literary in the Docker containers on the server Placeholder in part replaces with the port information of the micro services, generates the configuration file of the micro services.
It is in one of the embodiments, the micro services structure in advance in described obtained according to the micro services posting request Before the mirror image built, including:
Project build request is initiated to project build center, so that the project build center obtains configuration port template text The configuration port template file is configured to the mirror of the micro services by part together with the software package needed for micro services publication Picture.
A kind of micro services distributing device, described device include:
Port information distribution module, for being that the micro services distribute port planning information table according to micro services posting request In port information;
Port information mark module, in the port planning information table to allocated port information into rower Note;
Mirror image acquisition module, for being obtained in advance as the mirror of micro services structure according to the micro services posting request Picture includes configuration port template file in the mirror image;
Configuration file generation module, for will be the port information of the micro services distribution and be what the micro services were built Configuration port template file in mirror image is sent on corresponding server, with according to the port information and the configuration port Template file generates the configuration file of the micro services;
Release module, for being issued the micro services according to the configuration file.
Described device further includes in one of the embodiments,:
Port information planning module, for planning unappropriated port information;
Port planning information table generation module, for port planning information table described in the port information typing after planning. A kind of computer readable storage medium, is stored thereon with computer program, which realizes following steps when being executed by processor:
It is the port information that the micro services are distributed in the planning information table of port according to micro services posting request;
Allocated port information is marked in the port planning information table;
The mirror image built in advance for the micro services is obtained according to the micro services posting request, includes to match in the mirror image Set port template file;
By the port information distributed for the micro services and be micro services structure mirror image in configuration port template File is sent on corresponding server, with described in being generated according to the port information and configuration port template file in incognito The configuration file of business;
The micro services are issued according to the configuration file.
A kind of computer equipment, the computer equipment include memory, processor and are stored on the memory simultaneously The computer program that can be run on the processor, the processor realize following steps when executing the computer program:
It is the port information that the micro services are distributed in the planning information table of port according to micro services posting request;
Allocated port information is marked in the port planning information table;
The mirror image built in advance for the micro services is obtained according to the micro services posting request, includes to match in the mirror image Set port template file;
By the port information distributed for the micro services and be micro services structure mirror image in configuration port template File is sent on corresponding server, with described in being generated according to the port information and configuration port template file in incognito The configuration file of business;
The micro services are issued according to the configuration file.
Above-mentioned micro services dissemination method, device, storage medium and computer equipment are in incognito according to micro services posting request Port information in business distribution port planning information table, to allocated port information into rower in the planning information table of port Note.The mirror image built in advance for micro services is obtained according to micro services posting request, includes configuration port template file in mirror image.It will For micro services distribution port information and be micro services structure mirror image in configuration port template file be sent to corresponding clothes It is engaged on device, it, will be micro- according to configuration file to generate the configuration file of micro services according to port information and configuration port template file Service is issued.Use port planning information table and carried out unified management to port, avoid port arbitrarily use and Caused by it is chaotic, while allocated port information being marked, avoids next time to be repeated when service distribution port Distribution.The configuration text carried out needed for micro services publication is generated with configuration port template file further according to the port information of micro services Part, to ensure that the normal publication of micro services.
Description of the drawings
Fig. 1 is the applied environment figure of micro services dissemination method in one embodiment;
Fig. 2 is the internal structure chart of server in one embodiment;
Fig. 3 is the flow chart of micro services dissemination method in one embodiment;
Fig. 4 is the flow chart of micro services dissemination method in another embodiment;
Fig. 5 is the surface chart of the configuration management page at platform courses center;
Fig. 6 is the flow chart for the configuration file method that micro services are generated in Fig. 3;
Fig. 7 is the hardware architecture diagram of micro services dissemination method in one embodiment;
Fig. 8 is the structural schematic diagram of micro services distributing device in one embodiment;
Fig. 9 is the structural schematic diagram of micro services distributing device in another embodiment;
Figure 10 is the structural schematic diagram of micro services distributing device in further embodiment;
Figure 11 is the structural schematic diagram of configuration file generation module in Fig. 8;
Figure 12 is the structural schematic diagram of micro services distributing device in one embodiment.
Specific implementation mode
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, below in conjunction with the accompanying drawings to the present invention Specific implementation mode be described in detail.Many details are elaborated in the following description in order to fully understand this hair It is bright.But the invention can be embodied in many other ways as described herein, those skilled in the art can be not Similar improvement is done in the case of violating intension of the present invention, therefore the present invention is not limited to the specific embodiments disclosed below.
Unless otherwise defined, all of technologies and scientific terms used here by the article and belong to the technical field of the present invention The normally understood meaning of technical staff is identical.Used term is intended merely to description tool in the description of the invention herein The purpose of the embodiment of body, it is not intended that in the limitation present invention.Each technical characteristic of above example can carry out arbitrary group It closes, to keep description succinct, combination not all possible to each technical characteristic in above-described embodiment is all described, however, As long as contradiction is not present in the combination of these technical characteristics, it is all considered to be the range of this specification record.
Fig. 1 is a kind of applied environment figure of the dissemination method of micro services in one embodiment.As shown in Figure 1, this applies ring Border includes terminal 102, Platform Server 104 and server cluster 104.Wherein, terminal 102 can be tablet computer, notebook The terminals such as computer, desktop computer.Terminal 102 and Platform Server 104 pass through network connection, Platform Server 104 and service Device cluster 106 passes through network connection.Platform Server 104 receives the micro services posting request that terminal 102 is sent, Platform Server 104 according to the port information that micro services posting request is that micro services are distributed in the planning information table of port, in port planning information table In allocated port information is marked.It is micro services in advance that Platform Server 104 is obtained according to micro services posting request The mirror image of structure includes configuration port template file in mirror image.Platform Server 104 by the port information distributed for micro services and It is sent on corresponding server cluster 106 for the configuration port template file in the mirror image of micro services structure, with according to port Information and configuration port template file generate the configuration file of micro services, are issued micro services according to configuration file.
In one embodiment, as shown in Fig. 2, additionally providing a kind of server, which includes passing through system bus Processor, non-volatile memory medium, built-in storage, network interface of connection etc..Wherein, the non-volatile memories of the server It is stored with operating system in medium, can also be stored with computer program, when which is executed by processor, may make place It manages device and executes a kind of micro services dissemination method.The processor of the server supports entire clothes for improving calculating and control ability The operation of business device.Computer program can be stored in the built-in storage of the server, when which is executed by processor, The processor may make to execute a kind of micro services dissemination method.Network interface is used to carry out network communication with terminal, receives or sends out Data are sent, such as receive the request for the micro services publication that terminal is sent, and by the port information of micro services and configure port mould It is first-class that plate file is sent to server cluster.It will be understood by those skilled in the art that structure shown in Figure 2, only with this The block diagram of the relevant part-structure of application scheme, does not constitute the restriction for the server being applied thereon to application scheme, Specific server may include either combining certain components or with difference than more or fewer components as shown in the figure Component arrangement.
In one embodiment, as shown in figure 3, providing a kind of micro services dissemination method, it is applied in Fig. 1 in this way Platform Server for illustrate, including:
Step 302, it is the port information in micro services distribution port planning information table according to micro services posting request.
Platform Server includes many multiple functions of servers realization, such as including platform courses center, configuration management The corresponding servers such as database, Template Manager center, project build center, mirror image warehouse, control centre, it is jointly micro- to realize Service publication.
Before carrying out micro services publication, the platform courses center in Platform Server carries out unappropriated port information Planning, by the port information typing port planning information table after planning.It can specifically, being picked out from unappropriated port information To carry out the range for the port address that micro services publication uses.The port numbers of server end be it is fixed (as long as server opens, Corresponding service is just run always), correspond between well-known 1-1023 in port numbers General System, these well-known port numbers It is managed by Internet distributor gears (Internet Assigned Numbers Authority, IANA).And client Port numbers only have user open corresponding program when just open corresponding port numbers (therefore also referred to as transient port number), most of To the port numbers between transient port number distribution 1024~5000.Port numbers more than 5000 are reserved for other services (service being of little use on internet).In the present embodiment, the unallocated end generally from port address between 8000-10000 In port address distribute a port section, by the port information typing in this segment port to configuration management database (CMDB, Configuration Management Database) in, form port planning information table.For example, in the planning information table of port The information of typing is needed to have:The corresponding Business Name of micro services, affiliated environment (exploitation, test, pre- publication, production etc.), starting Port address (such as 8000) terminates port address (8200).
Terminal sends micro services posting request to Platform Server, and the platform courses center in Platform Server receives in incognito Business posting request, and port planning information table is got from CMDB according to micro services posting request, distribute port for micro services Port information in planning information table.And the port information of distribution is returned into CMDB, the allocated port letter that CMDB is received After breath, allocated port information can be stored in service profile information table, the information being stored in service profile information table has: Business Name, service arrangement environment, service name, configuration attribute, profile name, configuration item title, configuration item content, clothes Be engaged in version number.
Step 304, allocated port information is marked in the planning information table of port.
After being assigned with port information for micro services, the port information of distribution is returned to CMDB by platform courses center, The allocated port information that CMDB is received.Because allocated port information cannot repeat distribution, need in port Allocated port information is marked in planning information table, to avoid duplicate allocation.The mode of label can be to have divided The port information matched is provided with label, and label has indicated that the port information has distributed, cannot be allocated use again.Or Person, label can also be by the way of locking allocated port information and being allowed to be assigned.
Step 306, the mirror image built in advance for micro services is obtained according to micro services posting request, includes configuration end in mirror image Mouth template file.
After being assigned with port information for micro services, the control centre of Platform Server is obtained according to micro services posting request The mirror image built in advance for micro services is taken, includes configuration port template file in mirror image.Mirror image is a kind of file layout, can Many files are made a mirror image.There are an identical pairs on another disk for data on one disk This, this copy is mirror image, wherein mirror image can be Docker mirror images.
Step 308, by the port information distributed for micro services and be micro services structure mirror image in configuration port template File is sent on corresponding server, to generate the configuration text of micro services according to port information and configuration port template file Part.
The control centre of Platform Server is retrieved as the port of micro services distribution from the service profile information table in CMDB Information, and obtain in advance as the mirror image of micro services structure.It is the port information and be micro services structure that micro services are distributed by acquisition The mirror image built is sent on the server in corresponding server cluster so that generates the configuration text of micro services on the server Part.
Step 310, micro services are issued according to configuration file.
According to the configuration file of generation, micro services are issued.The configuration file of micro services includes:Configuration item title and Configuration item content etc..
It is the port information that micro services are distributed in the planning information table of port according to micro services posting request in the present embodiment, Allocated port information is marked in the planning information table of port.It is obtained in advance as in incognito according to micro services posting request It is engaged in the mirror image of structure, configuration port template file is included in mirror image.By the port information distributed for micro services and it is micro services structure Configuration port template file in the mirror image built is sent on corresponding server, with according to port information and configuration port template The configuration file of file generated micro services issues micro services according to configuration file.Use port planning information table pair Port has carried out unified management, avoid port arbitrarily use and caused by it is chaotic, while by allocated port information into Line flag avoids duplicate allocation when distributing port for service next time.Port information further according to micro services and configuration end Mouth template file generated carries out the configuration file needed for micro services publication, to ensure that the normal publication of micro services.
In one embodiment, it is being that micro services distribute the port in the planning information table of port according to micro services posting request Before information, including:Unappropriated port information is planned;By the port information typing port planning information after planning Table.
It is being platform clothes before micro services distribute the port information in the planning information table of port according to micro services posting request Unappropriated port information is planned at platform courses center in business device, and the port information typing port after planning is planned Information table.Specifically, picking out the model that can carry out the port address that micro services publication uses from unappropriated port information It encloses.The port numbers of server end are fixed (as long as server opens, corresponding service are run always), and port numbers are general Correspond between well-known 1-1023 in system, these well-known port numbers are by Internet distributor gears (Internet Assigned Numbers Authority, IANA) it manages.And the port numbers of client only have user to open corresponding program When just open corresponding port numbers (therefore also referred to as transient port number), it is most of between transient port number distribution 1024~5000 Port numbers.Port numbers more than 5000 are to reserve (service being of little use on internet) for other services.The present embodiment In, a port section is distributed in the unallocated port address generally from port address between 8000-10000, by this port In port information typing to configuration management database (CMDB, Configuration Management Database) in section, Form port planning information table.For example, needing the information of typing to have in the planning information table of port:The corresponding company name of micro services Claim, affiliated environment (exploitation, test, pre- publication, production etc.), origin port address (such as 8000) terminates port address (8200).
In the present embodiment, before carrying out micro services publication, the port that can be distributed to micro services is planned.Tool Body, a port range is first distributed, these are first in all typing port planning information tables of the port information in port range In, and port planning information table is stored in configuration management database CMDB, conveniently read and write.When micro- to one every time When service is issued, from the planning information table of port obtaining unappropriated port is allocated, and is uniformly managed in this way, Port assignment is very orderly, and efficiency is higher.
In one embodiment, as shown in figure 4, in the planning information table of port to allocated port information into rower After note, including:
Step 305, the allocated port information of label is deleted from the planning information table of port.
The port information of distribution is returned to CMDB, the allocated port information that CMDB is received by platform courses center.It is flat Allocated port information is marked in the planning information table of port again for platform control centre, can be realized under after label When secondary progress port assignment, duplicate allocation is avoided.It is of course also possible to increase by a step after label, it will be in the planning information table of port The allocated port information of label, is deleted from the planning information table of port.After deletion, port assignment is carried out in next time certainly When, it not appears in alternative port information, thoroughly avoids the possibility of duplicate allocation.As shown in figure 5, being The surface chart of the configuration management page at platform courses center.After being assigned with 8700 port information for first micro services, Just no longer occurring 8700 when distributing port information for the 2nd micro services, in the drop-down menu of port information, this is allocated Port, so thoroughly avoiding the duplicate allocation of port.
In the present embodiment, directly the allocated port information of label is deleted from the planning information table of port, to Alternative port information is handled on source, to carry out port assignment from the planning information table of port every time When, all it is unappropriated port in the planning information table of port.Is carried out by duplicate allocation and is caused for port accordingly, it is possible to avoid Inconvenience.
In one embodiment, as shown in fig. 6, the position of configuration port information is with placeholder in configuration port template file Form be replaced;
By the port information distributed for micro services and be micro services structure mirror image in configuration port template file send On to corresponding server, to generate the configuration file of micro services according to port information and configuration port template file, including:
Step 602, the port information of micro services and configuration port template file are sent on corresponding server.
Placeholder is exactly first to occupy a fixed position, can be toward the symbol of addition content inside this position, extensively Editor for all kinds of documents in computer.The position of port information is configured from the configuration port template file got in mirror image Setting is replaced in the form of placeholder, convenient that port information is subsequently added to the position where placeholder.It will be from service The port information distributed in configuration information table, the configuration port template file obtained from mirror image are sent to corresponding server set In group.
Step 604, the placeholder in configuration port template file is replaced with to the port information of micro services on the server, Generate the configuration file of micro services.
On server in server cluster, by the port information obtained from service profile information table with environmental variance Start in the container of the mode of parameter value in the server, is passed in container.Wherein, container can be Docker containers. Docker containers can use dockerize tools, in conjunction with the configuration port template file replicated in mirror image before starting service With the environmental variance parameter value received, configuration file corresponding with micro services is generated.
In the present embodiment, port information is replaced in the form of placeholder in configuring port template file, therefore The process for generating configuration file can be split as to configuration port template file and distribute port information the two steps so that can With unified using port template file is configured, configuration port template file need not be configured every time.Port is believed again Breath, which is added in configuration port template file, produces the final configuration file for micro services publication.It significantly simplifies Operation, improves efficiency.
In one embodiment, the placeholder in configuration port template file is replaced with to the end of micro services on the server Message ceases, and generates the configuration file of micro services, including:In Docker containers on the server using Dockerize tools come The port information that placeholder in configuration port template file is replaced with to micro services, generates the configuration file of micro services.
Docker containers are an application container engines increased income, and allow developer that can be packaged their application and dependence It wraps into a transplantable container, is then published on the Linux machines of any prevalence, can also realize virtualization, Docker containers are independent of any language, frame and system.Dockerize is a small-sized Golang application, Ke Yigen According to specified template path configuration file is generated with environmental variance information.
In the present embodiment, it is generated finally according to the port information of acquisition and configuration port template file on the server Configuration file for micro services publication passes through using the Dockerize tools in Docker containers on server Dockerize tools replace with the port information of micro services by the placeholder in the template file of port is configured, and generate micro services Configuration file.
In one embodiment, before obtaining the mirror image for micro services structure in advance according to micro services posting request, packet It includes:
Project build request is initiated to project build center, so that project build center obtains configuration port template file, The mirror image of micro services is configured to together with the software package required with micro services publication by port template file is configured.
In the present embodiment, platform courses center receives micro services posting request, and according to micro services posting request to item Mesh builds center and initiates mirror image structure request.Project build center obtains configuration port template file from Template Manager center again For building the corresponding mirror image of micro services, specifically, the configuration port template file of acquisition is copied to institute by project build center In the mirror image of structure, and the software package needed for micro services publication is also copied in mirror image and carries out structure mirror image.It is built in mirror image After the completion, the mirror image built is uploaded in mirror image warehouse, calls mirror image to use when being issued for micro services.Starting mirror image can It is melted into a container with example, it is to be understood that at the virtual machine of a lightweight.In one embodiment, as shown in fig. 7, Provide a kind of hardware architecture diagram of micro services dissemination method.The application environment includes terminal 710,720 kimonos of Platform Server Business device cluster 730.Platform Server 710 includes many multiple functions of servers realization, such as including platform courses center 711, in configuration management database CMDB 712, Template Manager center 713, project build center 714, mirror image warehouse 715, scheduling The corresponding server such as the heart 717, jointly come realize micro services issue.Very multiple host HOST has been run in server cluster 730, Such as HOST1, HOST2, HOST3, HOST4 etc..Multiple containers i.e. container has been run in host HOST, uses C in the figure 7 Indicate container.
A kind of micro services dissemination method is additionally provided, is applied in applied environment figure shown in Fig. 7, includes the following steps:
(1) before carrying out micro services publication, the platform courses center in Platform Server is to unappropriated port information It is planned, the port planning information table port information after planning being stored in CMDB.It is interior in the planning information table of port Appearance see the table below shown:
Port planning information table, table name --- port_info
(2) terminal sends micro services posting request to Platform Server, and the platform courses center in Platform Server receives Micro services posting request, and port planning information table is got from CMDB according to micro services posting request, and be micro services point With the port information in the planning information table of port.
(3) port information of distribution is returned to CMDB, the allocated port information that CMDB is received by platform courses center Afterwards, allocated port information can be stored in service profile information table.The content being stored in service profile information table is seen below Shown in table:
Service profile information table, table name config_info
Field name Field type Field description Master/external key Default value
id int(8) Self-propagation id Major key
companyname Varchar(100) Business Name
servicename Varchar(100) Service name
envtype Varchar(100) Affiliated environment
version Varchar(100) Version number
contype Varchar(100) Configuration attribute
conname Varchar(100) Profile name
keyname Varchar(100) Configuration item title (placeholder title)
(4) after being assigned with port information for micro services, platform courses center returns to the port information of distribution The allocated port information that CMDB, CMDB are received.Because allocated port information cannot repeat distribution, need Allocated port information is marked in the planning information table of port, the mode of label can be in the planning information table of port Delete allocated port information.
(5) platform courses center uploads the template file for needing to configure port to Template Manager center, and this document is to match Set port template file.And the position of the configuration port in file is replaced in the form of certain format placeholder.
(6) platform courses center receives micro services posting request, and according to micro services posting request to project build center Initiate mirror image structure request.It is micro- for building that project build center obtains configuration port template file from Template Manager center again Service corresponding mirror image.The configuration port template file of acquisition is copied in constructed mirror image by project build center, and will Software package needed for micro services publication, which is also copied in mirror image, carries out structure mirror image.After the completion of mirror image is built, it will build Mirror image be uploaded in mirror image warehouse, when being issued for micro services call mirror image use.
(7) control centre of Platform Server is retrieved as the end of micro services distribution from the service profile information table in CMDB Message ceases, and is obtained in advance as the mirror image of micro services structure from mirror image warehouse.Comprising configuration port template file in mirror image, and The position for configuring configuration port information in the template file of port has been replaced in the form of placeholder, so as to subsequently by end Message breath is added to the position where placeholder.The port information of micro services and configuration port template file are sent to server On corresponding host in cluster.
(8) it is generated finally according to the port information of acquisition and configuration port template file on the host of server cluster Configuration file for micro services publication passes through using the Dockerize tools in Docker containers on server Dockerize tools replace with the port information of micro services by the placeholder in the template file of port is configured, and generate micro services Configuration file.
(9) according to the configuration file of generation, micro services are issued.
In one embodiment, as shown in figure 8, additionally providing a kind of micro services distributing device 800, which includes:End Mouth information assigning module 802, port information mark module 804, mirror image acquisition module 808, configuration file generation module 808 and hair Cloth module 808.
Port information distribution module 802, for being that micro services distribute port planning information table according to micro services posting request In port information.
Port information mark module 804, for allocated port information to be marked in the planning information table of port.
Mirror image acquisition module 806, for being obtained in advance as the mirror image of micro services structure, mirror image according to micro services posting request In comprising configuration port template file.
Configuration file generation module 808, for will be the port information of micro services distribution and be the mirror image that micro services are built In configuration port template file be sent on corresponding server, with according to port information and configuration port template file generate The configuration file of micro services.
Release module 810, for being issued micro services according to configuration file.
In one embodiment, as shown in figure 9, additionally providing a kind of micro services distributing device 900 and further including:Port information Planning module 902 and port planning information table generation module 904.
Port information planning module 902, for planning unappropriated port information.
Port planning information table generation module 904, for the port information typing port planning information table after planning.
In one embodiment, as shown in Figure 10, a kind of micro services distributing device 800 further includes:Removing module 805, will The allocated port information of label is deleted from the planning information table of port.
In one embodiment, as shown in figure 11, configuration file generation module 808 further includes:
Sending module 808a, for the port information of micro services and configuration port template file to be sent to corresponding service On device.
Replacement module 808b, for the placeholder configured in the template file of port to be replaced with micro services on the server Port information generates the configuration file of micro services.
In one embodiment, replacement module 808b is additionally operable to use in Docker containers on the server Dockerize tools replace with the port information of micro services by the placeholder in the template file of port is configured, and generate micro services Configuration file.
In one embodiment, as shown in figure 12, a kind of micro services distributing device 800 further includes:Mirror image builds module 801, for initiating project build request to project build center, so that project build center obtains configuration port template file, The mirror image of micro services is configured to together with the software package required with micro services publication by port template file is configured.
In one embodiment, a kind of computer readable storage medium is additionally provided, computer program is stored thereon with, it should Following steps are realized when program is executed by processor:It is that micro services are distributed in the planning information table of port according to micro services posting request Port information;Allocated port information is marked in the planning information table of port;It is obtained according to micro services posting request The mirror image built in advance for micro services is taken, includes configuration port template file in mirror image;The port information that will be distributed for micro services Be sent on corresponding server with the configuration port template file in the mirror image that is built for micro services, with according to port information and Configure the configuration file that port template file generates micro services;Micro services are issued according to configuration file.
In one embodiment, following steps are also realized when above procedure is executed by processor:Unappropriated port is believed Breath is planned;By the port information typing port planning information table after planning.
In one embodiment, following steps are also realized when above procedure is executed by processor:By the allocated of label Port information is deleted from the planning information table of port.
In one embodiment, following steps are also realized when above procedure is executed by processor:The port of micro services is believed Breath and configuration port template file are sent on corresponding server;The occupy-place in the template file of port will be configured on the server Symbol replaces with the port information of micro services, generates the configuration file of micro services.
In one embodiment, following steps are also realized when above procedure is executed by processor:On the server Placeholder in configuration port template file is replaced in Docker containers using Dockerize tools the port of micro services Information generates the configuration file of micro services.
In one embodiment, following steps are also realized when above procedure is executed by processor:It is sent out to project build center Rise project build request so that project build center obtain configuration port template file, will configuration port template file in incognito Software package needed for business publication is configured to the mirror image of micro services together.
In one embodiment, additionally provide a kind of computer equipment, which includes memory, processor and The computer program that can be run on a memory and on a processor is stored, processor realizes following step when executing computer program Suddenly:It is the port information that micro services are distributed in the planning information table of port according to micro services posting request;In port planning information table In allocated port information is marked;It is obtained in advance as the mirror image of micro services structure, mirror according to micro services posting request Include configuration port template file as in;By the port information distributed for micro services and be micro services structure mirror image in configuration Port template file is sent on corresponding server, to generate micro services according to port information and configuration port template file Configuration file;Micro services are issued according to configuration file.
In one embodiment, following steps are also realized when above-mentioned processor executes computer program:To unappropriated end Message breath is planned;By the port information typing port planning information table after planning.
In one embodiment, following steps are also realized when above-mentioned processor executes computer program:By having divided for label The port information matched is deleted from the planning information table of port.
In one embodiment, following steps are also realized when above-mentioned processor executes computer program:By the end of micro services Message ceases and configuration port template file is sent on corresponding server;It on the server will be in configuration port template file Placeholder replaces with the port information of micro services, generates the configuration file of micro services.
In one embodiment, following steps are also realized when above-mentioned processor executes computer program:On the server Docker containers in the placeholder configured in the template file of port replaced with by the ends of micro services using Dockerize tools Message ceases, and generates the configuration file of micro services.
In one embodiment, following steps are also realized when above-mentioned processor executes computer program:Into project build The heart initiate project build request so that project build center obtain configuration port template file, will configuration port template file with Software package needed for micro services publication is configured to the mirror image of micro services together.
One of ordinary skill in the art will appreciate that realizing all or part of flow in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, it is non-volatile computer-readable that computer program can be stored in one It takes in storage medium, the program is when being executed, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, storage medium can For magnetic disc, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access Memory, RAM) etc..
Each technical characteristic of above example can be combined arbitrarily, to keep description succinct, not to above-described embodiment In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance Shield is all considered to be the range of this specification record.
Several embodiments of the invention above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art It says, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the protection of the present invention Range.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.

Claims (10)

1. a kind of micro services dissemination method, the method includes:
It is the port information that the micro services are distributed in the planning information table of port according to micro services posting request;
Allocated port information is marked in the port planning information table;
The mirror image built in advance for the micro services is obtained according to the micro services posting request, includes configuration end in the mirror image Mouth template file;
By the port information distributed for the micro services and be micro services structure mirror image in configuration port template file It is sent on corresponding server, to generate the micro services according to the port information and the configuration port template file Configuration file;
The micro services are issued according to the configuration file.
2. according to the method described in claim 1, it is characterized in that, being distributed for micro services according to micro services posting request described Before port information in the planning information table of port, including:
Unappropriated port information is planned;
By port planning information table described in the port information typing after planning.
3. according to the method described in claim 1, it is characterized in that, it is described in the port planning information table to it is described After the port information of distribution is marked, including:
The allocated port information of the label is deleted from the port planning information table.
4. according to the method described in claim 1, it is characterized in that, configuring port information in the configuration port template file Position is replaced in the form of placeholder;
It is described by the port information distributed for the micro services and be micro services structure mirror image in configuration port template File is sent on corresponding server, with described in being generated according to the port information and configuration port template file in incognito The configuration file of business, including:
The port information of the micro services and configuration port template file are sent on corresponding server;
The port information that placeholder in the configuration port template file is replaced with to the micro services on the server, generates The configuration file of the micro services.
5. according to the method described in claim 4, it is characterized in that, described on the server by configuration port template file In placeholder replace with the port informations of the micro services, generate the configuration file of the micro services, including:
It will be in the template file of the configuration port using Dockerize tools in the Docker containers on the server Placeholder replace with the port informations of the micro services, generate the configuration file of the micro services.
6. according to the method described in claim 1, it is characterized in that, being obtained in advance according to the micro services posting request described Before mirror image for micro services structure, including:
Project build request is initiated to project build center, so that the project build center obtains configuration port template file, The configuration port template file is configured to the mirror image of the micro services together with the software package needed for micro services publication.
7. a kind of micro services distributing device, which is characterized in that described device includes:
Port information distribution module, for being that the micro services are distributed in the planning information table of port according to micro services posting request Port information;
Port information mark module, for allocated port information to be marked in the port planning information table;
Mirror image acquisition module, for being obtained in advance as the mirror image of micro services structure, institute according to the micro services posting request It states in mirror image comprising configuration port template file;
Configuration file generation module, for will be the port information of the micro services distribution and be the mirror image that the micro services are built In configuration port template file be sent on corresponding server, with according to the port information and configuration port template The configuration file of micro services described in file generated;
Release module, for being issued the micro services according to the configuration file.
8. device according to claim 7, which is characterized in that described device further includes:
Port information planning module, for planning unappropriated port information;
Port planning information table generation module, for port planning information table described in the port information typing after planning.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is held by processor The micro services dissemination method as described in any one of power 1 to 6 is realized when row.
10. a kind of computer equipment, the computer equipment includes memory, processor and is stored on the memory and can The computer program run on the processor, which is characterized in that the processor is realized when executing the computer program Micro services dissemination method as described in weighing any one of 1 to 6.
CN201711240906.0A 2017-11-30 2017-11-30 Micro services dissemination method, device, storage medium and computer equipment Withdrawn CN108600282A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711240906.0A CN108600282A (en) 2017-11-30 2017-11-30 Micro services dissemination method, device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711240906.0A CN108600282A (en) 2017-11-30 2017-11-30 Micro services dissemination method, device, storage medium and computer equipment

Publications (1)

Publication Number Publication Date
CN108600282A true CN108600282A (en) 2018-09-28

Family

ID=63633043

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711240906.0A Withdrawn CN108600282A (en) 2017-11-30 2017-11-30 Micro services dissemination method, device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN108600282A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109842559A (en) * 2018-12-28 2019-06-04 中兴通讯股份有限公司 A kind of network communication method and system
CN110427174A (en) * 2019-08-05 2019-11-08 浪潮云信息技术有限公司 A kind of micro services construction method based on database
CN111274211A (en) * 2020-02-20 2020-06-12 北京旷视科技有限公司 Application file storage method, device and system
CN111651219A (en) * 2020-05-27 2020-09-11 泰康保险集团股份有限公司 Method and equipment for managing multi-module project configuration file
CN112527357A (en) * 2020-12-14 2021-03-19 中国平安人寿保险股份有限公司 Service hot loading updating method and device, computer equipment and storage medium
CN112579118A (en) * 2019-09-30 2021-03-30 北京国双科技有限公司 Method, device, system, medium and equipment for updating configuration information of microservice
CN112650542A (en) * 2020-08-28 2021-04-13 成都格斗科技有限公司 Simple and general method for generating and managing configuration file under micro-service architecture
CN113824749A (en) * 2020-06-18 2021-12-21 北京金山云网络技术有限公司 Port allocation method, system, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104301338A (en) * 2013-07-16 2015-01-21 苏州精易会信息技术有限公司 Cloud platform based automatic deploying method for application system
CN104506460A (en) * 2014-12-29 2015-04-08 迈普通信技术股份有限公司 NAPT (network address port translation) port resource allocation realization method
CN106991035A (en) * 2017-04-06 2017-07-28 北京计算机技术及应用研究所 A kind of Host Supervision System based on micro services framework
CN107294785A (en) * 2017-07-11 2017-10-24 上海帝联信息科技股份有限公司 The automatic deployment method and device, computer-readable recording medium of CDN node service

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104301338A (en) * 2013-07-16 2015-01-21 苏州精易会信息技术有限公司 Cloud platform based automatic deploying method for application system
CN104506460A (en) * 2014-12-29 2015-04-08 迈普通信技术股份有限公司 NAPT (network address port translation) port resource allocation realization method
CN106991035A (en) * 2017-04-06 2017-07-28 北京计算机技术及应用研究所 A kind of Host Supervision System based on micro services framework
CN107294785A (en) * 2017-07-11 2017-10-24 上海帝联信息科技股份有限公司 The automatic deployment method and device, computer-readable recording medium of CDN node service

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李铭轩等: "面向电信运营商的IT资源微服务化方案", 《信息通信技术系统与方案》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109842559A (en) * 2018-12-28 2019-06-04 中兴通讯股份有限公司 A kind of network communication method and system
WO2020135856A1 (en) * 2018-12-28 2020-07-02 中兴通讯股份有限公司 Network communication method and system
CN110427174A (en) * 2019-08-05 2019-11-08 浪潮云信息技术有限公司 A kind of micro services construction method based on database
CN110427174B (en) * 2019-08-05 2024-01-16 浪潮云信息技术股份公司 Micro-service construction method based on database
CN112579118A (en) * 2019-09-30 2021-03-30 北京国双科技有限公司 Method, device, system, medium and equipment for updating configuration information of microservice
CN111274211A (en) * 2020-02-20 2020-06-12 北京旷视科技有限公司 Application file storage method, device and system
CN111274211B (en) * 2020-02-20 2024-01-12 北京旷视科技有限公司 Application file storage method, device and system
CN111651219A (en) * 2020-05-27 2020-09-11 泰康保险集团股份有限公司 Method and equipment for managing multi-module project configuration file
CN113824749A (en) * 2020-06-18 2021-12-21 北京金山云网络技术有限公司 Port allocation method, system, device, equipment and storage medium
CN113824749B (en) * 2020-06-18 2023-06-02 北京金山云网络技术有限公司 Port allocation method, system, device, equipment and storage medium
CN112650542A (en) * 2020-08-28 2021-04-13 成都格斗科技有限公司 Simple and general method for generating and managing configuration file under micro-service architecture
CN112527357A (en) * 2020-12-14 2021-03-19 中国平安人寿保险股份有限公司 Service hot loading updating method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108600282A (en) Micro services dissemination method, device, storage medium and computer equipment
CN108809722B (en) Method, device and storage medium for deploying Kubernetes cluster
CN110198231B (en) Container network management method and system for multiple tenants and middleware
US10666609B2 (en) Management of domain name systems in a large-scale processing environment
CN107580083B (en) Method and system for allocating IP addresses of containers
US10455028B2 (en) Allocating edge services with large-scale processing framework clusters
CN104199722A (en) Virtual computer storage service system and using method thereof
CN106982266A (en) A kind of method and apparatus of automatically dispose cluster
CN103078965B (en) The IP address management method of virtual machine
JP2020510384A (en) Network slice management method, unit, and system
CN105119966A (en) Official account management method and device
CN111124617B (en) Method and device for creating block chain system, storage medium and electronic device
CN110633130B (en) Virtual memory management method and device based on memory hot plug technology
CN108243079A (en) A kind of method and apparatus that network access is carried out based on VPC
US20170063627A1 (en) Allocation of virtual clusters in a large-scale processing environment
CN110738038A (en) Contract text generation method, device, equipment and computer readable storage medium
CN115567251A (en) Multi-service isolation method and system for micro-service cluster
CN105718299A (en) Virtual machine configuration method, device and system
WO2019223178A1 (en) Cross-platform task scheduling method and system, computer device, and storage medium
CN111045802B (en) Redis cluster component scheduling system and method and platform equipment
CN114650170B (en) Cross-cluster resource management method, device, equipment and storage medium
CN105573762A (en) Integrated system for producing and releasing digital media terminal applications
CN112035244A (en) Deployment of virtual node clusters in a multi-tenant environment
CN114489931A (en) Function instance container creation method and system
CN108062225B (en) Method for issuing application cluster by multi-template combination

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20180928