Service deployment method, device, electronic equipment and storage medium

文档序号:7199 发布日期:2021-09-17 浏览:111次 中文

1. A method for service deployment, comprising:

acquiring configuration information of each service in a project to be deployed;

combining the services in the project to be deployed to obtain one or more service combinations and roles corresponding to the service combinations;

allocating roles to each server in the cluster according to the one or more service combinations and the roles corresponding to each service combination;

generating deployment configuration of each server according to the role of each server and configuration information of each service in a service combination corresponding to the role of the server;

and configuring each server according to the deployment configuration of each server.

2. The service deployment method of claim 1, wherein the combining the services in the project to be deployed to obtain one or more service combinations and a role corresponding to each service combination comprises:

and combining the services in the project to be deployed according to a service combination principle to obtain one or more service combinations and roles corresponding to each service combination.

3. The service deployment method of claim 1, wherein the assigning roles to the servers in the cluster according to the one or more service combinations and the role corresponding to each service combination comprises:

allocating candidate roles for the servers according to the one or more service combinations and the role corresponding to each service combination;

for each server, when the candidate roles of the server are multiple, acquiring services in a service combination corresponding to the multiple candidate roles, and generating a service set;

when the services in the service set meet a service combination principle, determining the candidate roles of the server as the roles of the server;

and when the service in the service set does not meet the service combination principle, adjusting the candidate role of the server until the service in the service set meets the service combination principle.

4. A service deployment method according to claim 2 or 3, wherein the service composition principle comprises at least one of the following principles: the method comprises the steps that a preset service combination list, different services in the same item cannot be combined together, a control type service and a controlled type service in a base layer service can be combined together, a control type service and a controlled type service in different items in a non-base layer service can be combined together, a controlled type service in a non-base layer service cannot be combined together, and the number of services in service combination is smaller than or equal to a preset number threshold.

5. The service deployment method according to claim 1, wherein after generating the deployment configuration of each server according to the role of each server and the configuration information of each service in the service combination corresponding to the role of the server, the method further comprises:

monitoring a configuration information change request, wherein the configuration information change request comprises a target service and configuration change content of the target service;

and updating the configuration information of the target service according to the configuration change content of the target service when the configuration information change request is monitored.

6. The service deployment method of claim 1, wherein said configuring the respective servers according to their deployment configurations comprises:

determining deployment time points of the servers, and sending the deployment time points to the corresponding servers;

when a configuration request sent by a target server according to a corresponding deployment time point is received, acquiring the deployment configuration of the target server;

and returning the deployment configuration of the target server to the target server, wherein the deployment configuration is used for configuring the target server.

7. The service deployment method according to claim 6, wherein the deployment time points of each server are plural, and a time difference value between two adjacent deployment time points is smaller than a preset difference threshold value; and/or the presence of a gas in the gas,

and setting the peak staggering of the deployment time points of the servers.

8. A service deployment apparatus, comprising:

the acquisition module is configured to acquire configuration information of each service in the project to be deployed;

the combination module is configured to perform combination of the services in the project to be deployed to obtain one or more service combinations and roles corresponding to the service combinations;

the distribution module is configured to execute distribution of roles for the servers in the cluster according to the one or more service combinations and the roles corresponding to each service combination;

a generating module configured to execute configuration information of each service in the service combination corresponding to the role of each server and the role of the server to generate deployment configuration of each server;

a deployment module configured to perform configuring the respective servers according to the deployment configuration of the respective servers.

9. An electronic device, comprising:

a processor;

a memory for storing the processor-executable instructions;

wherein the processor is configured to execute the instructions to implement the service deployment method of any one of claims 1-7.

10. A storage medium having instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the service deployment method of any one of claims 1-7.

Background

At present, for a large data cluster, for example, a large data cluster of 10 ten thousand levels, a service deployment method mainly includes manually generating cluster configuration information for a small cluster, where the cluster configuration information includes services to be deployed to the small cluster; after deployment and normal operation verification, storing the cluster configuration information in a configuration center, acquiring the cluster configuration information from the configuration center in an expansion mode, and manually adjusting and deploying the cluster configuration information to a big data cluster.

However, in the above method, the actual configuration on the large data cluster is inconsistent with the deployment configuration stored in the configuration center, and is difficult to unify, so that the cluster management cost is high, and the cluster management efficiency is poor.

Disclosure of Invention

The present disclosure provides a service deployment method, device, electronic device, and storage medium, to at least solve the problems in the related art that the actual configuration on a large data cluster is inconsistent with the cluster configuration information stored in a configuration center, and is difficult to unify, the cluster management cost is high, and the cluster management efficiency is poor.

The technical scheme of the disclosure is as follows:

according to a first aspect of the embodiments of the present disclosure, there is provided a service deployment method, including:

acquiring configuration information of each service in a project to be deployed;

combining the services in the project to be deployed to obtain one or more service combinations and roles corresponding to the service combinations;

allocating roles to each server in the cluster according to the one or more service combinations and the roles corresponding to each service combination;

generating deployment configuration of each server according to the role of each server and configuration information of each service in a service combination corresponding to the role of the server;

and configuring each server according to the deployment configuration of each server.

As a first possible situation of the embodiment of the present disclosure, the combining the services in the project to be deployed to obtain one or more service combinations and a role corresponding to each service combination includes:

and combining the services in the project to be deployed according to a service combination principle to obtain one or more service combinations and roles corresponding to each service combination.

As a second possible case of the embodiment of the present disclosure, the allocating roles for the servers in the cluster according to the one or more service combinations and the role corresponding to each service combination includes:

allocating candidate roles for the servers according to the one or more service combinations and the role corresponding to each service combination;

for each server, when the candidate roles of the server are multiple, acquiring services in a service combination corresponding to the multiple candidate roles, and generating a service set;

when the services in the service set meet a service combination principle, determining the candidate roles of the server as the roles of the server;

and when the service in the service set does not meet the service combination principle, adjusting the candidate role of the server until the service in the service set meets the service combination principle.

As a third possible scenario of the embodiment of the present disclosure, the service composition rule includes at least one of the following rules: the method comprises the steps that a preset service combination list, different services in the same item cannot be combined together, a control type service and a controlled type service in a base layer service can be combined together, a control type service and a controlled type service in different items in a non-base layer service can be combined together, a controlled type service in a non-base layer service cannot be combined together, and the number of services in service combination is smaller than or equal to a preset number threshold.

As a fourth possible case of the embodiment of the present disclosure, after generating a deployment configuration of each server according to the role of each server and configuration information of each service in a service combination corresponding to the role of the server, the method further includes:

monitoring a configuration information change request, wherein the configuration information change request comprises a target service and configuration change content of the target service;

and updating the configuration information of the target service according to the configuration change content of the target service when the configuration information change request is monitored.

As a fifth possible case of the embodiment of the present disclosure, the configuring the servers according to the deployment configurations of the servers includes:

determining deployment time points of the servers, and sending the deployment time points to the corresponding servers;

when a configuration request sent by a target server according to a corresponding deployment time point is received, acquiring the deployment configuration of the target server;

and returning the deployment configuration of the target server to the target server, wherein the deployment configuration is used for configuring the target server.

As a sixth possible case of the embodiment of the present disclosure, the deployment time points of each server are multiple, and a time difference between two adjacent deployment time points is smaller than a preset difference threshold; and/or the presence of a gas in the gas,

and setting the peak staggering of the deployment time points of the servers.

As a seventh possible case of the embodiment of the present disclosure, after configuring the servers according to the deployment configuration of the servers, the method further includes:

judging whether the cluster meets a redeployment condition, wherein the redeployment condition comprises at least one of the following conditions: a change exists in a server in the cluster, a change exists in a project deployed on the cluster, and a change exists in a service in a project deployed on the cluster;

when the cluster meets the redeployment condition, acquiring configuration information of each service in the project to be deployed; combining the services in the project to be deployed to obtain one or more service combinations and roles corresponding to the service combinations; allocating roles to each server in the cluster according to the one or more service combinations and the roles corresponding to each service combination; and generating the deployment configuration of each server according to the role of each server and the configuration information of each service in the service combination corresponding to the role of the server.

In the service deployment method of the embodiment of the disclosure, the configuration information of each service in the project to be deployed is acquired; combining each service in the project to be deployed to obtain one or more service combinations and a role corresponding to each service combination; allocating roles for each server in the cluster according to one or more service combinations and the roles corresponding to each service combination; generating deployment configuration of each server according to the role of each server and configuration information of each service in a service combination corresponding to the role of each server; and configuring each server according to the deployment configuration of each server, wherein the combination of the services ensures that the number of roles obtained after the combination is far smaller than the number of the services, the workload during service deployment can be reduced, the servers are deployed at one time, the actual deployment configuration on the large data cluster is consistent with the deployment configuration obtained from the configuration center, the management is easy, the cluster management cost is reduced, and the cluster management efficiency is improved.

According to a second aspect of the embodiments of the present disclosure, there is provided a service deployment apparatus, including:

the acquisition module is configured to acquire configuration information of each service in the project to be deployed;

the combination module is configured to perform combination of the services in the project to be deployed to obtain one or more service combinations and roles corresponding to the service combinations;

the distribution module is configured to execute distribution of roles for the servers in the cluster according to the one or more service combinations and the roles corresponding to each service combination;

a generating module configured to execute configuration information of each service in the service combination corresponding to the role of each server and the role of the server to generate deployment configuration of each server;

a deployment module configured to perform configuring the respective servers according to the deployment configuration of the respective servers.

As a first possible situation of the embodiment of the present disclosure, the combination module is specifically configured to perform, according to a service combination principle, combining services in the project to be deployed to obtain one or more service combinations and a role corresponding to each service combination.

As a second possible scenario of the disclosed embodiment, the allocation module is specifically configured to execute,

allocating candidate roles for the servers according to the one or more service combinations and the role corresponding to each service combination;

for each server, when the candidate roles of the server are multiple, acquiring services in a service combination corresponding to the multiple candidate roles, and generating a service set;

when the services in the service set meet a service combination principle, determining the candidate roles of the server as the roles of the server;

and when the service in the service set does not meet the service combination principle, adjusting the candidate role of the server until the service in the service set meets the service combination principle.

As a third possible scenario of the embodiment of the present disclosure, the service composition rule includes at least one of the following rules: the method comprises the steps that a preset service combination list, different services in the same item cannot be combined together, a control type service and a controlled type service in a base layer service can be combined together, a control type service and a controlled type service in different items in a non-base layer service can be combined together, a controlled type service in a non-base layer service cannot be combined together, and the number of services in service combination is smaller than or equal to a preset number threshold.

As a fourth possible case of the embodiment of the present disclosure, the service deployment apparatus further includes: the device comprises a monitoring module and an updating module; the monitoring module is configured to execute a monitoring configuration information change request, wherein the monitoring configuration information change request comprises a target service and configuration change content of the target service;

the updating module is configured to update the configuration information of the target service according to the configuration change content of the target service when the configuration information change request is monitored.

As a fifth possible scenario of an embodiment of the present disclosure, the deployment module is specifically configured to execute,

determining deployment time points of the servers, and sending the deployment time points to the corresponding servers;

when a configuration request sent by a target server according to a corresponding deployment time point is received, acquiring the deployment configuration of the target server;

and returning the deployment configuration of the target server to the target server, wherein the deployment configuration is used for configuring the target server.

As a sixth possible case of the embodiment of the present disclosure, the deployment time points of each server are multiple, and a time difference between two adjacent deployment time points is smaller than a preset difference threshold; and/or the presence of a gas in the gas,

and setting the peak staggering of the deployment time points of the servers.

As a seventh possible case of the embodiment of the present disclosure, the service deployment apparatus further includes: a judgment module;

the judging module is configured to execute, judge whether the cluster meets a redeployment condition, where the redeployment condition includes at least one of the following conditions: a change exists in a server in the cluster, a change exists in a project deployed on the cluster, and a change exists in a service in a project deployed on the cluster;

the acquisition module is further configured to execute, and when the cluster meets a redeployment condition, acquire configuration information of each service in a project to be deployed;

the combination module is also configured to execute, combine the services in the project to be deployed, and obtain one or more service combinations and roles corresponding to each service combination;

the allocation module is further configured to execute allocating roles for the servers in the cluster according to the one or more service combinations and the role corresponding to each service combination;

the generating module is further configured to execute, according to the roles of the servers and configuration information of each service in a service combination corresponding to the roles of the servers, generating deployment configurations of the servers.

In the service deployment device of the embodiment of the disclosure, the configuration information of each service in the project to be deployed is acquired; combining each service in the project to be deployed to obtain one or more service combinations and a role corresponding to each service combination; allocating roles for each server in the cluster according to one or more service combinations and the roles corresponding to each service combination; generating deployment configuration of each server according to the role of each server and configuration information of each service in a service combination corresponding to the role of each server; and configuring each server according to the deployment configuration of each server, wherein the combination of the services ensures that the number of roles obtained after the combination is far smaller than the number of the services, the workload during service deployment can be reduced, the servers are deployed at one time, the actual deployment configuration on the large data cluster is consistent with the deployment configuration obtained from the configuration center, the management is easy, the cluster management cost is reduced, and the cluster management efficiency is improved.

According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the service deployment method set forth in the embodiment of the first aspect of the present disclosure.

According to a fourth aspect of the embodiments of the present disclosure, there is provided a storage medium, where instructions, when executed by a processor of a server, enable an electronic device to perform the service deployment method proposed in the first aspect of the present disclosure.

According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product, which, when executed by a processor of a server, enables the server to perform the service deployment method set forth in the first aspect of the present disclosure.

It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.

Drawings

The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.

FIG. 1 is a flow chart of a method of service deployment shown in accordance with an exemplary embodiment;

FIG. 2 is a schematic diagram of a service deployment apparatus for deploying a service;

FIG. 3 is a flow chart of a service deployment method shown in accordance with an exemplary embodiment two;

FIG. 4 is a block diagram of a service deployment apparatus shown in accordance with an example embodiment III;

FIG. 5 is a block diagram of a service deployment apparatus, shown in accordance with an example embodiment four;

FIG. 6 is a block diagram illustrating an electronic device for service deployment in accordance with an exemplary embodiment.

Detailed Description

In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.

It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.

At present, for a large data cluster, for example, a large data cluster of 10 ten thousand levels, a service deployment method mainly includes manually generating cluster configuration information for a small cluster, where the cluster configuration information includes services to be deployed to the small cluster; after deployment and normal operation verification, storing the cluster configuration information in a configuration center, acquiring the cluster configuration information from the configuration center in an expansion mode, and manually adjusting and deploying the cluster configuration information to a big data cluster.

However, in the above method, the actual configuration on the large data cluster is inconsistent with the deployment configuration stored in the configuration center, and is difficult to unify, so that the cluster management cost is high, and the cluster management efficiency is poor.

The service deployment method is mainly used for solving the problems that the actual configuration on a big data cluster in the related technology is inconsistent with the deployment configuration stored in a configuration center, the unification is difficult, the cluster management cost is high, and the cluster management efficiency is poor. According to the service deployment method, the number of the roles obtained after the combination is far smaller than the number of the services through the combination of the services, the workload during service deployment can be reduced, the services are deployed at one time, the actual deployment configuration on the big data cluster is consistent with the deployment configuration obtained from the configuration center, the management is easy, the cluster management cost is reduced, and the cluster management efficiency is improved.

FIG. 1 is a flow chart of an illustrative method of service deployment in accordance with an exemplary embodiment.

The execution subject of the embodiment of the present disclosure may be a service deployment apparatus, and the service deployment apparatus may be, for example, a configuration center of a cluster. The configuration center of the cluster may be, for example, one or more servers in the cluster, which are responsible for cluster management.

As shown in fig. 1, the service deployment method may include the steps of:

in step S101, configuration information of each service in the project to be deployed is acquired.

In the embodiment of the present disclosure, the cluster may be a cluster in which a service is not deployed, or may be a cluster in which a service is deployed but a redeployment condition is satisfied, where the redeployment condition includes at least one of the following conditions: there is a change in servers in the cluster, a change in projects deployed on the cluster, and a change in services in projects deployed on the cluster. In one embodiment, a project specifies a task to be implemented, and the task may be divided into a plurality of subtasks, and each subtask may be implemented by a plurality of services. That is, the task specified by the project is implemented by the service in the project. For example, a project may be a storage task that may be split into multiple sub-storage tasks. In another embodiment, the items include services that need to be provided, such as storage services, search services, and the like.

In the embodiment of the present disclosure, a cluster that has not deployed services may be a cluster that has not deployed services at a time; or a cluster in which services have been deployed but the deployed services are deleted. In the embodiment of the present disclosure, the change of the server in the cluster means that a new server is added to the cluster, or a part of servers is reduced in the cluster, and the like. When a cluster is expanded or a failed server is replaced, a new server is generally added to the cluster. When a server in the cluster fails, the failed server is deleted, which results in a reduction in the number of servers in the cluster.

In the embodiment of the present disclosure, a determination manner of a change in a project deployed on a cluster is as follows: and comparing the identification of the project on the cluster at the current time point with the identification of the project on the cluster at the previous time point to determine whether the project deployed on the cluster has changes. For example, if each service of the project B is deployed on a cluster of each service of the project a, the service deployed on the cluster at this time is partially owned by the project a, and if the service deployed on the cluster is owned by the project B, the project is changed; and if all the services after the new service is deployed on the cluster belong to the project A, the project is not changed.

In the embodiment of the present disclosure, a service in a project deployed on a cluster has a change, which may be determined by an identifier of the service in the project, and the identifier of the service in the project at a current time point is compared with an identifier of the service in the project at a previous time point to determine whether the service in the project has a change. For example, new services belonging to the project a are deployed on a cluster of each service where the project a has been deployed, and when the number, name, and the like of the services marked with the project a change, it is determined that the services in the project a have changed; if the number, name, etc. of the services marked with item a in the cluster have not changed, it is determined that there is no change in the services in item a.

In step S102, the services in the project to be deployed are combined to obtain one or more service combinations and a role corresponding to each service combination.

In this embodiment of the present disclosure, the process of the service deployment apparatus executing step 102 may be, for example, combining services in the item to be deployed according to a service combination principle to obtain one or more service combinations and a role corresponding to each service combination. Wherein, the service composition principle needs to satisfy at least one of the following conditions: (1) the method comprises the following steps that conflicts do not exist among a plurality of services in one service combination, and the plurality of services in the service combination can provide services; (2) when a plurality of services in one service combination are combined, the service efficiency can be improved, or the service efficiency of a single service can be ensured, and the influence of the use of one service on the use of another service is avoided; that is, the total service efficiency of the individual services in the service combination is greater than or equal to the sum of the service efficiencies of the individual services in the service combination; (3) when one service combination cannot provide services, other service combinations can provide similar functions, namely, a plurality of services with similar functions cannot be placed in the same service combination, so that the failure probability of the whole project is reduced as much as possible. (4) In order to ensure the service efficiency of each service combination and further ensure the service efficiency of the server with the service combination, the number of services in the service combination can be limited, and the situation that the service in one service combination is too much and the service in the other service combination is too little can be avoided. It should be noted that the total service efficiency of each service in the service combination is a total service efficiency determined by combining each service in advance, or a total service efficiency estimated according to whether there is a relationship among the functions, consumed resources, services, and the like of each service.

It should be noted that, taking whether there is a relationship between the consumed resources and the services as an example, the estimation manner may be, for example, if the service a is a controlled service, the service B is a controlled service, and the service B calls the service a, at this time, the total service time may be the service time of the service B, and then the total service efficiency is determined according to the total service time. For another example, if the service a and the service B have no association relationship, and if the resource types consumed by the service a and the service B are different, the services can be performed simultaneously, the total service time may be the maximum time of the service a and the service time of the service B, and the total service efficiency is determined according to the total service time; if the resource types consumed by the service a and the service B are the same and the services cannot be simultaneously serviced, the total service time may be the total service time of the service a plus the total service time of the service B, and the total service efficiency is determined according to the total service time.

Therefore, on the basis of the above conditions, the service composition principle may include at least one of the following principles: the method comprises the steps that a preset service combination list, different services in the same item cannot be combined together, a control type service and a controlled type service in a base layer service can be combined together, a control type service and a controlled type service in different items in a non-base layer service can be combined together, a controlled type service in a non-base layer service cannot be combined together, and the number of services in service combination is smaller than or equal to a preset number threshold.

In the embodiment of the present disclosure, the service combination in the preset service combination list is a combination frequently adopted among a plurality of services, for example, the service a in the item 1 and the service B in the item 2 are frequently combined together, and then the combination of the service a and the service B is added to the service combination list.

In the embodiment of the disclosure, different services in the same project cannot be combined together, so that different services in the same project can be placed in different service combinations, and then different service combinations are deployed on different servers, so that when a certain server fails, the functions of the services on the server can be realized by adopting the services on other servers. For example, a project includes a service a and a service B, where the service a and the service B provide different services, and if the service a and the service B are combined together and are deployed on the same server, when the server fails, both the service a and the service B may fail to provide the service. If the service a and the service B are deployed on different servers, the number of services that cannot be provided when the servers fail is reduced.

In the embodiment of the present disclosure, it should be noted that each service in a project is hierarchical, and includes a base layer service and a non-base layer service. The base layer service provides data computation and storage management for the base layer, such as the data layer. The non-base layer service is a service for executing logic processing or the like in a business logic layer or an application layer, and these services perform logic processing based on data provided by the base layer service. In addition, the services can be divided into two types, one is a control class service, and the other is a controlled class service, wherein the controlled class service provides services, such as a data storage service, a data deletion service, and the like, according to the invocation of the control class service. Control class services, such as data management services, invoking data storage services, data deletion services, and the like, to implement data management.

In the embodiment of the disclosure, the control class service and the controlled class service in the base layer service can be combined together. For example, if the control class service a and the controlled class service B are not combined together and are deployed on two different servers, because there is a control relationship between the control class service a and the controlled class service B, as long as one of the servers fails, neither the control class service a nor the controlled class service B can provide services. If the control type service A and the controlled type service B are combined together and are deployed on the same server, because the probability a of the failure of one server is smaller than the probability a + B of the failure of only one server in the two servers, the control type service and the controlled type service in the base layer service can be combined together, and therefore the failure time of the whole project can be reduced as much as possible.

In the embodiment of the disclosure, the control class service and the controlled class service of different items in the non-base layer service can be combined together. Because the control services and the controlled services of different projects are not affected with each other, no calling relation exists, and the condition that resources are occupied by the provided services is less, the control services and the controlled services of different projects are combined together and deployed on the same server, so that the service efficiency can be improved to a certain extent.

In the embodiment of the disclosure, the controlled services in the non-base layer services cannot be combined together. Because the controlled services need to occupy a large amount of resources, if the controlled services in the non-base layer services are combined together, the situation that a plurality of controlled services occupy the resources may occur, and the service efficiency is reduced to a certain extent. Therefore, the controlled services in the non-base layer services cannot be combined together, and the service efficiency can be effectively improved.

In the embodiment of the present disclosure, in order to avoid an excessive number of services deployed on the same server, the number of services in a service combination needs to be less than or equal to a preset number threshold. The number of services in the service combination is ensured to be less than or equal to the preset number threshold, so as to avoid the problems that the number of services deployed on some servers is too large, the number of services deployed on some servers is too small, and the service efficiency is unbalanced, so that the overall service efficiency is poor.

In step S103, roles are assigned to the servers in the cluster according to one or more service combinations and the role corresponding to each service combination.

In the embodiment of the present disclosure, the process of the service deployment apparatus executing step S103 may be, for example, allocating candidate roles to each server according to one or more service combinations and the role corresponding to each service combination; for each server, when the candidate roles of the server are multiple, acquiring services in a service combination corresponding to the multiple candidate roles, and generating a service set; when the service in the service set meets the service combination principle, determining the candidate role of the server as the role of the server; and when the service in the service set does not meet the service combination principle, adjusting the candidate role of the server until the service in the service set meets the service combination principle.

In the embodiment of the present disclosure, the candidate roles of the servers may be adjusted, for example, in such a manner that, for each server, a service that does not satisfy the service combination principle in the service set of the server is obtained; determining the role corresponding to the service combination to which the service belongs as a conflict role; the conflicting roles are assigned to other servers. The service combination corresponding to a single role satisfies the service combination principle, but the service set generated by the service combination corresponding to a plurality of roles does not necessarily satisfy the service combination principle. Therefore, for a server, in a case that the server is assigned with a plurality of candidate roles, the service deployment apparatus needs to generate a service set according to a service combination corresponding to the plurality of candidate roles, and determine whether the service set satisfies a service combination rule; if the service combination principle is not satisfied, determining a candidate role of the conflict, and allocating the candidate role of the conflict to other servers, the server will not be allocated with the candidate role of the conflict. In addition, if the number of the conflicting candidate roles is too large or the percentage of the conflicting candidate roles is too large, it indicates that the role assignment is not reasonable or the service combination is not reasonable, and the role assignment or the service combination can be reassigned.

In the embodiment of the disclosure, for each server, when the candidate role of the server is single, the candidate role of the server may be directly determined as the role of the server.

In step 104, deployment configuration of each server is generated based on the role of each server and configuration information of each service in the service combination corresponding to the role of the server.

In this embodiment of the present disclosure, if a role of a certain server is single, the deployment configuration of the server may be generated according to configuration information of each service in a service combination corresponding to the single role. For example, if the service combination corresponding to the single role includes service a and service B, the deployment configuration of the server is generated according to the configuration information of service a and the configuration information of service B. For example, the deployment configuration of the server includes: configuration information of service a and configuration information of service B.

In this embodiment, if there are multiple roles of a certain server, the deployment configuration of the server may be generated according to configuration information of each service in a service combination corresponding to the multiple roles. For example, if the service combinations corresponding to the plurality of roles are the first service combination and the second service combination respectively; and generating deployment configuration of the server according to the configuration information of the service A, the configuration information of the service B, the configuration information of the service C and the configuration information of the service D.

In this embodiment of the present disclosure, in order to ensure real-time update of the deployment configuration of each server, after step S104, the method may further include the following steps: monitoring a configuration information change request, wherein the configuration information change request comprises a target service and configuration change content of the target service; and updating the configuration information of the target service according to the configuration change content of the target service when the configuration information change request is monitored.

In the embodiment of the present disclosure, the request for changing the configuration information may be that the configuration information of the service is manually modified by the user and then is actively reported to the service deployment device by the server.

In step S105, the respective servers are configured according to their deployment configurations.

Fig. 2 is a schematic diagram of service deployment for a service deployment apparatus, and fig. 2 shows a relationship among the service deployment apparatus, a server, a role, a service, and configuration information. Wherein each service has corresponding configuration information; a plurality of services can be combined together, and one service combination corresponds to one role; each role can be deployed on one or more servers, and one or more roles can be deployed on each server.

In the embodiment of the present disclosure, after step 105, the method may further include the following steps: judging whether the cluster meets a redeployment condition, wherein the redeployment condition comprises at least one of the following conditions: the method comprises the following steps that a server in a cluster is changed, a project deployed on the cluster is changed, and a service in the project deployed on the cluster is changed; when the cluster meets the redeployment condition, acquiring configuration information of each service in the project to be deployed; combining each service in the project to be deployed to obtain one or more service combinations and a role corresponding to each service combination; allocating roles for each server in the cluster according to one or more service combinations and the roles corresponding to each service combination; and generating deployment configuration of each server according to the role of each server and the configuration information of each service in the service combination corresponding to the role of the server.

In the embodiment of the disclosure, when there is a change in a server in a cluster, a change in a project deployed on the cluster, or a change in a service in a project deployed on the cluster, the deployment configuration of each server can be regenerated and deployed, so that it can be ensured that the deployment configuration of each server can be adjusted in real time according to a change action, and the management efficiency of the server is improved.

In the service deployment method of the embodiment of the disclosure, the configuration information of each service in the project to be deployed is acquired; combining each service in the project to be deployed to obtain one or more service combinations and a role corresponding to each service combination; allocating roles for each server in the cluster according to one or more service combinations and the roles corresponding to each service combination; generating deployment configuration of each server according to the role of each server and configuration information of each service in a service combination corresponding to the role of each server; and configuring each server according to the deployment configuration of each server, wherein the combination of the services ensures that the number of roles obtained after the combination is far smaller than the number of the services, the workload during service deployment can be reduced, the servers are deployed at one time, the actual deployment configuration on the large data cluster is consistent with the deployment configuration obtained from the configuration center, the management is easy, the cluster management cost is reduced, and the cluster management efficiency is improved.

FIG. 3 is a flowchart illustrating a method of service deployment in accordance with an exemplary embodiment two. As shown in fig. 3, on the basis of the embodiment shown in fig. 1, in order to further improve the service deployment efficiency, step S105 may specifically include the following steps:

in step S1051, the deployment time point of each server is determined, and the deployment time point is transmitted to the corresponding server.

In the embodiment of the present disclosure, in a first implementation scenario, in order to ensure consistency between an actual deployment configuration of each server in a cluster and a deployment configuration acquired from a configuration center in real time, a plurality of deployment time points of each server may be provided, and a time difference between two adjacent deployment time points is smaller than a preset difference threshold.

In the embodiment of the present disclosure, in the second implementation scenario, in order to further improve the service deployment efficiency, the deployment time points of the servers may be set in a peak-to-peak manner. For example, the deployment time point of the first server may be 0 point, 0 point 10 point, 0 point 20 point, etc.; the deployment time point of the second server may be 0 point 0 minutes 10 seconds, 0 point 10 minutes 10 seconds, 0 point 20 seconds, and so on.

In the embodiment of the disclosure, in a third implementation scenario, in order to ensure consistency between an actual deployment configuration of each server in a cluster and a deployment configuration acquired from a configuration center in real time and improve service deployment efficiency, a plurality of deployment time points of each server may be provided, a time difference between two adjacent deployment time points is smaller than a preset difference threshold, and the deployment time points of each server may be set in a peak-to-peak manner.

In the embodiment of the present disclosure, after receiving a deployment time point sent by a service deployment device, a server sends a configuration request to the service deployment device when the deployment time point is reached, so as to obtain a deployment configuration of the server.

In step S1052, upon receiving a configuration request sent by the target server according to the corresponding deployment time point, the deployment configuration of the target server is acquired.

In the embodiment of the present disclosure, the configuration request may include an identifier of the target server, and the service deployment device may query local configuration information according to the identifier of the target server, and obtain the deployment configuration of the target server from the local configuration information.

In step S1053, the deployment configuration of the target server is returned to the target server, wherein the deployment configuration is used to configure the target server.

In the embodiment of the disclosure, after the target server obtains the deployment configuration, the deployment configuration can be performed; or, deployment configuration is performed when a preset configuration time point is reached.

In the service deployment method of the embodiment of the disclosure, the configuration information of each service in the project to be deployed is acquired; combining each service in the project to be deployed to obtain one or more service combinations and a role corresponding to each service combination; allocating roles for each server in the cluster according to one or more service combinations and the roles corresponding to each service combination; generating deployment configuration of each server according to the role of each server and configuration information of each service in a service combination corresponding to the role of each server; determining deployment time points of all servers, and sending the deployment time points to corresponding servers; when a configuration request sent by a target server according to a corresponding deployment time point is received, acquiring the deployment configuration of the target server; returning the deployment configuration of the target server to the target server, wherein the deployment configuration is used for configuring the target server; the combination of the services enables the number of roles obtained after the combination to be far smaller than the number of the services, workload during service deployment can be reduced, the services are deployed at one time, actual deployment configuration on a big data cluster is consistent with deployment configuration obtained from a configuration center, management is easy, cluster management cost is reduced, and cluster management efficiency is improved.

In order to implement the foregoing embodiments, an embodiment of the present disclosure provides a service deployment apparatus.

Fig. 4 is a block diagram of a service deployment apparatus according to a third exemplary embodiment, and referring to fig. 4, the service deployment apparatus 400 may include: an acquisition module 401, a combination module 402, an allocation module 403, a generation module 404, and a deployment module 405.

The obtaining module 401 is configured to perform obtaining configuration information of each service in a project to be deployed;

a combination module 402 configured to perform combination of the services in the project to be deployed, so as to obtain one or more service combinations and a role corresponding to each service combination;

an assigning module 403, configured to assign roles to the servers in the cluster according to the one or more service combinations and the role corresponding to each service combination;

a generating module 404 configured to execute generating deployment configuration of each server according to the role of each server and configuration information of each service in a service combination corresponding to the role of the server;

a deployment module 405 configured to perform configuring the respective servers according to the deployment configurations of the respective servers.

In a possible implementation form of the embodiment of the present disclosure, the combining module 402 is specifically configured to perform, according to a service combination principle, combining services in the project to be deployed to obtain one or more service combinations and a role corresponding to each service combination.

In a possible implementation form of the embodiment of the present disclosure, the allocating module 403 is specifically configured to execute, according to the one or more service combinations and the role corresponding to each service combination, allocating candidate roles for the servers; for each server, when the candidate roles of the server are multiple, acquiring services in a service combination corresponding to the multiple candidate roles, and generating a service set; when the services in the service set meet a service combination principle, determining the candidate roles of the server as the roles of the server; and when the service in the service set does not meet the service combination principle, adjusting the candidate role of the server until the service in the service set meets the service combination principle.

In one possible implementation form of the embodiment of the present disclosure, the service composition rule includes at least one of the following rules: the method comprises the steps that a preset service combination list, different services in the same item cannot be combined together, a control type service and a controlled type service in a base layer service can be combined together, a control type service and a controlled type service in different items in a non-base layer service can be combined together, a controlled type service in a non-base layer service cannot be combined together, and the number of services in service combination is smaller than or equal to a preset number threshold.

In a possible implementation form of the embodiment of the present disclosure, with reference to fig. 5 in combination, on the basis of the embodiment shown in fig. 4, the service deployment apparatus further includes: a listening module 406 and an updating module 407.

The monitoring module 406 is configured to perform monitoring of a configuration information change request, where the configuration information change request includes a target service and configuration change content of the target service;

the updating module 407 is configured to update the configuration information of the target service according to the configuration change content of the target service when the configuration information change request is monitored.

In a possible implementation form of the embodiment of the present disclosure, the deployment module 405 is specifically configured to execute, determine a deployment time point of each server, and send the deployment time point to a corresponding server;

when a configuration request sent by a target server according to a corresponding deployment time point is received, acquiring the deployment configuration of the target server;

and returning the deployment configuration of the target server to the target server, wherein the deployment configuration is used for configuring the target server.

In a possible implementation form of the embodiment of the present disclosure, the deployment time points of each server are multiple, and a time difference between two adjacent deployment time points is smaller than a preset difference threshold; and/or the peak offset setting of the deployment time points of the servers.

In a possible implementation form of the embodiment of the present disclosure, the apparatus further includes: a judgment module; the judging module is configured to execute, judge whether the cluster meets a redeployment condition, where the redeployment condition includes at least one of the following conditions: a change exists in a server in the cluster, a change exists in a project deployed on the cluster, and a change exists in a service in a project deployed on the cluster;

the obtaining module 401 is further configured to execute, when the cluster meets the redeployment condition, obtaining configuration information of each service in the project to be deployed;

the combining module 402 is further configured to perform, combine the services in the project to be deployed, to obtain one or more service combinations and a role corresponding to each service combination;

the allocating module 403 is further configured to execute, according to the one or more service combinations and the role corresponding to each service combination, allocating a role to each server in the cluster;

the generating module 404 is further configured to execute, according to the roles of the servers and the configuration information of each service in the service combination corresponding to the roles of the servers, generating the deployment configuration of the servers.

In the service deployment device of the embodiment of the disclosure, the configuration information of each service in the project to be deployed is acquired; combining each service in the project to be deployed to obtain one or more service combinations and a role corresponding to each service combination; allocating roles for each server in the cluster according to one or more service combinations and the roles corresponding to each service combination; generating deployment configuration of each server according to the role of each server and configuration information of each service in a service combination corresponding to the role of each server; and configuring each server according to the deployment configuration of each server, wherein the combination of the services ensures that the number of roles obtained after the combination is far smaller than the number of the services, the workload during service deployment can be reduced, the servers are deployed at one time, the actual deployment configuration on the large data cluster is consistent with the deployment configuration obtained from the configuration center, the management is easy, the cluster management cost is reduced, and the cluster management efficiency is improved.

In order to implement the above embodiments, the embodiment of the present disclosure further provides an electronic device.

Wherein, electronic equipment includes:

a processor;

a memory for storing processor-executable instructions;

wherein the processor is configured to execute the instructions to implement the service deployment method as previously described.

As an example, fig. 6 is a block diagram illustrating an electronic device 200 for service deployment according to an exemplary embodiment, where as shown in fig. 6, the electronic device 200 may further include:

a memory 210 and a processor 220, a bus 230 connecting different components (including the memory 210 and the processor 220), the memory 210 storing a computer program, and the processor 220 implementing the service deployment method according to the embodiment of the present disclosure when executing the program.

Bus 230 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.

Electronic device 200 typically includes a variety of electronic device readable media. Such media may be any available media that is accessible by electronic device 200 and includes both volatile and nonvolatile media, removable and non-removable media.

Memory 210 may also include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)240 and/or cache memory 250. The server 200 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 260 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard drive"). Although not shown in FIG. 6, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 230 by one or more data media interfaces. Memory 210 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the disclosure.

A program/utility 280 having a set (at least one) of program modules 270, including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may comprise an implementation of a network environment, may be stored in, for example, the memory 210. The program modules 270 generally perform the functions and/or methodologies of the embodiments described in this disclosure.

Electronic device 200 may also communicate with one or more external devices 290 (e.g., keyboard, pointing device, display 291, etc.), with one or more devices that enable a user to interact with electronic device 200, and/or with any devices (e.g., network card, modem, etc.) that enable electronic device 200 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 292. Also, the electronic device 200 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 293. As shown, the network adapter 293 communicates with the other modules of the electronic device 200 via the bus 230. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.

The processor 220 executes various functional applications and data processing by executing programs stored in the memory 210.

It should be noted that, for the implementation process and the technical principle of the electronic device of the embodiment, reference is made to the foregoing explanation of the service deployment method of the embodiment of the present disclosure, and details are not described here again.

The electronic equipment provided by the embodiment of the disclosure acquires configuration information of each service in a project to be deployed; combining each service in the project to be deployed to obtain one or more service combinations and a role corresponding to each service combination; allocating roles for each server in the cluster according to one or more service combinations and the roles corresponding to each service combination; generating deployment configuration of each server according to the role of each server and configuration information of each service in a service combination corresponding to the role of each server; and configuring each server according to the deployment configuration of each server, wherein the combination of the services ensures that the number of roles obtained after the combination is far smaller than the number of the services, the workload during service deployment can be reduced, the servers are deployed at one time, the actual deployment configuration on the large data cluster is consistent with the deployment configuration obtained from the configuration center, the management is easy, the cluster management cost is reduced, and the cluster management efficiency is improved.

In order to implement the above embodiments, the embodiments of the present disclosure further provide a storage medium.

Wherein the instructions in the storage medium, when executed by a processor of the electronic device, enable the electronic device to perform the service deployment method as previously described.

To implement the above embodiments, the present disclosure also provides a computer program product, which when executed by a processor of a server, enables the server to perform the service deployment method as described above.

Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:智能合约部署方法和装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!