CN109495288B - Service deployment method and device - Google Patents

Service deployment method and device Download PDF

Info

Publication number
CN109495288B
CN109495288B CN201710827026.7A CN201710827026A CN109495288B CN 109495288 B CN109495288 B CN 109495288B CN 201710827026 A CN201710827026 A CN 201710827026A CN 109495288 B CN109495288 B CN 109495288B
Authority
CN
China
Prior art keywords
target client
command
configuration file
client
server
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.)
Active
Application number
CN201710827026.7A
Other languages
Chinese (zh)
Other versions
CN109495288A (en
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.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum 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 Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201710827026.7A priority Critical patent/CN109495288B/en
Publication of CN109495288A publication Critical patent/CN109495288A/en
Application granted granted Critical
Publication of CN109495288B publication Critical patent/CN109495288B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0876Aspects of the degree of configuration automation
    • H04L41/0886Fully automatic configuration

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Automation & Control Theory (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a service deployment method and device. Wherein, the method comprises the following steps: sending a first command to the target client according to the first identity identification number ID, wherein the first command is used for capturing the IP of the target client; sending query information to a CMDB site, wherein the query information carries a first network Interconnection Protocol (IP), and after receiving the query information, the CMDB site generates a query result according to the query information and sends the query result to a first server; generating a first configuration file according to a query result returned by the CMDB site; sending a first configuration file to a target client, wherein the first configuration file is used for replacing an original configuration file after the target client receives the first configuration file; and sending a second command to the target client, wherein the second command is used for restarting the target service of the target client. The method and the device solve the technical problem that the client cannot automatically install the operating system configuration management program in the prior art.

Description

Service deployment method and device
Technical Field
The application relates to the field of internet, in particular to a service deployment method and device.
Background
Some companies use salt as a batch deployment management tool, and managed clients need to install a salt-minus (operating system configuration management) program, in a configuration file of which the pointed master address needs to be filled in, and the minus _ id uniquely represented by the client. This means that the configuration files of each server are different, which makes it difficult to install and deploy in batches. In the current deployment and installation method, a server asset list of a salt-Management system and a CMDB (Configuration Management Database) system is first subtracted to find a server that exists in the CMDB but does not exist in the salt-Management key library, and a list of servers where salt-mining is not installed is obtained. And traversing the server list needing to install salt-mining by calling a script, inquiring the unique configuration corresponding to each server in the CMDB one by one according to the ip of each server, and sending the configurations to the target server through ssh for installation and configuration.
The method in the prior art is complex and not automatic enough, and cannot realize the full-automatic installation and the state of salt-precipitation configuration of the client.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the application provides a service deployment method and device, which are used for at least solving the technical problem that a client cannot automatically install an operating system configuration management program in the prior art.
According to an aspect of an embodiment of the present application, there is provided a service deployment method, including: sending a first command to a target client according to a first identity number (ID) so that the target client sends a first Internet Protocol (IP) to a first server after receiving the first command, wherein the first command is used for grabbing the IP of the target client, the ID of the target client in a configuration file of the target client is designated as the first identity number (ID), a server pointed by the target client is designated as the first server, and the first IP is the IP of the target client; sending query information to a CMDB site, wherein the query information carries the first network interconnection protocol IP, so that after the CMDB site receives the query information, a query result is generated according to the query information, and the query result is sent to the first server; generating a first configuration file according to the query result returned by the CMDB site; sending the first configuration file to the target client, so that the target client replaces the original configuration file with the first configuration file after receiving the first configuration file; and sending a second command to the target client, wherein the second command is used for restarting the target service of the target client.
Further, generating a first configuration file according to the query result returned by the CMDB site, including: extracting a second IP and a second ID in the query result, wherein the second IP is the IP of the server pointed by the target client indicated by the query result, and the second ID is the ID of the target client indicated by the query result; and generating the first configuration file according to the second IP and the second ID.
Further, sending a first command to the target client according to the first identity number ID, including: searching a client with the ID as the first identity identification number ID in a plurality of clients; the found client is used as the target client; and sending the first command to the target client.
Further, after sending the second command to the target client, the method further comprises: and deleting the target client in the management control list of the first server.
Further, after deleting the target client in the management control list of the first server, the method further comprises: searching a client with the ID as the first identity identification number ID in a plurality of clients; and under the condition of successful searching, the searched client is taken as the target client, and the first command is sent to the target client according to the first identity identification number ID.
According to another aspect of the embodiments of the present application, there is also provided a service deployment apparatus, including: a first sending unit, configured to send a first command to a target client according to a first identity number ID, so that the target client sends a first internet protocol IP to a first server after receiving the first command, where the first command is used to grab the IP of the target client, an ID of the target client in a configuration file of the target client is specified as the first identity number ID, and a server pointed by the target client is specified as the first server, where the first internet protocol IP is the IP of the target client; a second sending unit, configured to send query information to a CMDB site, where the query information carries the first internet protocol IP, so that after the CMDB site receives the query information, a query result is generated according to the query information, and the query result is sent to the first server; the generating unit is used for generating a first configuration file according to the query result returned by the CMDB site; a third sending unit, configured to send the first configuration file to the target client, so that after the target client receives the first configuration file, the target client replaces an original configuration file with the first configuration file; a fourth sending unit, configured to send a second command to the target client, where the second command is used to restart a target service of the target client.
Further, the generation unit includes: an extracting subunit, configured to extract a second IP and a second ID in the query result, where the second IP is an IP of a server to which the target client indicated by the query result points, and the second ID is an ID of the target client indicated by the query result; a generating subunit, configured to generate the first configuration file according to the second IP and the second ID.
Further, the first transmitting unit includes: a searching subunit, configured to search, among the multiple clients, a client whose ID is the first identity number ID; a determining subunit, configured to use the found client as the target client; and the sending subunit is configured to send the first command to the target client.
Further, the apparatus further comprises: and the deleting unit is used for deleting the target client in the management control list of the first server after the fourth sending unit sends the second command to the target client.
Further, the apparatus further comprises: a searching unit configured to search, among the plurality of clients, a client whose ID is the first identity number ID after the deleting unit deletes the target client in the management control list of the first server; and the determining unit is used for taking the searched client as the target client under the condition of successful searching, and sending the first command to the target client according to the first identity identification number ID.
In the embodiment of the application, for a client which is just opened by using a template, an initial template is modified, an operating system configuration management service is installed in the template in advance, the ID of the client in a configuration file is designated as a first identity number ID with a fixed name, and the IP of a server to which the client points is designated as the IP of a fixed first server. The first server sends a first command for grabbing the IP of the target client to the target client, and the target client sends a first Internet Protocol (IP) to the first server after receiving the first command. The first server sends query information to the CMDB site after receiving the first network interconnection protocol IP, wherein the query information carries the first network interconnection protocol IP, and the CMDB site generates a query result according to the query information after receiving the query information and sends the query result to the first server. And the first server receives the query result returned by the CMDB site and generates a first configuration file according to the query result. The first server sends the first configuration file to the target client, wherein the first configuration file is used for replacing the original configuration file after the target client receives the first configuration file. And the first server sends a second command to the target client, wherein the second command is used for restarting the target service of the target client. And the target client restarts own target service after receiving the second command, so that the server pointed by the target client is changed from the original first server into the server represented by the second IP, the server is separated from the first server, and the server represented by the second IP manages the target server next, thereby achieving the technical effect of automatically installing the operating system configuration management program by the client and further solving the technical problem that the client cannot automatically install the operating system configuration management program in the prior art.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a flow chart of a method of service deployment according to an embodiment of the present application;
fig. 2 is a schematic diagram of a service deployment apparatus according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above 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 application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In accordance with an embodiment of the present application, there is provided an embodiment of a service deployment method, it should be noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer-executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
Fig. 1 is a flowchart of a service deployment method according to an embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
step S102, a first command is sent to the target client according to the first ID, so that after the target client receives the first command, a first network interconnection protocol IP is sent to the first server, wherein the first command is used for capturing the IP of the target client, the ID of the target client in the configuration file of the target client is designated as a first identity number ID, the server pointed by the target client is designated as the first server, and the first network interconnection protocol IP is the IP of the target client.
Step S104, sending query information to the CMDB site, wherein the query information carries a first network Interconnection Protocol (IP), so that after the CMDB site receives the query information, a query result is generated according to the query information, and the query result is sent to the first server.
And step S106, generating a first configuration file according to the query result returned by the CMDB site.
Step S108, sending the first configuration file to the target client, so that the target client replaces the original configuration file with the first configuration file after receiving the first configuration file.
Step S110, sending a second command to the target client, where the second command is used to restart the target service of the target client. The target service may be an operating system configuration management (salt-management) service.
In the embodiment of the application, for a client which is just opened by using a template, an initial template is modified, an operating system configuration management service is installed in the template in advance, the ID of the client in a configuration file is designated as a first identity number ID with a fixed name, and the IP of a server to which the client points is designated as the IP of a fixed first server. The first server sends a first command for grabbing the IP of the target client to the target client, and the target client sends a first Internet Protocol (IP) to the first server after receiving the first command. The first server sends query information to the CMDB site after receiving the first network interconnection protocol IP, wherein the query information carries the first network interconnection protocol IP, and the CMDB site generates a query result according to the query information after receiving the query information and sends the query result to the first server. And the first server receives the query result returned by the CMDB site and generates a first configuration file according to the query result. The first server sends the first configuration file to the target client, wherein the first configuration file is used for replacing the original configuration file after the target client receives the first configuration file. And the first server sends a second command to the target client, wherein the second command is used for restarting the target service of the target client. And the target client restarts the target service after receiving the second command, so that the server pointed by the target client is changed from the original first server into the server represented by the second IP, the server is separated from the first server, and the server represented by the second IP manages the target server next, thereby solving the technical problem that the client cannot automatically install the operating system configuration management program and achieving the technical effect of automatically installing the operating system configuration management program by the client.
Optionally, generating a first configuration file according to the query result returned by the CMDB site includes: extracting a second IP and a second ID in the query result, wherein the second IP is the IP of the server pointed by the target client indicated by the query result, and the second ID is the ID of the target client indicated by the query result; and generating a first configuration file according to the second IP and the second ID. Optionally, after sending the second command to the target client, the method further includes: and deleting the target client in the management control list of the first server.
According to the original configuration file of the target client, the server pointed by the target client is a first server, and the first server manages the target client.
The first server sends query information to the CMDB site, wherein the query information carries a first network interconnection protocol IP, after the CMDB site receives the query information, a second IP and a second ID which are associated with the first network interconnection protocol IP are searched in a preset database, a query result is generated according to the second IP and the second ID, and the query result is sent to the first server.
And after receiving the query result, the first server extracts a second IP and a second ID in the query result, and generates a first configuration file according to the second IP and the second ID. The first server sends the first configuration file to the target client. And after the target client receives the first configuration file, replacing the original configuration file with the first configuration file. Thus, after restarting the target service of the target client, the target client is no longer managed by the first server (i.e., the target client is out of relationship with the first server), but rather is managed by the server represented by the second IP. And then deleting the target client in the management control list of the first server.
Optionally, sending a first command to the target client according to the first identity number ID includes: searching a client with the ID as the first identity identification number ID in a plurality of clients; the found client is used as a target client; and sending the first command to the target client.
Optionally, after deleting the target client in the management control list of the first server, the method further includes: searching a client with the ID as the first identity identification number ID in a plurality of clients; and under the condition of successful searching, the searched client is taken as a target client, and a first command is sent to the target client according to the first identity identification number ID.
The embodiment of the application provides a service deployment method implemented circularly. After the first server deletes the original target client in the management control list, there may be a new target client. The new target client also establishes a connection with the first server using the first identity number ID.
After deleting the target client in the management control list of the first server, searching the client with the ID of the first identity identification number ID in the plurality of clients, if the searching fails, indicating that no new target client exists temporarily, and under the condition, continuing the searching; and under the condition of successful searching, the searched client is used as a new target client, and a first command is sent to the new target client according to the first identity identification number ID. The first command is used for capturing the IP of a new target client, wherein the ID of the new target client in the configuration file of the new target client is designated as a first identity number ID, the server pointed by the new target client is designated as a first server, and the new target client sends a first internet protocol IP to the first server after receiving the first command. The first server sends query information to the CMDB site, wherein the query information carries a first network Interconnection Protocol (IP), and after receiving the query information, the CMDB site generates a query result according to the query information and sends the query result to the first server. And the first server generates a first configuration file according to the query result returned by the CMDB site. The first server sends the first configuration file to the new target client, wherein the first configuration file is used for replacing the original configuration file after the new target client receives the first configuration file. And the first server sends a second command to the new target client, wherein the second command is used for restarting the target service of the new target client.
This scheme includes 3 parts:
initial configuration of a system opening template:
the initial template of the centros server is modified, the salt-minus (target service) is installed in the template in advance, and the minus _ ID in the configuration file is assigned with the fixed name "none" (first identity ID), and the master _ ip is assigned with the ipx.x.x.x.x of a fixed salt-master, in which we name this initial master (first server) as "previous master". After this configuration, a new centros server is opened, and a minus called "nenname" is added to the client list of the initial master.
Special configuration query module
The module is deployed in a CMDB site, wherein a salt configuration file is recorded in the CMDB for each IP, the values of two fields of master _ IP and minus _ ID to be used are pre-stored, an external http interface is opened by the module, a post request from other servers can be received, the value of the 'IP' field (a first internet interconnection protocol IP) in post data is extracted, the corresponding values of the master _ IP (a second IP) and the minus _ ID (a second ID) are inquired in a database of the CMDB, and the following styles are collated and returned:
{‘master_ip’:1.1.1.1,‘minion_id’:‘xxxxx’}
minion configuration module
The module is deployed on a former master and continuously executes in a circulating way:
1) and calling salt, and assigning a client (target client) with the minus _ id of 'nenname' to issue a command for capturing the client IP.
2) And obtaining an IP (first identity identification number ID) of a nonename (target client), arranging the IP into data { "IP": x.x.x.x }, and sending post to an http api provided by the special configuration query module to obtain a query result returned by the api.
3) And generating a unique mini configuration file (a first configuration file) by using jinja according to the master _ IP (second IP) and the mini _ ID (second ID) returned by the api in the step 2.
4) Calling salt, and assigning the client with the minus _ id of 'nenname' to send the configuration file (first configuration file) to replace the original file of the minus.
5) Calling salt, assigning a shell command (second command) to a client with the minus _ id of 'nenname', and restarting the salt-minus service (target service) by using the service. After this step is completed, the appointment goes to the new master with the new id for management and is disassociated from the previous master.
6) And calling a salt-key command of the master local machine at the early stage, and deleting the minus named as the nenname in the control list.
7) And when the step 6 is finished, repeating the step 1 and repeating the steps. Since the current master deleted this nenname, and there were still other centros machines that just started using the template, it is also possible to use the name of the nenname to associate with this previous master.
The prior art method is complex and not automatic enough, and cannot realize the full-automatic installation and the state of salt-termination configuration of the server. The service deployment method provided by the embodiment of the application does not need to be remote, and also does not need to specially acquire an ip list without salt-minus, so that the server configures the minus _ id and the master _ ip of the server, the full automation is completed, an external program intervention-free minus deployment mode is not needed, the problem that each minus needs a batch configuration of the unique minus _ id and the master _ ip of the server is solved, and meanwhile, the configuration on the minus and the record in the CMDB are kept unified.
The embodiment of the application also provides a service deployment device, which is used for executing the service deployment method, and the service deployment method is implemented according to the service deployment device.
As shown in fig. 2, the service deployment apparatus includes: a first transmission unit 10, a second transmission unit 20, a generation unit 30, a third transmission unit 40, and a fourth transmission unit 50.
A first sending unit 10, configured to send a first command to the target client according to the first identity number ID, so that after receiving the first command, the target client sends a first internet protocol IP to the first server, where the first command is used to grab the IP of the target client, where the ID of the target client in the configuration file of the target client is designated as the first identity number ID, and the server pointed by the target client is designated as the first server, where the first internet protocol IP is the IP of the target client.
And a second sending unit 20, configured to send query information to the CMDB site, where the query information carries a first network interconnection protocol IP, so that after the CMDB site receives the query information, the CMDB site generates a query result according to the query information, and sends the query result to the first server.
And the generating unit 30 is used for generating a first configuration file according to the query result returned by the CMDB site.
The third sending unit 40 is configured to send the first configuration file to the target client, so that after the target client receives the first configuration file, the target client replaces the original configuration file with the first configuration file.
And a fourth sending unit 50, configured to send a second command to the target client, where the second command is used to restart the target service of the target client.
Optionally, the generating unit 30 includes: extracting the subunit and generating the subunit. And the extracting subunit is used for extracting a second IP and a second ID in the query result, wherein the second IP is the IP of the server pointed by the target client indicated by the query result, and the second ID is the ID of the target client indicated by the query result. And the generating subunit is used for generating a first configuration file according to the second IP and the second ID.
Optionally, the first sending unit 10 includes: searching the sub-unit, determining the sub-unit and sending the sub-unit. And the searching subunit is used for searching the client with the ID as the first identity identification number ID in the plurality of clients. And the determining subunit is used for taking the found client as a target client. And the sending subunit is used for sending the first command to the target client.
Optionally, the apparatus further comprises: and a deletion unit. A deleting unit, configured to delete the target client in the management control list of the first server after the fourth sending unit 50 sends the second command to the target client.
Optionally, the apparatus further comprises: the device comprises a searching unit and a determining unit. And the searching unit is used for searching the client with the ID being the first identity identification number ID in the plurality of clients after the deleting unit deletes the target client in the management control list of the first server. And the determining unit is used for taking the searched client as a target client under the condition of successful searching, and sending a first command to the target client according to the first identity identification number ID.
The service deployment apparatus includes a processor and a memory, the first sending unit 10, the second sending unit 20, the generating unit 30, the third sending unit 40, the fourth sending unit 50, and the like are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can set one or more, and the target service is automatically deployed at the client by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the application provides a storage medium on which a program is stored, which when executed by a processor implements the service deployment method.
The embodiment of the application provides a processor, wherein the processor is used for running a program, and the service deployment method is executed when the program runs.
The embodiment of the application provides equipment, the equipment comprises a processor, a memory and a program which is stored on the memory and can run on the processor, and the following steps are realized when the processor executes the program:
sending a first command to a target client according to a first identity identification number (ID) so that the target client sends a first network Interconnection Protocol (IP) to a first server after receiving the first command, wherein the first command is used for capturing the IP of the target client, the ID of the target client in a configuration file of the target client is designated as the first identity identification number (ID), and a server pointed by the target client is designated as the first server; sending query information to a CMDB site, wherein the query information carries a first network Interconnection Protocol (IP), so that after the CMDB site receives the query information, a query result is generated according to the query information, and the query result is sent to a first server; generating a first configuration file according to a query result returned by the CMDB site; sending a first configuration file to a target client so that the target client replaces the original configuration file with the first configuration file after receiving the first configuration file; and sending a second command to the target client, wherein the second command is used for restarting the target service of the target client.
Extracting a second IP and a second ID in the query result, wherein the second IP is the IP of the server pointed by the target client indicated by the query result, and the second ID is the ID of the target client indicated by the query result; and generating a first configuration file according to the second IP and the second ID.
Searching a client with the ID as the first identity identification number ID in a plurality of clients; the found client is used as a target client; and sending the first command to the target client.
And deleting the target client in the management control list of the first server.
Searching a client with the ID as the first identity identification number ID in a plurality of clients; and under the condition of successful searching, the searched client is taken as a target client, and a first command is sent to the target client according to the first identity identification number ID.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
sending a first command to a target client according to a first identity number (ID) so that the target client sends a first network Interconnection Protocol (IP) to a first server after receiving the first command, wherein the first command is used for capturing the IP of the target client, the ID of the target client in a configuration file of the target client is designated as the first identity number (ID), a server pointed by the target client is designated as the first server, and the target client sends the first IP to the first server after receiving the first command; sending query information to a CMDB site, wherein the query information carries a first network Interconnection Protocol (IP), so that after the CMDB site receives the query information, a query result is generated according to the query information, and the query result is sent to a first server; generating a first configuration file according to a query result returned by the CMDB site; sending a first configuration file to a target client so that the target client replaces the original configuration file with the first configuration file after receiving the first configuration file; and sending a second command to the target client, wherein the second command is used for restarting the target service of the target client.
Extracting a second IP and a second ID in the query result, wherein the second IP is the IP of the server pointed by the target client indicated by the query result, and the second ID is the ID of the target client indicated by the query result; and generating a first configuration file according to the second IP and the second ID.
Searching a client with the ID as the first identity identification number ID in a plurality of clients; the found client is used as a target client; and sending the first command to the target client.
And deleting the target client in the management control list of the first server.
Searching a client with the ID as the first identity identification number ID in a plurality of clients; and under the condition of successful searching, the searched client is taken as a target client, and a first command is sent to the target client according to the first identity identification number ID.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (8)

1. A method for service deployment, comprising:
sending a first command to a target client according to a first identity number (ID) so that the target client sends a first Internet Protocol (IP) to a first server after receiving the first command, wherein the first command is used for grabbing the IP of the target client, the ID of the target client in a configuration file of the target client is designated as the first identity number (ID), a server pointed by the target client is designated as the first server, and the first IP is the IP of the target client;
sending query information to a CMDB (configuration management database) site, wherein the query information carries the first IP (internet protocol), so that after the CMDB site receives the query information, a query result is generated according to the query information, and the query result is sent to the first server;
generating a first configuration file according to the query result returned by the CMDB site, wherein the generating of the first configuration file according to the query result returned by the CMDB site comprises the following steps: extracting a second IP and a second ID in the query result, wherein the second IP is the IP of the server pointed by the target client indicated by the query result, and the second ID is the ID of the target client indicated by the query result; generating the first configuration file according to the second IP and the second ID;
sending the first configuration file to the target client, so that the target client replaces the original configuration file with the first configuration file after receiving the first configuration file;
and sending a second command to the target client, wherein the second command is used for restarting the target service of the target client.
2. The method of claim 1, wherein sending the first command to the target client based on the first identity number, ID, comprises:
searching a client with the ID as the first identity identification number ID in a plurality of clients;
the found client is used as the target client;
and sending the first command to the target client.
3. The method of claim 1, wherein after sending the second command to the target client, the method further comprises:
and deleting the target client in the management control list of the first server.
4. The method of claim 3, wherein after deleting the target client in the first server's management control list, the method further comprises:
searching a client with the ID as the first identity identification number ID in a plurality of clients;
and under the condition of successful searching, the searched client is taken as the target client, and the first command is sent to the target client according to the first identity identification number ID.
5. A service deployment apparatus, comprising:
a first sending unit, configured to send a first command to a target client according to a first identity number ID, so that the target client sends a first internet protocol IP to a first server after receiving the first command, where the first command is used to grab the IP of the target client, an ID of the target client in a configuration file of the target client is specified as the first identity number ID, and a server pointed by the target client is specified as the first server, where the first internet protocol IP is the IP of the target client;
a second sending unit, configured to send query information to a CMDB site, where the query information carries the first internet protocol IP, so that after the CMDB site receives the query information, a query result is generated according to the query information, and the query result is sent to the first server;
a generating unit, configured to generate a first configuration file according to the query result returned by the CMDB site, where the generating unit includes: an extracting subunit, configured to extract a second IP and a second ID in the query result, where the second IP is an IP of a server to which the target client indicated by the query result points, and the second ID is an ID of the target client indicated by the query result; a generating subunit, configured to generate the first configuration file according to the second IP and the second ID;
a third sending unit, configured to send the first configuration file to the target client, so that after the target client receives the first configuration file, the target client replaces an original configuration file with the first configuration file;
a fourth sending unit, configured to send a second command to the target client, where the second command is used to restart a target service of the target client.
6. The apparatus of claim 5, wherein the first sending unit comprises:
a searching subunit, configured to search, among the multiple clients, a client whose ID is the first identity number ID;
a determining subunit, configured to use the found client as the target client;
and the sending subunit is configured to send the first command to the target client.
7. A storage medium characterized by comprising a stored program, wherein the program executes the service deployment method of any one of claims 1 to 4.
8. A processor, configured to execute a program, wherein the program executes to perform the service deployment method of any one of claims 1 to 4.
CN201710827026.7A 2017-09-13 2017-09-13 Service deployment method and device Active CN109495288B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710827026.7A CN109495288B (en) 2017-09-13 2017-09-13 Service deployment method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710827026.7A CN109495288B (en) 2017-09-13 2017-09-13 Service deployment method and device

Publications (2)

Publication Number Publication Date
CN109495288A CN109495288A (en) 2019-03-19
CN109495288B true CN109495288B (en) 2022-01-25

Family

ID=65689086

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710827026.7A Active CN109495288B (en) 2017-09-13 2017-09-13 Service deployment method and device

Country Status (1)

Country Link
CN (1) CN109495288B (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106487560A (en) * 2015-08-31 2017-03-08 北京国双科技有限公司 A kind of acquisition method of server configuration information, apparatus and system
CN105553741A (en) * 2015-12-28 2016-05-04 江苏省电力公司信息通信分公司 Automatic deployment method for application system based on cloud computing
CN105681113A (en) * 2016-03-29 2016-06-15 浪潮软件集团有限公司 Automatic operation and maintenance method based on SaltStack
CN106027299B (en) * 2016-05-20 2019-11-15 盛趣信息技术(上海)有限公司 FTP client FTP automatic installation method and system, unattended equipment room
CN106777079A (en) * 2016-12-13 2017-05-31 苏州蜗牛数字科技股份有限公司 A kind of daily record data Visualized Analysis System and method
CN107066880A (en) * 2017-04-13 2017-08-18 携程旅游信息技术(上海)有限公司 The management method and system of desktop terminal

Also Published As

Publication number Publication date
CN109495288A (en) 2019-03-19

Similar Documents

Publication Publication Date Title
CN109542529B (en) Function name-based point burying method and device, computer equipment and storage medium
CN108897527B (en) Docker mirror image automatic dynamic construction method for remote sensing image processing in cloud computing
CN110389766B (en) HBase container cluster deployment method, system, equipment and computer readable storage medium
CN107566518B (en) Method and device for managing equipment information in file installation process
CN111225064A (en) Ceph cluster deployment method, system, device and computer-readable storage medium
CN110868763A (en) Method, device and system for establishing Bluetooth connection
CN113590169B (en) Application deployment method, application deployment system, and computer-readable storage medium
CN111800468A (en) Cloud-based multi-cluster management method, device, medium and electronic equipment
CN115357198B (en) Mounting method and device of storage volume, storage medium and electronic equipment
CN111399764A (en) Data storage method, data reading device, data storage equipment and data storage medium
CN109558143B (en) Method and device for deploying applications in cluster
CN115328529B (en) Application management method and related equipment
CN114443294B (en) Big data service component deployment method, system, terminal and storage medium
CN111984259A (en) Interface creating method, device, equipment and storage medium
EP4162649B1 (en) Stable references for network function life cycle management automation
CN109495288B (en) Service deployment method and device
CN111147226B (en) Data storage method, device and storage medium
CN113821333A (en) Android application program migration method and device
CN112559118A (en) Application data migration method and device, electronic equipment and storage medium
CN108763471B (en) Method and system for deploying HTTP file server in cluster
CN108804403B (en) Method and device for realizing service chart
CN113608831B (en) Plug-in instance management method, system, storage medium and equipment
CN107547607B (en) Cluster migration method and device
CN109495287B (en) Service deployment method and device
CN109561121B (en) Method and device for monitoring deployment

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
CB02 Change of applicant information

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: Beijing Guoshuang Technology Co.,Ltd.

Address before: 100086 Beijing city Haidian District Shuangyushu Area No. 76 Zhichun Road cuigongfandian 8 layer A

Applicant before: Beijing Guoshuang Technology Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant