CN110445628B - NGINX-based server and deployment and monitoring methods and devices thereof - Google Patents
NGINX-based server and deployment and monitoring methods and devices thereof Download PDFInfo
- Publication number
- CN110445628B CN110445628B CN201810410141.9A CN201810410141A CN110445628B CN 110445628 B CN110445628 B CN 110445628B CN 201810410141 A CN201810410141 A CN 201810410141A CN 110445628 B CN110445628 B CN 110445628B
- Authority
- CN
- China
- Prior art keywords
- deployment
- server
- nginx
- task
- monitoring
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 104
- 238000012544 monitoring process Methods 0.000 title claims abstract description 56
- 230000008569 process Effects 0.000 claims abstract description 63
- 238000013515 script Methods 0.000 claims description 27
- 238000004590 computer program Methods 0.000 claims description 11
- 238000004422 calculation algorithm Methods 0.000 claims description 7
- 238000012806 monitoring device Methods 0.000 claims description 6
- 238000009434 installation Methods 0.000 claims description 5
- 230000005540 biological transmission Effects 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 17
- 230000006870 function Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 7
- 238000012545 processing Methods 0.000 description 6
- 238000012423 maintenance Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 239000003795 chemical substances by application Substances 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0876—Aspects of the degree of configuration automation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
- H04L67/025—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/34—Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Automation & Control Theory (AREA)
- Information Transfer Between Computers (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention discloses a server based on NGINX and a deployment and monitoring method and device thereof, and relates to the technical field of computers. The specific embodiment comprises the following steps: the ADMIN process is used for connecting with the management server to execute corresponding tasks according to the issued task types; MASTER process for managing the lifecycle of ADMIN processes. The embodiment can realize rapid horizontal expansion and is convenient to monitor.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a server based on NGINX and a method and a device for deploying and monitoring the server.
Background
NGINX is a high-performance HTTP and reverse proxy server, and its stable and efficient performance makes its popularity higher and higher, and its role in WEB application system is shown in the following figure, and it receives HTTP request, and uses it as reverse proxy and load balancing to forward the request to back-end service application, and uses back-end service application (such as Tomcat and CGI) to process service logic, and after the processing is finished, the response information is returned in the original path.
Along with the expansion of the service, an NGINX service and a plurality of back-end service applications are generally deployed on a single server, so as to improve the service processing capability and fully utilize the server resources, and at the moment, the NGINX also plays a role of load balancing.
With the increase of the number of servers, the instances of the back-end service application are multiplied, so that the horizontal expansion is rapidly performed, the consistency of the deployment of the back-end service application instances is ensured, and each instance can be conveniently monitored, which is a considerable problem.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
there are two methods for solving the above problems at present: one is to manually deploy the servers one by one and monitor one by one; or a plurality of servers are operated to be deployed and monitored simultaneously through batch operation software. However, the probability of human misoperation is high, and the consistency of examples cannot be ensured. The time consumption is long, and the maintenance workload is large. The other is to build a set of service systems with unified deployment, and simultaneously install agent clients with unified deployment on each server, detect whether deployment tasks exist in a polling or timing mode, and execute the deployment tasks if the deployment tasks exist; and (3) building a unified monitoring service system, simultaneously installing a unified monitoring proxy client on each server, collecting monitoring information of each instance in a timing or polling mode, and reporting the monitoring information to the unified monitoring service system. However, the proxy client needs to be pre-installed and started, and update is troublesome, and once the client logic changes, the proxy client needs to be reinstalled. To ensure the connection state between the proxy client and the server, once the proxy client is unavailable, the corresponding machine needs to be screened out, then the client is started by manual operation, or a script for timing inspection is set on the server, and the client is found to be unavailable and restarted in time, but the dependence of timing tasks is additionally increased. If other services, such as service statistics, are added, a service system and a corresponding proxy client need to be developed.
Disclosure of Invention
In view of this, the embodiments of the present invention provide a server based on NGINX, and a method and apparatus for deploying and monitoring the same, which can implement rapid horizontal expansion and facilitate monitoring at the same time.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided an NGINX-based server including: the ADMIN process is used for connecting with the management server to execute corresponding tasks according to the issued task types; MASTER process for managing the lifecycle of ADMIN processes.
Optionally, the ADMIN process and the management server are TCP long connections.
Optionally, the ADMIN process includes:
the connection management module is used for executing connection with the management server;
and the execution module is used for establishing threads according to the issued task types so as to run the execution scripts of the task types.
Optionally, the execution module creates a deployment execution module and a monitoring execution module according to the issued task type;
the deployment execution module is used for executing the issued execution script of the deployment task type;
and the monitoring execution module is used for executing the issued execution script of the monitoring task type.
In addition, according to an aspect of the embodiment of the present invention, there is provided an automatic deployment method based on NGINX, including: receiving deployment task information; acquiring a downloading path to download a deployment package; and calling a local shell script to install the deployment package.
Optionally, after the completion of downloading the deployment package, the method further comprises: and checking the deployment package to determine that the download of the deployment package is normal.
Optionally, a digest algorithm is used to verify the deployment package.
Optionally, the task information is generated by the following method:
receiving application information of a user;
downloading corresponding source codes from a code warehouse according to the application information so as to compile and package the source codes;
publishing the packaged source codes to a designated directory to provide downloading;
and issuing the deployment task information to a corresponding server through the TCP long connection, and recording the task information into a database.
In addition, according to an aspect of the embodiment of the present invention, there is provided an automatic deployment apparatus based on NGINX, including: the receiving module is used for receiving the deployment task information; the downloading module is used for acquiring a downloading path to download the deployment package; and the installation module is used for calling the local shell script to install the deployment package.
Optionally, the download module is further configured to:
and checking the deployment package to determine that the download of the deployment package is normal.
Optionally, a digest algorithm is used to verify the deployment package.
Optionally, the task information is generated by the following method:
receiving application information of a user;
downloading corresponding source codes from a code warehouse according to the application information so as to compile and package the source codes;
publishing the packaged source codes to a designated directory to provide downloading;
and issuing the deployment task information to a corresponding server through the TCP long connection, and recording the task information into a database.
According to another aspect of an embodiment of the present invention, there is also provided an electronic device including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method described in any of the NGINX-based automatic deployment embodiments described above.
According to another aspect of embodiments of the present invention, there is also provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the method of any of the above-described embodiments of NGINX-based automatic deployment.
In addition, according to an aspect of the embodiment of the present invention, there is provided an automatic monitoring method based on NGINX, including: receiving monitoring task information; calling a local shell script, and collecting data information of an application server where NGINX is deployed; and sending the data information of the application server.
Optionally, the data information of the application server is transmitted in HTTP form.
According to an aspect of an embodiment of the present invention, there is provided an automatic deployment apparatus based on NGINX, including: the receiving module is used for receiving the monitoring task information; the monitoring module is used for calling the local shell script and collecting data information of the application server where the NGINX is deployed; and the sending module is used for sending the data information of the application server.
Optionally, the sending module sends the data information of the application server in an HTTP form.
According to another aspect of an embodiment of the present invention, there is also provided an electronic device including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of the NGINX-based automatic monitoring embodiments described above.
According to another aspect of an embodiment of the present invention, there is also provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the method of any of the above-described embodiments of NGINX-based automatic monitoring.
One embodiment of the above invention has the following advantages or benefits: various remote task execution clients are managed in a unified way, repeated installation on a server is reduced, and system complexity and maintenance cost are reduced; automatically managing the life cycle of the ADMIN process, and automatically restarting the ADMIN process when abnormality occurs, so that a task execution client for which the task is not required to check out a problem is not required, and meanwhile, the high efficiency and the usability of a remote task execution client are ensured; and the expansibility is increased, the new added service only needs to increase the corresponding task type, and the remote execution client does not need to be repeatedly developed.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a server architecture based on NGINX according to an embodiment of the invention;
FIG. 2 is a schematic diagram of the main flow of an automatic deployment method based on NGINX according to an embodiment of the invention;
FIG. 3 is a schematic diagram of the main flow of an NGINX-based automatic deployment method in accordance with a referenceable embodiment of the invention;
FIG. 4 is a schematic diagram of the main structure of an automatic deployment apparatus based on NGINX according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of the main flow of an automatic NGINX-based monitoring method according to an embodiment of the invention;
FIG. 6 is a schematic diagram of the main structure of an automatic monitoring device based on NGINX according to an embodiment of the present invention;
FIG. 7 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
fig. 8 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic structural diagram of a server based on NGINX according to an embodiment of the present invention, as shown in fig. 2, where the server based on NGINX includes an ADMIN process, and is configured to connect with a management server, so as to execute a corresponding task according to a task type issued. Further, after receiving the task, the ADMIN process starts the thread, and executes corresponding operation according to the type of the task.
It should be noted that the ADMIN process may perform the task according to the received task type. That is, the ADMIN process can receive and execute different types of tasks. For example: deployment tasks, monitoring tasks, acquisition tasks, and so forth.
Furthermore, the server based on the NGINX can receive the task information issued by the management server. Wherein, the task information may include: task name, task type, execution script, etc. Preferably, the NGINX-based server may record the received task information in a database.
In a specific embodiment, the working process of the NGINX-based server includes:
step one: and receiving the issued task information.
Step two: and acquiring the task type through the task information.
Step three: and creating a new thread according to the task type to execute an execution script of the task type. For example: if the task type is deployment, creating an execution script for executing deployment by the new thread. If the task type is monitoring, an execution script is created for the new thread to execute the monitoring. If the task type is acquisition, an execution script is created for the new thread to execute the acquisition, and so on.
Preferably, the ADMIN process can be exported by modifying the NGINX source code, and at the start of NGINX, the FORK is a forking function in the computer programming, and an existing process can call the FORK function to create a new process. The lifecycle of the ADMIN process is managed by the MASTER process of NGINX, and once the ADMIN process exits, the MASTER process restarts the ADMIN process, but the ADMIN process does not process the HTTP request.
Preferably, after the ADMIN process is started, a TCP long connection with the management server is started, a task issued by the management server is waited, and once the TCP long connection with the management server is disconnected, the process exits. Further, the connection between the ADMIN process and the management server may be operated by a connection management module in the ADMIN process.
In addition, it should be noted that the MASTER process of the server based on NGINX is a management process, and the lifecycle of the work process in the server of NGINX can also be managed. The MASTER process does not process HTTP requests; the WORKER process is responsible for handling HTTP requests, which the MASTER process will restart once it is abnormal.
In another embodiment, the management server connected with the ADMIN process may be built by a WEB-based development framework, and simultaneously provide a UI interface for the operation and maintenance personnel to use. The WEB development framework may be springmvc, struts, etc.
Preferably, the management server can store application information, such as application names, code warehouse addresses, server IP lists and the like, input by the user into the database.
In addition, the management server stores TCP connection initiated by ADMIN process deployed by each application server, and determines mapping relation between application (ADMIN process) and management server connection through IP address.
As an embodiment, the NGINX-based server may build task execution modules of different task types according to the different task types. Further, when the service type is newly added, the server based on the NGINX only needs to newly add an execution module of a task, and remote execution ends do not need to be repeatedly developed, so that the expandability is realized. Therefore, the invention can be seen to incorporate a decentralized remote task execution client (such as deployment, acquisition, monitoring, etc.), reducing maintenance costs.
The following specifically describes the server working process based on NGINX by taking two task types of automatic deployment and automatic monitoring as examples. It should be noted, however, that the NGINX-based server is not limited to performing deployment, monitoring task types, and may perform various other task types.
Fig. 2 is a schematic diagram of an automatic deployment method based on NGINX according to an embodiment of the present invention, and as shown in fig. 2, the automatic deployment method based on NGINX includes:
step S201, receiving deployment task information.
Wherein, before receiving the deployment task information, the MASTER process is required to start the ADMIN process.
Step S202, obtaining a download path to download the deployment package.
And step S203, calling a local shell script to install the deployment package.
As a further embodiment, after downloading the deployment package, the deployment package is checked to determine that the deployment package is downloaded normally. Further, a digest algorithm is used to verify the deployment package.
Furthermore, the automatic deployment process based on the NGINX can be realized through a deployment execution module in the ADMIN process.
Fig. 3 is a schematic diagram of the main flow of the NGINX-based automatic deployment method according to the referenceable embodiment of the present invention, including:
step S301, receiving deployment task information through TCP long connection with a management server.
The deployment task information comprises information such as a program package download address, a deployment command and the like.
Preferably, the received task information is generated (applied to the management server) by the following method:
step one: application information of a user is received.
The application information comprises information such as application names, code warehouse addresses, an application server IP list and the like.
Step two: and downloading corresponding source codes from a code warehouse according to the application information so as to compile and package the source codes.
Step three: and publishing the packaged source codes to a designated directory to provide downloading.
In an embodiment, after the packaged source code is released to the specified directory, deployment task information may be generated, where the deployment task information includes information such as a downloaded address, a task type (i.e., a deployment task), and the like.
Step four: and issuing the deployment task information to a corresponding server through the TCP long connection, and recording the task information into a database.
Step S302, obtaining a downloading path according to the task information.
Step S303, downloading the deployment package through HTTP according to the download path.
Step S304, checking whether the deployment packages are consistent, if so, proceeding to step S305, otherwise, exiting the flow.
Preferably, a digest algorithm may be employed to determine if the deployment packages are consistent. For example: adopting an MD5 algorithm, specifically, including the MD5 value of the deployment package to be downloaded in the received task information, calculating the MD5 value of the deployment package actually downloaded after downloading the deployment package according to the downloading path, and comparing the two MD5 values, if the two MD5 values are consistent, the two MD5 values are normal, namely the two MD5 values are not tampered or damaged, and if the two MD5 values are inconsistent, the two MD5 values are abnormal, namely the two MD5 values are tampered or damaged.
Step S305, calling a local shell script to install the deployment package.
Fig. 4 is an automatic deployment apparatus based on NGINX according to an embodiment of the present invention, and as shown in fig. 4, the automatic deployment apparatus based on NGINX may correspond to a deployment execution module in an ADMIN process, and includes a receiving module 401, a downloading module 402, and an installation module 403. Wherein the receiving module 401 receives deployment task information. Thereafter, the download module 402 obtains a download path to download the deployment package. Finally, the installation module 403 invokes the local shell script to install the deployment package.
It should be noted that, in the specific implementation of the automatic deployment device based on NGINX according to the present invention, the automatic deployment method based on NGINX is already described in detail above, so the description is not repeated here.
Fig. 5 is a schematic diagram of the main flow of the NGINX-based automatic monitoring method according to an embodiment of the present invention, including:
in step S501, monitoring task information is received.
Preferably, the monitoring tasks that are issued may be received over the TCP connection at regular intervals.
Wherein, before receiving the monitoring task information, the MASTER process is required to start the ADMIN process.
Step S502, calling a local shell script.
Step S503, collecting data information of the application server where the NGINX is deployed.
The data information may be various data information of the application server, such as hardware data information, application access condition, and the like.
Step S504, data information of the application server is transmitted.
Preferably, the data information of the application server may be transmitted in the form of HTTP.
It is worth to say that, the management server can issue the monitoring task at regular time, and receive the monitoring result in HTTP form, that is, the data information of the application server, and record the data information of the application server into the database, and further display the data information through the UI interface.
It should also be noted that the automatic monitoring process based on the NGINX may be implemented by a monitoring execution module in the ADMIN process.
Fig. 6 is an automatic NGINX-based monitoring device according to an embodiment of the present invention, and as shown in fig. 6, the automatic NGINX-based monitoring device may correspond to a monitoring execution module in an ADMIN process, and includes a receiving module 601, a monitoring module 602, and a sending module 603. The receiving module 601 receives the issued monitoring task information, and invokes the local shell script. The monitoring module 602 then collects data information for the application servers in which the NGINX is deployed. Finally, the transmitting module 603 transmits the data information of the application server.
It should be noted that, in the implementation of the automatic monitoring device based on NGINX according to the present invention, the foregoing description of the automatic monitoring method based on NGINX has been already detailed, so the description is not repeated here.
Fig. 7 illustrates an exemplary system architecture 700 to which the NGINX-based automatic deployment method or the NGINX-based automatic deployment apparatus of the embodiments of the present invention may be applied. Or fig. 7 illustrates an exemplary system architecture 400 to which the NGINX-based automatic monitoring method or the NGINX-based automatic monitoring apparatus of the embodiments of the present invention may be applied.
As shown in fig. 7, a system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 is the medium used to provide communication links between the terminal devices 701, 702, 703 and the server 705. The network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 705 via the network 704 using the terminal devices 701, 702, 703 to receive or send messages or the like. Various communication client applications such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 701, 702, 703.
The terminal devices 701, 702, 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 705 may be a server providing various services, such as a background management server (by way of example only) providing support for shopping-type websites browsed by users using the terminal devices 701, 702, 703. The background management server may analyze and process the received data such as the product information query request, and feedback the processing result (e.g., the target push information, the product information—only an example) to the terminal device.
It should be noted that, the automatic deployment method based on NGINX provided by the embodiment of the present invention is generally executed by the server 705, and accordingly, the automatic deployment device based on NGINX is generally disposed in the server 705.
Or the automatic monitoring method based on the NGINX provided by the embodiment of the present invention is generally executed by the server 705, and correspondingly, the automatic monitoring device based on the NGINX is generally set in the server 705.
It should be understood that the number of terminal devices, networks and servers in fig. 7 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 8, there is illustrated a schematic diagram of a computer system 800 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 8 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU) 801 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM803, various programs and data required for the operation of the system 800 are also stored. The CPU801, ROM 802, and RAM803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, mouse, etc.; an output portion 807 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 808 including a hard disk or the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. The drive 810 is also connected to the I/O interface 805 as needed. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as needed so that a computer program read out therefrom is mounted into the storage section 808 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 809, and/or installed from the removable media 811. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 801.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, as: a processor includes a receiving module, a downloading module, and an installing module. Or a processor includes a receiving module, a monitoring module, and a transmitting module. The names of these modules do not constitute a limitation on the module itself in some cases.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: receiving deployment task information; acquiring a downloading path to download a deployment package; and calling a local shell script to install the deployment package. Or receiving monitoring task information and calling a local shell script; collecting data information of an application server where NGINX is deployed; and sending the data information of the application server.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.
Claims (20)
1. A NGINX-based server, comprising:
the ADMIN process is used for connecting with the management server to execute corresponding tasks according to the issued task types; wherein, the ADMIN process does not process the HTTP request, and the WORKER process processes the HTTP request;
MASTER process for managing the lifecycle of ADMIN processes.
2. The server of claim 1, wherein the ADMIN process and the management server are TCP long connections.
3. The server of claim 1, wherein the ADMIN process comprises:
the connection management module is used for executing connection with the management server;
and the execution module is used for establishing threads according to the issued task types so as to run the execution scripts of the task types.
4. A server according to claim 3, wherein the execution module creates a deployment execution module and a monitoring execution module according to the type of task issued;
the deployment execution module is used for executing the issued execution script of the deployment task type;
and the monitoring execution module is used for executing the issued execution script of the monitoring task type.
5. A method for automatically deploying a NGINX-based server according to claim 1, comprising:
receiving deployment task information;
acquiring a downloading path to download a deployment package;
and calling a local shell script to install the deployment package.
6. The automatic deployment method of claim 5, further comprising, after downloading the deployment package:
and checking the deployment package to determine that the download of the deployment package is normal.
7. The automated deployment method of claim 6, wherein the deployment package is verified using a digest algorithm.
8. The automatic deployment method of claim 5, wherein the task information is generated by:
receiving application information of a user;
downloading corresponding source codes from a code warehouse according to the application information so as to compile and package the source codes;
publishing the packaged source codes to a designated directory to provide downloading;
and issuing the deployment task information to a corresponding server through the TCP long connection, and recording the task information into a database.
9. An automatic deployment apparatus of a NGINX-based server according to claim 1, comprising:
the receiving module is used for receiving the deployment task information;
the downloading module is used for acquiring a downloading path to download the deployment package;
and the installation module is used for calling the local shell script to install the deployment package.
10. The automatic deployment apparatus of claim 9, wherein the download module is further configured to:
and checking the deployment package to determine that the download of the deployment package is normal.
11. The automatic deployment apparatus of claim 10 wherein the deployment package is verified using a digest algorithm.
12. The automatic deployment apparatus of claim 9 wherein the task information is generated by:
receiving application information of a user;
downloading corresponding source codes from a code warehouse according to the application information so as to compile and package the source codes;
publishing the packaged source codes to a designated directory to provide downloading;
and issuing the deployment task information to a corresponding server through the TCP long connection, and recording the task information into a database.
13. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the automatic deployment method of any of claims 5-8.
14. A computer readable medium, on which a computer program is stored, characterized in that the program, when executed by a processor, implements the automatic deployment method according to any of claims 5-8.
15. A method for automatically monitoring a NGINX-based server according to claim 1, comprising:
receiving monitoring task information;
calling a local shell script, and collecting data information of an application server where NGINX is deployed;
and sending the data information of the application server.
16. The automatic monitoring method according to claim 15, wherein the data information of the application server is transmitted in the form of HTTP.
17. An automatic monitoring device of a NGINX-based server according to claim 1, comprising:
the receiving module is used for receiving the monitoring task information;
the monitoring module is used for calling the local shell script and collecting data information of the application server where the NGINX is deployed;
and the sending module is used for sending the data information of the application server.
18. The automatic monitoring apparatus of claim 17, wherein the transmission module transmits the data information of the application server in the form of HTTP.
19. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the automatic monitoring method of claim 15 or 16.
20. A computer readable medium on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the automatic monitoring method according to claim 15 or 16.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810410141.9A CN110445628B (en) | 2018-05-02 | 2018-05-02 | NGINX-based server and deployment and monitoring methods and devices thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810410141.9A CN110445628B (en) | 2018-05-02 | 2018-05-02 | NGINX-based server and deployment and monitoring methods and devices thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110445628A CN110445628A (en) | 2019-11-12 |
CN110445628B true CN110445628B (en) | 2024-01-12 |
Family
ID=68427016
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810410141.9A Active CN110445628B (en) | 2018-05-02 | 2018-05-02 | NGINX-based server and deployment and monitoring methods and devices thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110445628B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116886691B (en) * | 2023-09-08 | 2024-02-09 | 蓝思系统集成有限公司 | File management control method, device, system and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1319207A (en) * | 1999-06-30 | 2001-10-24 | 三得利株式会社 | WEB application system having management/distributed management function and mechanism for operating the same |
CN102075358A (en) * | 2010-12-31 | 2011-05-25 | 网宿科技股份有限公司 | System and method for distributing and deploying content of large-scale server cluster |
CN104408071A (en) * | 2014-10-30 | 2015-03-11 | 北京思特奇信息技术股份有限公司 | Distributive database high-availability method and system based on cluster manager |
CN105138395A (en) * | 2015-06-24 | 2015-12-09 | 江苏南亿迪纳数字科技发展有限公司 | Session management method |
CN105337787A (en) * | 2014-07-29 | 2016-02-17 | 北京奇虎科技有限公司 | Multi-server monitoring method, device and system |
CN105553731A (en) * | 2015-12-23 | 2016-05-04 | 浪潮(北京)电子信息产业有限公司 | Automatic inspection method and device |
CN106844137A (en) * | 2016-12-08 | 2017-06-13 | 腾讯科技(深圳)有限公司 | The monitoring method and device of server |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8607233B2 (en) * | 2011-04-20 | 2013-12-10 | International Business Machines Corporation | Web service management |
-
2018
- 2018-05-02 CN CN201810410141.9A patent/CN110445628B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1319207A (en) * | 1999-06-30 | 2001-10-24 | 三得利株式会社 | WEB application system having management/distributed management function and mechanism for operating the same |
CN102075358A (en) * | 2010-12-31 | 2011-05-25 | 网宿科技股份有限公司 | System and method for distributing and deploying content of large-scale server cluster |
CN105337787A (en) * | 2014-07-29 | 2016-02-17 | 北京奇虎科技有限公司 | Multi-server monitoring method, device and system |
CN104408071A (en) * | 2014-10-30 | 2015-03-11 | 北京思特奇信息技术股份有限公司 | Distributive database high-availability method and system based on cluster manager |
CN105138395A (en) * | 2015-06-24 | 2015-12-09 | 江苏南亿迪纳数字科技发展有限公司 | Session management method |
CN105553731A (en) * | 2015-12-23 | 2016-05-04 | 浪潮(北京)电子信息产业有限公司 | Automatic inspection method and device |
CN106844137A (en) * | 2016-12-08 | 2017-06-13 | 腾讯科技(深圳)有限公司 | The monitoring method and device of server |
Non-Patent Citations (1)
Title |
---|
一种Web服务器集群管理平台的设计方案;吴昌龙等;《电信技术》;20130625(第06期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN110445628A (en) | 2019-11-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11656852B2 (en) | System and method for autowiring of a microservice architecture | |
US9038059B2 (en) | Automatically targeting application modules to individual machines and application framework runtimes instances | |
CN112860282B (en) | Cluster plug-in upgrading method, device and server | |
CN113900834B (en) | Data processing method, device, equipment and storage medium based on Internet of things technology | |
CN113626036A (en) | Code integrated management method and system based on Jenkins | |
CN109828830B (en) | Method and apparatus for managing containers | |
CN117112122A (en) | Cluster deployment method and device | |
CN112596854A (en) | Method and device for continuously integrating running of assembly line | |
CN110119279B (en) | Application and upgrading method and device thereof | |
CN110445628B (en) | NGINX-based server and deployment and monitoring methods and devices thereof | |
CN111831503A (en) | Monitoring method based on monitoring agent and monitoring agent device | |
CN114185734A (en) | Cluster monitoring method and device and electronic equipment | |
CN113296828A (en) | Method, server and system for issuing application | |
CN112463251A (en) | Method and device for configuring hot publishing by uliweb framework | |
CN111897565A (en) | Data processing method, device and equipment based on Internet of things | |
CN112579247A (en) | Method and device for determining task state | |
CN113094211B (en) | Backup data processing method and device | |
CN112416698A (en) | Monitoring system expansion method and device, storage medium and electronic equipment | |
CN113805858B (en) | Method and device for continuously deploying software developed by scripting language | |
CN111488268A (en) | Dispatching method and dispatching device for automatic test | |
CN116319758A (en) | Data migration method, device, electronic equipment and readable storage medium | |
CN113138772B (en) | Construction method and device of data processing platform, electronic equipment and storage medium | |
CN112559001B (en) | Method and device for updating application | |
CN113296829A (en) | Method, device, equipment and computer readable medium for processing service | |
CN113872808B (en) | Application processing method and device |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |