CN115002107A - Method, system, equipment and storage medium for deploying fragment service - Google Patents

Method, system, equipment and storage medium for deploying fragment service Download PDF

Info

Publication number
CN115002107A
CN115002107A CN202210513055.7A CN202210513055A CN115002107A CN 115002107 A CN115002107 A CN 115002107A CN 202210513055 A CN202210513055 A CN 202210513055A CN 115002107 A CN115002107 A CN 115002107A
Authority
CN
China
Prior art keywords
target
service instance
service
instance
directory
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.)
Pending
Application number
CN202210513055.7A
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.)
Hangzhou Tuanxing Information Technology Co ltd
Original Assignee
Hangzhou Tuanxing Information 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 Hangzhou Tuanxing Information Technology Co ltd filed Critical Hangzhou Tuanxing Information Technology Co ltd
Priority to CN202210513055.7A priority Critical patent/CN115002107A/en
Publication of CN115002107A publication Critical patent/CN115002107A/en
Pending legal-status Critical Current

Links

Images

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/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a method, a system, equipment and a storage medium for deploying a slicing service. According to the technical scheme provided by the embodiment of the application, when the target service instance is started, the target unique identifier is obtained from the pre-constructed identifier directory; further, an instance name of the target service instance is created in the service instance directory, the target unique identifier and the target service instance are bound to construct a binding relationship, and service registration operation of the target service instance is executed; and then, when a deletion event of the target service instance is monitored, and/or under the condition that the target service instance is determined not to exist in the system cluster, deleting the binding relationship in the service instance directory, and recording the target unique identifier back to the identifier directory. By adopting the technical means, the service deployment efficiency can be guaranteed, and the complexity of the service deployment of the system fragmentation can be reduced. And the unique identifier is recovered when the service is cancelled, so that the multiplexing of the unique identifier is realized, and the complexity of service deployment is further reduced.

Description

Method, system, equipment and storage medium for deploying fragment service
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method, a system, equipment and a storage medium for deploying a fragment service.
Background
At present, in a backend service scenario, in order to improve service Deployment efficiency and reduce service Deployment complexity, when a container cluster management system (kubernets) is used for fragment service Deployment, a stateless load (delivery) based form is used for fragment service Deployment. Each service can be transformed into a form without a storage state, does not have a unique identifier, and does not depend on a local memory. Therefore, most services can be decoupled in data storage, the service deployment efficiency is improved, and the deployment complexity is reduced.
However, since a unique identifier is required for service registration and discovery when a service is deployed, this conflicts with a service deployment form without a unique identifier and without storage state characteristics. When the container cluster management system (kubernets) performs the fragment service deployment, the service instance deployment of the container cluster management system is affected, and additional service deployment complexity is increased.
Disclosure of Invention
The embodiment of the application provides a fragmentation service deployment method, a fragmentation service deployment system, a piece of equipment and a storage medium, which can be compatible with a unique identifier of a service instance during fragmentation service deployment, and solve the technical problem that the unique identifier of the service instance is difficult to be compatible with service deployment in the existing fragmentation service deployment scene based on a container cluster management system.
In a first aspect, an embodiment of the present application provides a method for deploying a fragmented service, including:
when a target service instance is started, acquiring a target unique identifier from a pre-constructed identifier directory;
creating an instance name of a target service instance in a service instance directory, binding a target unique identifier and the target service instance to construct a binding relationship, and executing service registration operation of the target service instance;
when a deletion event of a target service instance is monitored, deleting the binding relationship in the service instance directory, and recording the target unique identifier back to the identifier directory; and/or the presence of a gas in the gas,
periodically traversing the service instance directory, and judging whether the target service instance exists in the system cluster according to the target unique identifier; and under the condition that the target service instance is determined not to exist in the system cluster, deleting the binding relationship in the service instance directory, and recording the target unique identification back to the identification directory.
In a second aspect, an embodiment of the present application provides a system for deploying a fragmented service, including:
the acquisition module is configured to acquire a target unique identifier from a pre-constructed identifier directory when a target service instance is started;
the creating module is configured to create an instance name of the target service instance in the service instance directory, bind the target unique identifier and the target service instance to construct a binding relationship, and execute service registration operation of the target service instance;
the recovery module is configured to delete the binding relation in the service instance directory when a deletion event of the target service instance is monitored, and record the target unique identifier back to the identifier directory; and/or, periodically traversing the service instance directory, and judging whether the target service instance exists in the system cluster according to the target unique identifier; and under the condition that the target service instance is determined not to exist in the system cluster, deleting the binding relationship in the service instance directory, and recording the target unique identification back to the identification directory.
In a third aspect, an embodiment of the present application provides a piece of service deployment equipment, including:
a memory and one or more processors;
the memory configured to store one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the slicing service deployment method of the first aspect.
In a fourth aspect, embodiments of the present application provide a storage medium containing computer-executable instructions which, when executed by a computer processor, are configured to perform the fragmentation service deployment method according to the first aspect.
In a fifth aspect, the present application provides a computer program product, which contains instructions that, when executed on a computer or a processor, cause the computer or the processor to execute the slice service deployment method according to the first aspect
According to the method and the device, when the target service instance is started, the target unique identifier is obtained from the pre-constructed identifier directory; further, an instance name of the target service instance is created in the service instance directory, the target unique identifier and the target service instance are bound to construct a binding relationship, and service registration operation of the target service instance is executed; then, when a deletion event of the target service instance is monitored, deleting the binding relationship in the service instance directory, and recording the target unique identifier back to the identifier directory; and/or, periodically traversing the service instance directory, and judging whether the target service instance exists in the system cluster according to the target unique identifier; and under the condition that the target service instance is determined not to exist in the system cluster, deleting the binding relationship in the service instance directory, and recording the target unique identification back to the identification directory. By adopting the technical means, when the container cluster management system deploys the slicing service, the unique identifier of the target service instance can be configured, and the service registration and discovery operation of the target service instance can be carried out, so that the complexity of the system slicing service deployment can be reduced while the service deployment efficiency is ensured. In addition, the unique identifier is recovered when the service is cancelled, so that the unique identifier can be reused, and the complexity of service deployment is further reduced.
Drawings
Fig. 1 is a flowchart of a method for deploying a fragmented service according to an embodiment of the present application;
FIG. 2 is a flow chart of service registration of a target service instance in an embodiment of the application;
FIG. 3 is a flowchart of unique identifier recovery in an embodiment of the present application;
fig. 4 is a schematic structural diagram of a system for deploying a fragmented service according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a piece of service deployment equipment according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, specific embodiments of the present application are described in detail below with reference to the accompanying drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some but not all of the relevant portions of the present application are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, subprograms, and the like.
The method for deploying the fragmented service aims to configure a unique identifier for a target service instance being deployed when the fragmented service is deployed, so that the target service instance can perform operations such as service registration and discovery and the like under a non-storage state, and further reduce the complexity of the fragmented service deployment. Most services need to rely on self unique identifiers (shard numbers) for service registration and discovery, and monitoring alarm and other operations. For example, when the sharded service deployment is performed based on a container cluster management system (kubernets), the service deployment is performed based on a stateful load form (stateful set). And binding the container name (pod name) of one container (pod) with the unique identification so as to deploy the service of the corresponding container based on the unique identification. However, this service deployment form is generally only suitable for service deployment scenarios with storage states, and needs to rely on stable local storage. The service deployment process is complex, and the service upgrading and capacity expanding efficiency is relatively low. And if the fragmentation service Deployment is carried out in a stateless load (Deployment) based form. Each service needs to be transformed into a form without a storage state, does not have a unique identifier, and does not depend on a local memory. Therefore, most services can be decoupled in data storage, the service deployment efficiency is improved, and the deployment complexity is reduced. However, in this case, the method is contradictory to the registration and discovery process of the system service, and when the fragmentation service is deployed in a stateless load (Deployment) form, the service Deployment form without the unique identifier and the storage state characteristics affects the service registration and discovery process of the container cluster management system, and increases additional service Deployment complexity. Based on this, the fragmentation service deployment method provided by the embodiment of the application is provided to solve the technical problem that in the existing fragmentation service deployment scene based on a container cluster management system, the unique identifier of the service instance is difficult to be compatible with service deployment.
Example (b):
fig. 1 shows a flowchart of a fragmentation service deployment method provided in an embodiment of the present application, where the fragmentation service deployment method provided in this embodiment may be executed by a fragmentation service deployment device, and the fragmentation service deployment device may be implemented in a software and/or hardware manner, and the fragmentation service deployment device may be formed by two or more physical entities or may be formed by one physical entity. Generally, the slicing service deployment device may be a server host, a service platform, or other computing device.
The following description will be given by taking the slicing service deployment device as an example of a main body for executing the slicing service deployment method. Referring to fig. 1, the fragmentation service deployment method specifically includes:
s110, when the target service instance is started, the target unique identification is obtained from the pre-constructed identification catalog.
When the service instance is deployed, the unique identifier is configured for the target service instance, so that the container cluster management system (kubernets) can be compatible with the unique identifier when the service instance is deployed based on a stateless load (Deployment). Therefore, the system can meet the requirements of efficient service deployment and capacity expansion and contraction operations in a non-storage state. And service registration and discovery can be carried out, so that the service deployment efficiency is guaranteed, and the complexity of service deployment is reduced. The container cluster management system (kubernets) is abbreviated as k8s, and is an open-source container cluster management system. The main functions of the system comprise application deployment, maintenance and rolling upgrade based on a container, load balancing, service discovery and the like.
It can be understood that, when the service instances are deployed, for each service instance, a unique identifier (shard number) is required for registering the service itself to the configuration center, for the caller to find the downstream service instance, and for making routing decisions. And service instances managed by service Deployment (Deployment) loads in a container cluster management system (kubernets) are mirrored, and corresponding unique identifiers (shard numbers) are not bound. The configuration is identical, and the same configuration data form (yaml) is shared, so that corresponding state distinction is not realized. In order to register and discover the service instance, the service instance managed by the stateless load form (delivery) needs to be configured with a corresponding unique identifier.
Based on this, when a container cluster management system (kubernets) starts a service instance, a unique identifier is configured for the service instance, so as to perform service registration, discovery and related invoking operations of the service instance based on the unique identifier. The method comprises the steps that a currently started service instance of a container cluster management system (kubernets) is defined as a target service instance, and when the target service instance is started, an application process of a unique identifier (shard number) is executed. Later, when the target service instance is destroyed, the unique identifier needs to be deleted, so that the system is prevented from calling the destroyed service by mistake according to the unique identifier.
Specifically, when the target service instance is started, a start script start. py is executed according to the system image configuration, a pre-constructed identification directory/k 8s/sngen/{ service _ name }/available of a distributed database (zookeeper) is accessed based on the start script start. py, a unique identification is selected from the identification directory, and the unique identification is defined as a target unique identification and serves as a unique identification of the current target service instance. The distributed database (zookeeper) is a Key-Value storage distributed database with sequential consistency, is a distributed coordination service sourced by Apache (Web server software), and can be used for service registration and service discovery in a backend service. After the identification directory is pre-constructed on the basis of the distributed database (zookeeper), when a target service instance is started subsequently, the identification directory/k 8s/sngen/{ service _ name }/available pre-constructed by the distributed database (zookeeper) can be traversed by a start script start.
Before that, the fragmentation service deployment device constructs a plurality of unique identifiers corresponding to an identification information range in an identification directory according to a preconfigured identification information range in a distributed database (zookeeper) in advance. Wherein, the identification information range represents the value containing all configurable unique identifications currently. According to the service to be migrated and the configurable identification information range in the cluster management system (kubbernees), the fragment service deployment device newly establishes node nodes in an identification directory/k 8s/sngen/{ service _ name }/available pre-constructed by a distributed database (zookeeper), and represents an available unique identification. The nodes are represented as: k8s/sngen/{ service _ name }/available/{ board _ number }.
Then, when the cluster management system (kubernets) starts the target service instance, one unique identifier can be randomly selected from a plurality of unique identifiers of the identification directory as the target unique identifier by traversing the identification directory. The target service instance traverses a pre-constructed identification directory/k 8s/sngen/{ service _ name }/available through a start script start.py, and randomly selects an available unique identification (guard number) from the identification directory/k 8s/sngen/{ service _ name }/available based on the start script start.py, so that the target unique identification of the target service instance is determined.
Optionally, in an embodiment, the target unique identifier may be selected sequentially according to an arrangement order of the unique identifiers (shard numbers) in the identifier directory/k 8s/sngen/{ service _ name }/available, so as to select the unique identifier as the target unique identifier. The embodiment of the application does not make fixed restrictions on the selected mode of the target unique identifier, and is not repeated herein.
S120, creating an instance name of the target service instance in the service instance directory, binding the target unique identifier and the target service instance to construct a binding relationship, and executing service registration operation of the target service instance.
Further, based on the determined target unique identifier, the embodiment of the application further creates an instance name in a service instance directory of a cluster management system (kubernets), and binds the instance name with the target unique identifier to construct a binding relationship. And executing the service registration operation of the target service instance, and injecting the target unique identifier into the registration center by performing the service registration operation on the target unique identifier. Therefore, when the subsequent system needs to call the related service in the service instance directory, the binding relationship can be inquired through the instance name, the corresponding target unique identifier is determined, and then each service instance needing to be called is determined in the registration center according to the target unique identifier.
An instance name pod _ name child node is added to a service instance catalog/k 8s/sngen/{ service _ name }/pods of a container cluster management system (kubernets), and the value of the child node is set as the target unique identifier, so that the binding relationship between the target unique identifier and the instance name is constructed. After the binding relationship is established, the service registration operation of the target service instance is executed, so that the service instance can be called based on the target unique identifier bound by the instance name in the subsequent service operation process, and the registration and discovery of the service are realized.
When the service registration of the target service instance is carried out, the running state of the target service instance is checked, and when the target service instance is in the predefined state, the service registration operation of the target service instance is executed based on the target unique identifier. And the predefined state is the state of the target service instance in normal operation. It will be appreciated that in order to perform a service registration operation for a target service instance, the target service instance is required to run healthy. Based on this, the embodiment of the application triggers the service registration operation of the target service instance by detecting whether the target service instance is in the predefined state.
Specifically, referring to fig. 2, the service registration process of the target service instance includes:
s1201, detecting the running state of a target service instance based on the state detection script;
and S1202, when the target service instance is in a predefined state, writing the target unique identifier, the IP address and the port information of the target service instance into the service registration center so as to execute the registration operation of the target service instance.
A health detection probe, namely a status detection script, is configured in a container cluster management system (kubernets) for each deployed service instance. The state detection script periodically checks the survival condition of the target service instance to acquire the running state of the target service instance. And when the running state of the target service instance is a predefined state, triggering the service registration operation of the target service instance.
The state detection script determines whether the running state of the target service instance is normal or not based on an rpc (Remote Procedure Call Protocol) interface of the target service instance by calling the interface. And if the running state of the target service instance is the predefined state, the health check of the target service instance is successful. Then, the distributed service deployment device reads the local file of the target service instance to obtain the target unique identifier (i.e. the shard _ number) stored therein, and performs service registration based on the target unique identifier. Writing the target unique identification into the service registry. And writing the IP address and the port information of the target service instance and the storage node information of the target service instance into the service registration center so as to complete the registration operation of the target service instance. According to actual needs, other relevant information of the target service instance may also be written to the service registration center in the registering of the service instance, and the embodiment of the present application does not make fixed restrictions on the specifically written relevant information, which is not described herein repeatedly.
In addition, based on the constructed instance name and binding relationship of the service instance directory, when the upstream and downstream routing services need to call the target service instance, the binding relationship can be queried according to the instance name of the target service instance to determine the target unique identifier, the registration center is queried based on the target unique identifier to determine the IP information and the port information of the target service instance, and the target service instance is called, so that the service discovery of the target service instance is realized.
In addition, since the target unique identifier is already used, the unique identifier corresponding to the target unique identifier in the identifier directory needs to be deleted in a distributed database (zookeeper). It can be understood that, since the target unique identifier is already used, if it is kept in the identifier directory, the target unique identifier may be bound by other service instances, which may cause service invocation to be confused. Based on this, in the embodiment of the application, a node/k 8s/sngen/{ service _ name }/available/{ guard _ number } corresponding to a target unique identifier is found in an identifier directory/k 8s/sngen/{ service _ name }/available pre-constructed in a distributed database (zookeeper), and the node is deleted. Therefore, the used unique identifier in the identifier directory is deleted, and the accurate calling of the service instance is guaranteed.
According to the embodiment of the application, the unique identifier is configured for the service instance deployed by the container cluster management system (kubernets), so that service registration and discovery of the service instance can be achieved, the complexity of service deployment is reduced, and the service deployment efficiency is improved.
In addition, in practical application, when the upstream and downstream routing services call the target service instance, the instance name can be analyzed based on a system domain name analysis function, so as to call the instance interface of the target service instance according to the instance name. It can be understood that the instance name of the target service instance contains domain name information of the service instance, and based on a domain name analysis function of a container cluster management system (kubernets), the instance name can be resolved into the domain name information of the corresponding service instance, so as to realize the calling of the service instance. Therefore, when the service instance is called, the service instance directory/k 8s/sngen/{ service _ name }/pods can be directly inquired, and the instance interface call of the service instance is realized according to the instance name of the corresponding service instance.
S130, when a deleting event of the target service instance is monitored, deleting the binding relationship in the service instance directory, and recording the target unique identifier back to the identifier directory; and/or, periodically traversing the service instance directory, and judging whether the target service instance exists in the system cluster according to the instance name; and under the condition that the target service instance does not exist in the system cluster, deleting the binding relationship in the service instance directory, and recording the target unique identifier back to the identifier directory.
Further, based on the deployed target service instance, in order to avoid resource waste of unique identifier configuration, the embodiment of the present application further performs unique identifier recovery operation through the cancelled target service instance, so as to implement multiplexing of the unique identifier. The complexity of service instance deployment is further reduced, the creation link of the unique identifier is reduced, the generation flow of the unique identifier is simplified, and the service instance deployment efficiency is improved.
During the running process of the target service instance, a control module zk-controller of a distributed database (zookeeper) monitors each event of the target service instance based on a list & watch mechanism of a container cluster management system (kubernets). When a deletion event (pod delete) of the target service instance is monitored, a recovery process of the target unique identifier is triggered.
Specifically, the control loop of the zk-controller of the distributed database (zookeeper) may continuously listen whether the target service instance has a deletion event (pod delete), and once the deletion event (pod) is listened, it indicates that the current target service instance is logged out. At this time, the service instance deployment device queries the service instance directory by connecting a distributed database (zookeeper), and acquires the target unique identifier shardnumber by the storage path of the instance name/k 8s/sngen/{ service _ name }/pods/{ pod _ name }. Based on the obtained target unique identifier, a node/k 8s/sngen/{ service _ name }/available/{ guard _ number } is further re-created in an identifier directory/k 8s/sngen/{ service _ name }/available } of a distributed database (zookeeper), so that the target unique identifier is represented, that is, the target unique identifier is recovered to the identifier directory. Similarly, since the target unique identifier is recovered at this time, the binding relationship constructed by the target service instance in the service instance directory needs to be logged out. And the upstream and downstream service routes are prevented from calling the cancelled service instance by mistake according to the target unique identifier in the binding relation. The node/k 8s/sngen/{ service _ name }/pods/{ pod _ name }, so as to complete the binding relation logout operation of the target service instance, and realize the recovery operation of the target unique identifier.
In addition, the embodiment of the present application further provides another unique identifier recycling process, which is used as a compensation mechanism for the target unique identifier recycling process. The condition that the unique identifier cannot be recovered under the condition that the target service instance is logged off but the deletion event is not detected is avoided. The two recovery processes which are not necessarily identified can be simultaneously applied or alternatively applied, and the recovery mechanism of the target unique identifier is not fixedly limited by the application and is not described in detail herein.
Wherein, the target unique identifier recovery process comprises:
s1301, periodically traversing the service instance directory, and determining an instance name corresponding to the target service instance based on the binding relationship;
s1302, calling a node proxy interface based on the instance name, and inquiring whether the target service instance exists in the system cluster through the node proxy interface.
Specifically, if it is determined that the target service instance is not in the system cluster of the current container cluster management system, it indicates that the target service instance is logged off. Illustratively, when recovering the target unique identifier, the control module zk-controller of the distributed database (zookeeper) will periodically poll the service instance directory, call the kube-apiserver interface, and confirm whether the target service instance exists in the system cluster through the interface. The kube-API server interface is a data interface for verifying and configuring an API object by an API server of the container cluster management system, the API server provides service for REST operation and provides a front end for a shared state of a cluster, and all other components interact through the front end.
Wherein, the zk-controller of the distributed database (zookeeper) will query the/k 8s/sngen subdirectory of the system to obtain the service instance directory. And then all the instance names in the service instance directory are obtained by traversing the service instance directory. And determining the service instances which are not in the system cluster by inquiring whether the service instances corresponding to the instance names exist in the system cluster or not. And finally, deleting the service instances which are not in the system cluster from the service instance directory, and simultaneously re-recording the target unique identifier bound by the service instances into the identifier directory, thereby realizing the recovery of the unique identifier.
By providing a compensation mechanism of the unique identifier recovery process, the unique identifier can be recovered to the identifier directory as much as possible. The creation process of the unique identifier is reduced, so that the unique identifier is multiplexed. And further, the deployment efficiency of the service instance is improved, and the operation of the system service is optimized.
In the above, when the target service instance is started, the target unique identifier is obtained from the pre-constructed identifier directory; further, an instance name of the target service instance is created in the service instance directory, the target unique identifier and the target service instance are bound to construct a binding relationship, and service registration operation of the target service instance is executed; then, when a deletion event of the target service instance is monitored, deleting the binding relationship in the service instance directory, and recording the target unique identifier back to the identifier directory; and/or, periodically traversing the service instance directory, and judging whether the target service instance exists in the system cluster according to the instance name; and under the condition that the target service instance is determined not to exist in the system cluster, deleting the binding relationship in the service instance directory, and recording the target unique identification back to the identification directory. By adopting the technical means, when the container cluster management system deploys the slicing service, the unique identifier of the target service instance can be configured, and the service registration and discovery operation of the target service instance can be carried out, so that the complexity of the system slicing service deployment can be reduced while the service deployment efficiency is ensured. In addition, the unique identifier is recovered when the service is cancelled, so that the unique identifier can be reused, and the complexity of service deployment is further reduced.
Based on the foregoing embodiment, fig. 4 is a schematic structural diagram of a service fragment deployment system provided in the present application. Referring to fig. 4, the slicing service deployment system provided in this embodiment specifically includes: an acquisition module 21, a creation module 22 and a recovery module 23.
The acquisition module is configured to acquire a target unique identifier from a pre-constructed identifier directory when a target service instance is started;
the creating module is configured to create an instance name of the target service instance in the service instance directory, bind the target unique identifier and the target service instance to construct a binding relationship, and execute service registration operation of the target service instance;
the recovery module is configured to delete the binding relation in the service instance directory when a deletion event of the target service instance is monitored, and record the target unique identifier back to the identifier directory; and/or, periodically traversing the service instance directory, and judging whether the target service instance exists in the system cluster according to the instance name; and under the condition that the target service instance is determined not to exist in the system cluster, deleting the binding relationship in the service instance directory, and recording the target unique identification back to the identification directory.
Specifically, the obtaining module 21 is configured to construct a plurality of unique identifiers corresponding to the identifier information range in the identifier directory according to the preconfigured identifier information range; and traversing the identification directory, and randomly selecting one unique identification from the plurality of unique identifications of the identification directory as a target unique identification.
Specifically, the creation module 22 is further configured to check the running status of the target service instance, and perform a service registration operation of the target service instance based on the target unique identifier when the target service instance is in the predefined state. Detecting the running state of a target service instance based on a state detection script; and when the target service instance is in a predefined state, writing the target unique identification, the IP address and the port information of the target service instance into the service registration center so as to execute the registration operation of the target service instance. And deleting the unique identifier corresponding to the target unique identifier in the identifier directory. The instance name is resolved based on a system domain name analysis function to invoke an instance interface of the target service instance according to the instance name.
The recycling module 23 is further configured to periodically traverse the service instance directory, and determine an instance name corresponding to the target service instance based on the binding relationship; and calling a node proxy interface of the target service instance based on the instance name, and inquiring whether the target service instance exists in the system cluster or not through the node proxy interface.
When the target service instance is started, the target unique identifier is obtained from the pre-constructed identifier directory; further, an instance name of the target service instance is created in the service instance directory, the target unique identifier and the target service instance are bound to construct a binding relationship, and service registration operation of the target service instance is executed; then, when a deletion event of the target service instance is monitored, deleting the binding relationship in the service instance directory, and recording the target unique identifier back to the identifier directory; and/or, periodically traversing the service instance directory, and judging whether the target service instance exists in the system cluster according to the instance name; and under the condition that the target service instance is determined not to exist in the system cluster, deleting the binding relationship in the service instance directory, and recording the target unique identification back to the identification directory. By adopting the technical means, when the container cluster management system deploys the slicing service, the unique identifier of the target service instance can be configured, and the service registration and discovery operation of the target service instance can be carried out, so that the complexity of the system slicing service deployment can be reduced while the service deployment efficiency is ensured. In addition, the unique identifier is recovered when the service is cancelled, so that the unique identifier can be reused, and the complexity of service deployment is further reduced.
The slicing service deployment system provided by the embodiment of the application can be configured to execute the slicing service deployment method provided by the embodiment, and has corresponding functions and beneficial effects.
On the basis of the above practical example, an embodiment of the present application further provides a fragmentation service deployment device, and with reference to fig. 5, the fragmentation service deployment device includes: a processor 31, a memory 32, a communication module 33, an input device 34, and an output device 35. The memory 32 is a computer-readable storage medium and may be configured to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the fragmentation service deployment method according to any embodiment of the present application (for example, an acquisition module, a creation module, and a recovery module in the fragmentation service deployment system). The communication module 33 is configured to perform data transmission. The processor executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory, that is, the above-mentioned fragmentation service deployment method is realized. The input device 34 may be configured to receive input numeric or character information and to generate key signal inputs relating to user settings and function controls of the apparatus. The output device 35 may include a display device such as a display screen. The provided fragmentation service deployment device can be configured to execute the fragmentation service deployment method provided by the embodiment, and has corresponding functions and beneficial effects.
On the basis of the above embodiments, the present application further provides a storage medium containing computer executable instructions, which when executed by a computer processor are configured to perform a method of fragmented service deployment, and the storage medium may be any of various types of memory devices or storage devices. Of course, in a storage medium including computer-executable instructions provided in this embodiment of the present application, the computer-executable instructions are not limited to the above-described fragmentation service deployment method, and may also execute related operations in the fragmentation service deployment method provided in any embodiment of the present application.
On the basis of the foregoing embodiments, an embodiment of the present application further provides a computer program product, where essentially or a part of the technical solutions that contribute to the prior art or all or part of the technical solutions may be embodied in the form of a software product, and the computer program product is stored in a storage medium and includes several instructions to enable a computer device, a mobile terminal, or a processor therein to execute all or part of the steps of the slicing service deployment method according to the embodiments of the present application.

Claims (11)

1. A method for deploying a fragmented service, comprising:
when a target service instance is started, acquiring a target unique identifier from a pre-constructed identifier directory;
creating an instance name of the target service instance in a service instance directory, binding the target unique identifier and the target service instance to construct a binding relationship, and executing service registration operation of the target service instance;
when a deletion event of the target service instance is monitored, deleting the binding relationship in the service instance directory, and recording the target unique identifier back to the identifier directory; and/or the presence of a gas in the gas,
periodically traversing the service instance directory, and judging whether the target service instance exists in the system cluster according to the instance name; and under the condition that the target service instance is determined not to exist in the system cluster, deleting the binding relationship in the service instance directory, and recording the target unique identifier back to the identifier directory.
2. The method for deploying a sharded service according to claim 1, further comprising, before said obtaining the target unique identifier from the pre-built identifier directory:
according to a preconfigured identification information range, constructing a plurality of unique identifications corresponding to the identification information range in the identification catalog;
the obtaining of the target unique identifier from the pre-constructed identifier directory includes:
and traversing the identification directory, and randomly selecting one unique identifier from the plurality of unique identifiers of the identification directory as the target unique identifier.
3. The method for deploying a sharded service according to claim 2, wherein after obtaining the target unique identifier from the pre-built identifier directory, the method further comprises:
and deleting the unique identifier corresponding to the target unique identifier in the identifier directory.
4. The method for deploying a sliced service according to claim 1, wherein the performing the service registration operation of the target service instance comprises:
and checking the running state of the target service instance, and executing the service registration operation of the target service instance based on the target unique identifier when the target service instance is in a predefined state.
5. The slicing service deployment method of claim 4, wherein the checking the running state of the target service instance and performing the service registration operation of the target service instance based on the target unique identifier when the target service instance is in a predefined state comprises:
detecting the running state of the target service instance based on a state detection script;
and when the target service instance is in a predefined state, writing the target unique identification, the IP address and the port information of the target service instance into a service registration center so as to execute the registration operation of the target service instance.
6. The slicing service deployment method of claim 1, wherein after said binding the target unique identifier and the target service instance to construct a binding relationship, further comprising:
and resolving the instance name based on a system domain name analysis function so as to call an instance interface of the target service instance according to the instance name.
7. The method for deploying a sharded service according to claim 1, wherein the periodically traversing the service instance directory and determining whether the target service instance exists in the system cluster according to the instance name comprises:
periodically traversing the service instance directory, and determining the instance name corresponding to the target service instance based on the binding relationship;
and calling a node proxy interface based on the instance name, and inquiring whether the target service instance exists in the system cluster or not through the node proxy interface.
8. A system for deploying a fragmented service, comprising:
the acquisition module is configured to acquire a target unique identifier from a pre-constructed identifier directory when a target service instance is started;
the creating module is configured to create an instance name of the target service instance in a service instance directory, bind the target unique identifier and the target service instance to construct a binding relationship, and execute service registration operation of the target service instance;
the recovery module is configured to delete the binding relationship in the service instance directory and record the target unique identifier back to the identifier directory when a deletion event of the target service instance is monitored; and/or, periodically traversing the service instance directory, and judging whether the target service instance exists in the system cluster according to the instance name; and under the condition that the target service instance is determined not to exist in the system cluster, deleting the binding relationship in the service instance directory, and recording the target unique identifier back to the identifier directory.
9. A fragmented services deployment apparatus, comprising:
a memory and one or more processors;
the memory configured to store one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the slicing service deployment method of any of claims 1-7.
10. A storage medium containing computer-executable instructions, which when executed by a computer processor are configured to perform the slicing service deployment method of any of claims 1-7.
11. A computer program product comprising instructions which, when run on a computer or processor, cause the computer or processor to carry out the slicing service deployment method of any of claims 1-7.
CN202210513055.7A 2022-05-11 2022-05-11 Method, system, equipment and storage medium for deploying fragment service Pending CN115002107A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210513055.7A CN115002107A (en) 2022-05-11 2022-05-11 Method, system, equipment and storage medium for deploying fragment service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210513055.7A CN115002107A (en) 2022-05-11 2022-05-11 Method, system, equipment and storage medium for deploying fragment service

Publications (1)

Publication Number Publication Date
CN115002107A true CN115002107A (en) 2022-09-02

Family

ID=83027045

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210513055.7A Pending CN115002107A (en) 2022-05-11 2022-05-11 Method, system, equipment and storage medium for deploying fragment service

Country Status (1)

Country Link
CN (1) CN115002107A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104253831A (en) * 2013-06-26 2014-12-31 国际商业机器公司 Method and system for deploying application in cloud computing environment
CN105100200A (en) * 2015-06-02 2015-11-25 北京京东尚科信息技术有限公司 Method and system for distributed deployment, unified configuration and automatic adaptation
CN106844793A (en) * 2017-04-12 2017-06-13 环球大数据科技有限公司 Management method, the apparatus and system of example service
US10560353B1 (en) * 2014-09-16 2020-02-11 Amazon Technologies, Inc. Deployment monitoring for an application
CN112055087A (en) * 2020-09-10 2020-12-08 厦门市美亚柏科信息股份有限公司 Method and system for rapid deployment, migration and maintenance of Mongodb cluster

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104253831A (en) * 2013-06-26 2014-12-31 国际商业机器公司 Method and system for deploying application in cloud computing environment
US10560353B1 (en) * 2014-09-16 2020-02-11 Amazon Technologies, Inc. Deployment monitoring for an application
CN105100200A (en) * 2015-06-02 2015-11-25 北京京东尚科信息技术有限公司 Method and system for distributed deployment, unified configuration and automatic adaptation
CN106844793A (en) * 2017-04-12 2017-06-13 环球大数据科技有限公司 Management method, the apparatus and system of example service
CN112055087A (en) * 2020-09-10 2020-12-08 厦门市美亚柏科信息股份有限公司 Method and system for rapid deployment, migration and maintenance of Mongodb cluster

Similar Documents

Publication Publication Date Title
CN112118565B (en) Multi-tenant service gray level publishing method, device, computer equipment and storage medium
CN112035317B (en) Micro-service link monitoring method, device, equipment and medium
EP1872227B1 (en) System and method of testing wireless component applications
CN110990047B (en) Fusion method and device for multiple microservice architectures
CN109547524B (en) User behavior storage method, device, equipment and storage medium based on Internet of things
CN110727589A (en) Test method, device and equipment
CN107644075B (en) Method and device for collecting page information
CN111404628B (en) Time synchronization method and device
CN114168179A (en) Micro-service management method, device, computer equipment and storage medium
CN111966466A (en) Container management method, device and medium
CN113590169B (en) Application deployment method, application deployment system, and computer-readable storage medium
CN111930565B (en) Process fault self-healing method, device and equipment for components in distributed management system
CN111342986A (en) Distributed node management method and device, distributed system and storage medium
CN104104701A (en) Online service configuration updating method and system
CN115002107A (en) Method, system, equipment and storage medium for deploying fragment service
CN112558943B (en) Configuration information management system under micro-service architecture
CN109167826B (en) Method, device and system for putting WEB application on shelf
CN114866617A (en) Micro-service request processing method, device, equipment and medium
US11582345B2 (en) Context data management interface for contact center
US11275674B1 (en) Operations support system (OSS) test tool
CN115918116A (en) Information processing method, device and storage medium
CN111741102A (en) Upgrading method and device for distributed micro-service application
CN110719204A (en) Micro-service configuration management method, device and system
CN112351114A (en) Information processing method and device and storage medium
CN115378993B (en) Method and system for supporting namespace-aware service registration and discovery

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