CN113676502A - Application service access method, device and storage medium - Google Patents
Application service access method, device and storage medium Download PDFInfo
- Publication number
- CN113676502A CN113676502A CN202010405536.7A CN202010405536A CN113676502A CN 113676502 A CN113676502 A CN 113676502A CN 202010405536 A CN202010405536 A CN 202010405536A CN 113676502 A CN113676502 A CN 113676502A
- Authority
- CN
- China
- Prior art keywords
- service
- application
- access
- node
- nginx proxy
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 65
- 238000012544 monitoring process Methods 0.000 claims abstract description 22
- 238000001514 detection method Methods 0.000 claims description 25
- 238000012545 processing Methods 0.000 claims description 15
- 230000002159 abnormal effect Effects 0.000 claims description 14
- 230000006870 function Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 7
- 230000002093 peripheral effect Effects 0.000 description 6
- 230000000694 effects Effects 0.000 description 4
- 230000005856 abnormality Effects 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000002452 interceptive effect Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
Images
Classifications
-
- 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
-
- 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/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
- H04L67/63—Routing a service request depending on the request content or context
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Hardware Redundancy (AREA)
- Computer And Data Communications (AREA)
Abstract
The application relates to an application service access method, an application service access device and a storage medium, which belong to the technical field of computers, and the method comprises the following steps: the method comprises the steps that a pre-installed Nginx proxy service is called, so that the Nginx proxy service monitors a preset service port of an application server; when monitoring an application access request sent by a terminal based on an access address, distributing the application access request to a service providing node through a Nginx proxy service; providing service for the terminal through the service providing node; the problem that the access success rate of the application service is influenced because the application access system in the prior art can only access the application service through the Nginx proxy service by modifying the terminal access address can be solved; because the Nginx proxy service is installed in the application server to monitor the preset service port of the application server, the terminal can access the application service through the Nginx proxy service by using the access address of the application server, and the access address does not need to be modified by the terminal on the premise of ensuring load balance, so that the access success rate and efficiency of the application service are improved.
Description
Technical Field
The application relates to an application service access method, an application service access device and a storage medium, and belongs to the technical field of computers.
Background
With the development of the internet, a security service (WAS) of a web Application as an Application Server is used more and more frequently. With the increase of the access amount of the user to the server, the server has higher and higher requirements for realizing load balance and dual-computer hot standby.
A typical application service access system includes a nginnx (HTTP and reverse proxy server) server and a WAS server. The Nginx server and the WAS server are provided as independent devices, respectively. When application access is carried out, a terminal acquires an access address of an Nginx server in advance; sending an application access request to the Nginx server based on the access address; after receiving the application access request, the Nginx server allocates the application access request to each service providing node of the WAS server so as to provide corresponding application service for the terminal sending the application access request.
After the nginnx is deployed, a user needs to access the nginnx server first, so that after the nginnx is deployed, a terminal needs to modify an access address from an access address of a WAS server to an access address of the nginnx server as a nginnx server address; in case the terminal does not modify the access address, the application access of the terminal will fail.
Disclosure of Invention
The application provides an application service access method, an application service access device and a storage medium, and can solve the problem that when a certain service processing assembly is blocked, the progress of processing a service request is slow because whether the service processing assembly is blocked cannot be determined. The application provides the following technical scheme:
in a first aspect, a method for accessing an application service is provided, where the method includes:
calling a pre-installed Nginx proxy service to enable the Nginx proxy service to monitor a preset service port of the application server, wherein the preset service port is a port which is configured in the application server and used for monitoring an application access request;
when an application access request sent by a terminal based on a preset access address is monitored, the application access request is distributed to a service providing node through the Nginx proxy service; the access address corresponds to the preset service port; the service providing node is a node for providing application service;
and providing the application service for the terminal through the service providing node.
Optionally, before the invoking the pre-installed Nginx proxy service, the method further includes:
acquiring the port number of the preset service port;
and installing the Nginx proxy service, and setting the port number of the monitoring port of the Nginx proxy service as the port number of the preset service port.
Optionally, the method further comprises:
calling the Nginx proxy service to detect whether the operation of each service providing node is normal or not;
and when the service providing node with abnormal operation is detected, determining that the service providing node with abnormal operation is offline, so that the Nginx proxy service determines the service providing node for processing the application access request from other normal service providing nodes.
Optionally, the invoking the Nginx proxy service to detect whether the service providing node operates normally includes:
calling the Nginx proxy service to send a detection request to each service providing node every other preset detection duration;
determining that the service providing node is abnormal in operation when the number of times of receiving feedback information of the detection request in a preset detection duration is less than or equal to a preset number of times;
when the number of times of receiving feedback information to the detection request in a preset detection duration is larger than a preset number of times, determining that the service providing node normally operates;
and the preset detection time length is greater than the preset detection time length.
Optionally, the service providing node includes a main service node and a standby service node, the standby service node is communicatively connected to a standby Nginx proxy service created in advance, and the allocating the application access request to the service providing node through the Nginx proxy service includes:
when the operation of the main service node is abnormal, acquiring an access address of a standby Nginx proxy service through the Nginx proxy service;
sending, by the Nginx proxy service, the application access request to the standby Nginx proxy service based on the access address, such that the standby Nginx proxy service determines a service providing node from the standby service node to process the application access request based on the application access request.
Optionally, before the obtaining, by the Nginx proxy service, an access address of a standby Nginx proxy service, the method further includes:
and configuring an access address of the standby Nginx proxy service so that the Nginx proxy service can read and access the address in the running process.
Optionally, the standby service node runs in another server independent from the application server.
In a second aspect, an application service access apparatus is provided, the apparatus comprising:
the application request monitoring module is used for calling a pre-installed Nginx proxy service to monitor a preset service port of the application server, wherein the preset service port is a port which is configured in the application server and is used for monitoring an application access request;
an application request allocation module: the application access request is distributed to a service providing node through the Nginx proxy service when the application access request sent by the terminal based on the preset access address is monitored; the access address corresponds to the preset service port; the service providing node is a node for providing application service;
an application service providing module: and the service providing node is used for providing application services for the terminal.
In a third aspect, an application service access apparatus is provided, the apparatus comprising a processor and a memory; the memory has stored therein a program that is loaded and executed by the processor to implement the application service access method of the first aspect.
In a fourth aspect, there is provided a computer-readable storage medium having a program stored therein, the program being loaded and executed by the processor to implement the application service access method of the first aspect.
The beneficial effect of this application lies in: the method comprises the steps that a pre-installed Nginx proxy service is called, so that the Nginx proxy service monitors a preset service port of an application server, and the preset service port is a port which is configured in the application server and used for monitoring an application access request; when monitoring an application access request sent by a terminal based on a preset access address, distributing the application access request to a service providing node through a Nginx proxy service; wherein, the access address corresponds to a preset service port; the service providing node is a node for providing application service; providing application service for the terminal through the service providing node; the problem that the access success rate of the application service is influenced because the application service can be accessed through the Nginx proxy service only by modifying the access address of the terminal in the conventional application access system can be solved; because the Nginx proxy service is installed in the application server to monitor the preset service port of the application server, the terminal can access the application service through the Nginx proxy service by using the access address of the application server, and on the premise of ensuring the load balancing effect, the terminal does not need to modify the access address, so that the access success rate and efficiency of the application service are improved.
The foregoing description is only an overview of the technical solutions of the present application, and in order to make the technical solutions of the present application more clear and clear, and to implement the technical solutions according to the content of the description, the following detailed description is made with reference to the preferred embodiments of the present application and the accompanying drawings.
Drawings
FIG. 1 is a schematic diagram of an application service access system according to an embodiment of the present application;
FIG. 2 is a flow chart of an application service access method provided by an embodiment of the present application;
FIG. 3 is a block diagram of an application service access device according to an embodiment of the present application
FIG. 4 is a block diagram of an application service access device provided by one embodiment of the present application;
FIG. 5 is a block diagram of an application service access device provided by one embodiment of the present application;
Detailed Description
The following detailed description of embodiments of the present application will be described in conjunction with the accompanying drawings and examples. The following examples are intended to illustrate the present application but are not intended to limit the scope of the present application.
First, several terms related to the present application will be described below.
Nginx (high performance HTTP and reverse proxy web server): nginx publishes the source code in the form of a BSD-like license. The BSD license is a license that allows public to use open source code, that is, the public can freely configure the Nginx proxy service when using the Nginx proxy service. After the Nginx is started, a master process and a plurality of worker processes are carried out, wherein the master process and the worker processes comprise: and receiving a signal from the outside, sending a signal to each worker process, monitoring the running state of the worker process, and automatically starting a new worker process after the worker process exits (under an abnormal condition). The master process serves as an interactive interface between the whole process group and a user, monitors the process, and realizes functions of restarting service, managing log files, enabling configuration files to take effect in real time and the like by managing the worker process.
Security service for Web Application Server (WAS): the system is a safety service aiming at the web application program, and provides a targeted safety solution based on the characteristics of the overall architecture of an application system and the personalized requirements of the application system. It is a common structure that a Web server cooperates with a WAS server to distribute requests, and the Web server transfers received requests to the WAS through a connector.
A WAS cluster is a collection of multiple WAS servers that participate in workload management, with the cluster being responsible for balancing the workload among the servers.
Hot standby of double machines: the solution scheme is applied to the server, the host and the slave are connected through a TCP/IP network, when the host is in a working state, the slave is in a monitoring state, and whether the operation of each node of the host is normal or not is monitored. Once the slave finds the abnormality of the master, the slave replaces the master to realize the function of the master and provide service for the access request.
Hash (Hash) result: the general translation is hashing, or transliteration into a hash, which is to transform an input of arbitrary length (also called pre-mapped pre-image) into an output of fixed length by a hashing algorithm, where the output is a hash value. This conversion is a kind of compression mapping, i.e. the space of hash values is much smaller than the space of inputs, different inputs will hash to the same output. In summary, the Hash result is a function that compresses messages of arbitrary length to a message digest of some fixed length.
Session hold (Session hold): a session in a computer refers specifically to the time interval between an end user communicating with an interactive system, typically the time elapsed from the registration of the system into the system to the logoff of the system out of the system. Session is actually a specific notion of time. Session maintenance means that when load balancing is performed to distribute requests, each client is guaranteed to have fixed access to the same application server at the back end.
JAVA server pages (JavaServerPages, JSP): the system is deployed on a network server, can respond to a request sent by a client, dynamically generates a Web page of a document with HTML, XML or other formats according to the content of the request, and then returns the Web page to a requester. The JSP technology takes Java language as scripting language, provides service for HTTP request of users, and can process complex service requirement together with other Java programs on the server.
Web container custom Attribute: the Web container is a service program, and a program for providing a corresponding service is provided at a port of the server, and the program is for processing a request from a client, such as a Tomcat container in JAVA, and an IIS or PWS of ASP is a container.
Fig. 1 is a schematic structural diagram of an application service access system according to an embodiment of the present application, and as shown in fig. 1, the system at least includes: application server 110, terminal 120.
The terminal 120 is used to access application services provided by the application server 110. The terminal 120 may be a device with communication capability, such as a mobile phone, a tablet computer, a computer, and a portable computer, and the present embodiment does not limit the type of the device of the terminal 120.
The terminal 120 stores an access address of the application server 110 in advance, and when an application service provided by the application server 110 needs to be accessed, an application access request is transmitted to the application server 110 based on the access address.
The application server 110 is a WAS server. In this application, the application server 110 is pre-installed with a nginnx proxy service 111, and the nginnx proxy service 111 may monitor a preset service port of the application server 110. The preset service port is configured in the application server 110 and is used for monitoring an application access request, and the access address corresponds to the preset service port. In the operation process, the application server 110 calls the Nginx proxy service 111 to monitor a preset service port of the application server 110, so as to receive an application access request sent by the terminal according to the access address.
The Nginx proxy service 111 is software (or program) running in the application server 110, and the Nginx proxy service 111 has a function of a Nginx server.
At least one service providing node is operated in the application server 110, and each service providing node is an application program operated in the application server 110 for providing an application service to a terminal.
In one example, the application server 110 is a master server in the WAS cluster for listening for application access requests. Of course, other application servers may be further included in the application service access system, and the other application servers are communicatively connected to the Nginx proxy service 111 and are used for processing the application access request distributed by the Nginx proxy service 111. Of course, at least one service providing node may also be run in each of the other application servers.
After monitoring the application access request, the Nginx proxy service 111 distributes the application access request to a service providing node in the application server 110 based on a load balancing principle; or to service providing nodes in other application servers.
In addition, in order to realize dual-server hot standby, the application service access system further comprises at least one standby server 130. The backup server 130 is also a WAS server, and the backup server 130 is pre-installed with a backup Nginx proxy service 131. The standby Nginx proxy service 131 is software that runs in the standby server 130, and has the same function as the Nginx proxy server.
The standby Nginx proxy service 131 may monitor a preset standby service port of the standby server 130; and is communicatively coupled to a Nginx proxy service 111. When an abnormality occurs in each service providing node to which the nginnx proxy service 111 is connected, the nginnx proxy service 111 may send an application access request to the standby nginnx proxy service 131, so that the standby nginnx proxy service 131 distributes the application access request to the service providing nodes in the standby server 130 based on a load balancing principle.
Of course, other standby application servers may be further included in the application service access system, and the other standby application servers are communicatively connected to the standby Nginx proxy service 111 and are used for processing the application access request distributed by the Nginx proxy service 111. Of course, at least one service providing node may also be operated in each of the other standby application servers.
In this embodiment, the preset service port of the application server 110 is monitored by installing the Nginx proxy service in the application server 110, and the terminal can access the application service through the Nginx proxy service by using the access address of the application server 110, so that the access address does not need to be modified by the terminal on the premise of ensuring the load balancing effect, and the access efficiency of the application service is improved.
In addition, by communicatively connecting the Nginx proxy service 111 with the standby server 130, a process of automatically switching the standby server when the application server 110 cannot provide services is realized, the possibility of the overall downtime of the application access system can be reduced, and the access stability of the application access system can be improved.
Fig. 2 is a flowchart of an application service access method according to an embodiment of the present application, where the present application is applied to the application service access system shown in fig. 1, and an execution subject of each step is described as an example of the application server 110 in the system. The method at least comprises the following steps:
step 201, calling a pre-installed Nginx proxy service to monitor a preset service port of an application server.
The preset service port is a port configured in the application server and used for monitoring the application access request.
The application access request is a request sent by the terminal based on an access address of the application server, and the application access request is used for requesting the application server to provide application service. The access address includes: an IP address and a port number of a preset service port.
Optionally, the application access request is sent to the application server in a message form, and the application server receives the application access request; and providing corresponding application service for the terminal sending the application access request.
In this embodiment, the nginnx proxy service needs to be installed before the pre-installed nginnx proxy service is called. The Nginx proxy service refers to a software program running in an application server, and has a function of distributing terminal access requests to achieve load balancing.
The process of installing the Nginx proxy service includes: acquiring a port number of a preset service port; installing the Nginx proxy service, and setting the port number of the monitoring port of the Nginx proxy service as the port number of the preset service port.
In one example, the port number of the preset service port may be set to 80.
Of course, in order to ensure that the Nginx proxy service provides the proxy service normally, the application server may also perform other configurations.
Such as: and acquiring terminal information such as an IP address of the terminal, and setting the terminal information as an agent message header, namely, the Nginx agent service changes a request distribution address on the agent message header of the application access request, so that the JSP can jump to a correct application server and node. The message is a sending form of the application access request, and comprises a head part and a body part. After the terminal sends out the access request, the server obtains the target IP address of the access request by identifying the message header. The Nginx proxy service changes the head part of the message, namely, the head part is a set proxy message header.
For another example: in order to ensure that the JSP can jump correctly, two Web container customization attributes are added for all service providing nodes, namely com. At least the following objectives can be achieved by setting two Web container customization attributes: 1. returning a port number from a requesting Uniform Resource Location (URL); 2. requesting the host header to return the port number reduces the likelihood of the JSP jumping to the wrong host and port.
In one example, the configuration process for the Nginx proxy service is represented by the following fields:
wherein, the "listen 80" indicates that the monitored port number is 80; "server _ name 10.10.34.60" represents the IP address of the device to which the Nginx proxy service belongs; and the proxy _ set _ headHost $ host $ server _ port represents that the terminal information is set as a proxy message header.
Optionally, in order to ensure that the access IP address and the port number of the nginnx proxy service are consistent with the IP address and the port number of the application server, when the port number of the preset server port is 80, the port number of the monitoring port of the nginnx proxy service is set to be 80; when the port number of the preset server port is not 80, for example: 9081, the port number of the Nginx proxy service listening port is changed to 9081.
Wherein, the access address corresponds to a preset service port. Such as: the access address is the IP address of the application server plus the port number of the preset server port.
Optionally, the service providing node includes a main service node and a standby service node, and the main service node is a service providing node operated in the application server and a service providing node operated in another application server; the standby service node is a service providing node operating in the standby application server and service providing nodes operating in other standby application servers. At this time, the allocating the application access request to the service providing node through the Nginx proxy service includes: when the main service providing node comprises at least one service providing node which normally operates, the application access request is distributed to the main service node which normally operates through the Nginx proxy service; when the operation of the main service node is abnormal, the access address of the standby service node is obtained through the Nginx proxy service; the application access request is assigned to the standby service node based on the access address by the Nginx proxy service such that the standby Nginx proxy service determines a service providing node from the standby service node to process the application access request based on the application access request, as shown in fig. 3. At this time, the application server needs to call the Nginx proxy service to detect whether each service providing node (main service node) operates normally; and determining the service providing node to be offline when the abnormal operation of the service providing node is detected, so that the Nginx proxy service determines the service providing node for processing the application access request from other normal service providing nodes.
The method for detecting whether the operation of the service providing node is normal by calling the Nginx proxy service comprises the following steps: calling the Nginx proxy service to send a detection request to each service providing node every other preset detection duration; determining that the service providing node is abnormal in operation when the number of times of receiving feedback information to the detection request in the preset detection duration is less than or equal to the preset number of times; when the number of times of receiving feedback information to the detection request in the preset detection duration is larger than the preset number of times, determining that the service providing node normally operates; wherein the preset detection duration is greater than the preset detection duration.
In one example, the configuration process of an application server is represented by the following fields:
the "server 10.10.34.50:80 backup" indicates a backup application server indicated by using a backup keyword, and when a main service node is unavailable, the backup application server is automatically jumped to (in this embodiment, 10.10.34.50:80 is a backup application server (or called a backup application service cluster), 4 backup service providing nodes are operated, and "IP _ hash" indicates that each application access request is allocated according to a hash result of an access IP, so that each visitor fixedly accesses one application service node, and can solve the problem of Session maintenance, and "max _ failures _ 2 _ failures _ timeout out" indicates that 2 failures occur within 5 seconds, and the state of the corresponding service providing node is set to be a down line down.
In this embodiment, when the application server node can normally operate, the terminal sends an application access request to the nginnx proxy service, and when the nginnx proxy service monitors the application access request, the application access request is distributed to the corresponding main service providing node, and the main service providing node provides a service for the application access request.
When the Nginx proxy service detects that the main service node is partially abnormal, determining the abnormal main service node as an offline; and distributing the application access request to other normal running main service nodes. In order to ensure that the Nginx proxy service successfully forwards the application access request, before the access address of the standby service providing node is obtained through the Nginx proxy service, the access address of the standby Nginx proxy service needs to be configured for the Nginx proxy service, so that the Nginx proxy service can read and access the access address in the running process.
When the primary service providing nodes all determine to be offline, the Nginx proxy service distributes (or forwards) the application to the access request to the standby Nginx proxy service. The standby Nginx proxy service distributes the access request to the standby service node which is operating normally.
Of course, the standby Nginx proxy service may also detect whether the standby service node operates normally, and the detection manner refers to the description of the Nginx proxy service, which is not described herein again in this embodiment.
It should be added that the standby service node runs in another server independent from the application server. When the application server fails, the standby service providing node replaces the main service providing node in the application server to operate, and therefore dual-computer hot standby is achieved.
And step 203, providing the application service for the terminal through the service providing node.
In summary, in the application service access method provided in this embodiment, a preset service port of an application server is monitored by invoking a pre-installed Nginx proxy service, where the preset service port is a port configured in the application server and used for monitoring an application access request; when monitoring an application access request sent by a terminal based on a preset access address, distributing the application access request to a service providing node through a Nginx proxy service; wherein, the access address corresponds to a preset service port; the service providing node is a node for providing application service; providing application service for the terminal through the service providing node; the problem that the access success rate of the application service is influenced because the application service can be accessed through the Nginx proxy service only by modifying the access address of the terminal in the conventional application access system can be solved; because the Nginx proxy service is installed in the application server to monitor the preset service port of the application server, the terminal can access the application service through the Nginx proxy service by using the access address of the application server, and on the premise of ensuring the load balancing effect, the terminal does not need to modify the access address, so that the access success rate and efficiency of the application service are improved.
In addition, the Nginx proxy service is in communication connection with the standby server, so that the process of automatically switching the standby server when the application server cannot provide the service is realized, the possibility of the overall downtime of the application access system can be reduced, and the access stability of the application access system is improved.
Fig. 4 is a block diagram of an application service access apparatus according to an embodiment of the present application, and this embodiment takes the application server 110, which is applied to the application service access system shown in fig. 1, as an example for explanation. The device at least comprises the following modules: an application request listening module 410, an application request distribution module 420 and an application service providing module 430.
An application request monitoring module 410, configured to invoke a pre-installed Nginx proxy service to monitor a preset service port of the application server, where the preset service port is a port configured in the application server and configured to monitor an application access request;
application request assignment module 420: the application access request is distributed to a service providing node through the Nginx proxy service when the application access request sent by the terminal based on the preset access address is monitored; the access address corresponds to the preset service port; the service providing node is a node for providing application service;
the application service providing module 430: and the service providing node is used for providing application services for the terminal.
For relevant details reference is made to the above-described method embodiments.
It should be noted that: in the application service access device provided in the above embodiment, when accessing an application service, only the division of the above functional modules is taken as an example, and in practical applications, the above function allocation may be completed by different functional modules according to needs, that is, the internal structure of the application service access device is divided into different functional modules to complete all or part of the above described functions. In addition, the application service access device and the application service access method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 5 is a block diagram of an application service access device, which may be the application server 110 in the application service access system shown in fig. 1, according to an embodiment of the present application. The apparatus comprises at least a processor 501 and a memory 502.
Processor 501 may include one or more processing cores such as: 4 core processors, 6 core processors, etc. The processor 501 may be implemented in at least one hardware form of a DSP (Digital signal processing), an FPGA (Field-Programmable gate array), and a PLA (Programmable logic array). The processor 501 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, processor 501 may also include an AI (Artificial Intelligence) processor for processing computational operations related to machine learning.
Memory 502 may include one or more computer-readable storage media, which may be non-transitory. Memory 502 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 502 is used to store at least one instruction for execution by processor 501 to implement the application service access methods provided by method embodiments herein.
In some embodiments, the application service access device further optionally comprises: a peripheral interface and at least one peripheral. The processor 501, memory 502 and peripheral interfaces may be connected by buses or signal lines. Each peripheral may be connected to the peripheral interface via a bus, signal line, or circuit board. Illustratively, peripheral devices include, but are not limited to: radio frequency circuit, touch display screen, audio circuit, power supply, etc.
Of course, the application service access device may also include fewer or more components, which is not limited by the embodiment.
Optionally, the present application further provides a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the application service access method of the foregoing method embodiment.
Optionally, the present application further provides a computer product, which includes a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the application service access method of the above-mentioned method embodiment.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. An application service access method, used in an application server, the method comprising:
calling a pre-installed Nginx proxy service to monitor a preset service port of the application server, wherein the preset service port is configured in the application server and used for monitoring an application access request;
when an application access request sent by a terminal based on a preset access address is monitored, the application access request is distributed to a service providing node through the Nginx proxy service; the access address corresponds to the preset service port; the service providing node is a node for providing application service;
and providing the application service for the terminal through the service providing node.
2. The method of claim 1, wherein prior to said invoking the pre-installed Nginx proxy service, further comprising:
acquiring the port number of the preset service port;
and installing the Nginx proxy service, and setting the port number of the monitoring port of the Nginx proxy service as the port number of the preset service port.
3. The method of claim 1, further comprising:
calling the Nginx proxy service to detect whether the operation of each service providing node is normal or not;
and when the service providing node with abnormal operation is detected, determining that the service providing node with abnormal operation is offline, so that the Nginx proxy service determines the service providing node for processing the application access request from other normal service providing nodes.
4. The method of claim 3, wherein said invoking the Nginx proxy service to detect whether the service providing node is operating properly comprises:
calling the Nginx proxy service to send a detection request to each service providing node every other preset detection duration;
determining that the service providing node is abnormal in operation when the number of times of receiving feedback information of the detection request in a preset detection duration is less than or equal to a preset number of times;
when the number of times of receiving feedback information to the detection request in a preset detection duration is larger than a preset number of times, determining that the service providing node normally operates;
and the preset detection time length is greater than the preset detection time length.
5. The method of claim 1, wherein the service providing nodes comprise a primary service node and a backup service node, wherein the backup service node is communicatively coupled to a pre-created backup Nginx proxy service, and wherein distributing the application access request to the service providing nodes via the Nginx proxy service comprises:
when the operation of the main service node is abnormal, acquiring an access address of a standby Nginx proxy service through the Nginx proxy service;
sending, by the Nginx proxy service, the application access request to the standby Nginx proxy service based on the access address, such that the standby Nginx proxy service determines a service providing node from the standby service node to process the application access request based on the application access request.
6. The method of claim 5, wherein prior to obtaining the access address of the standby Nginx proxy service via the Nginx proxy service, further comprising:
and configuring an access address of the standby Nginx proxy service so that the Nginx proxy service can read and access the address in the running process.
7. The method of claim 5, wherein the standby service node operates in another server that is separate from the application server.
8. An application service access apparatus, the apparatus comprising:
the application request monitoring module is used for calling a pre-installed Nginx proxy service to monitor a preset service port of the application server, wherein the preset service port is a port which is configured in the application server and is used for monitoring an application access request;
an application request allocation module: the application access request is distributed to a service providing node through the Nginx proxy service when the application access request sent by the terminal based on the preset access address is monitored; the access address corresponds to the preset service port; the service providing node is a node for providing application service;
an application service providing module: and the service providing node is used for providing application services for the terminal.
9. An application service access apparatus, comprising a processor and a memory; the memory has stored therein a program that is loaded and executed by the processor to implement the application service access method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the storage medium has stored therein a program which, when executed by a processor, is adapted to implement the application service access method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010405536.7A CN113676502B (en) | 2020-05-14 | 2020-05-14 | Application service access method, device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010405536.7A CN113676502B (en) | 2020-05-14 | 2020-05-14 | Application service access method, device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113676502A true CN113676502A (en) | 2021-11-19 |
CN113676502B CN113676502B (en) | 2024-05-14 |
Family
ID=78537133
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010405536.7A Active CN113676502B (en) | 2020-05-14 | 2020-05-14 | Application service access method, device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113676502B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103686198A (en) * | 2013-12-30 | 2014-03-26 | 优视科技有限公司 | Video data processing method, device and system |
CN105376107A (en) * | 2014-08-29 | 2016-03-02 | 腾讯科技(深圳)有限公司 | Terminal test method and proxy server |
CN109194749A (en) * | 2018-09-11 | 2019-01-11 | 福建天泉教育科技有限公司 | Monitor method, the storage medium of network request |
WO2019028683A1 (en) * | 2017-08-08 | 2019-02-14 | 深圳前海达闼云端智能科技有限公司 | Method and system for acquiring and collecting client local dns server |
-
2020
- 2020-05-14 CN CN202010405536.7A patent/CN113676502B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103686198A (en) * | 2013-12-30 | 2014-03-26 | 优视科技有限公司 | Video data processing method, device and system |
CN105376107A (en) * | 2014-08-29 | 2016-03-02 | 腾讯科技(深圳)有限公司 | Terminal test method and proxy server |
WO2019028683A1 (en) * | 2017-08-08 | 2019-02-14 | 深圳前海达闼云端智能科技有限公司 | Method and system for acquiring and collecting client local dns server |
CN109194749A (en) * | 2018-09-11 | 2019-01-11 | 福建天泉教育科技有限公司 | Monitor method, the storage medium of network request |
Non-Patent Citations (1)
Title |
---|
王思平;鲍正德;李晨曦;唐娅雯;: "基于Nginx负载均衡实现tomcat集群部署", 饮食科学, no. 06, 23 March 2019 (2019-03-23) * |
Also Published As
Publication number | Publication date |
---|---|
CN113676502B (en) | 2024-05-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11843661B2 (en) | Web service system and method | |
KR102681644B1 (en) | Blockchain message processing methods and devices, computers and readable storage media | |
CN106921754B (en) | Load balancing method, device, medium and electronic equipment of cluster system | |
CN112118315A (en) | Data processing system, method, device, electronic equipment and storage medium | |
CN112543222B (en) | Data processing method and device, computer equipment and storage medium | |
CN112260853B (en) | Disaster recovery switching method and device, storage medium and electronic equipment | |
CN112104754A (en) | Network proxy method, system, device, equipment and storage medium | |
CN111262839A (en) | Vulnerability scanning method, management equipment, node and storage medium | |
CN112346980B (en) | Software performance testing method, system and readable storage medium | |
CN115102857A (en) | Method, device, equipment and storage medium for updating client configuration data | |
CN112698838A (en) | Multi-cloud container deployment system and container deployment method thereof | |
CN114553900A (en) | Distributed block storage management system and method and electronic equipment | |
CN116805946A (en) | Message request processing method and device, electronic equipment and storage medium | |
WO2024103943A1 (en) | Service processing method and apparatus, storage medium, and device | |
CN111416851A (en) | Method for session synchronization among multiple load balancers and load balancer | |
CN113676502B (en) | Application service access method, device and storage medium | |
CN110990213A (en) | Method and device for monitoring user logs in cluster environment in real time | |
CN113660121B (en) | Information management method and device based on distributed system and computer storage medium | |
CN113946376B (en) | Load adjustment method and device, electronic equipment and storage medium | |
WO2022073401A1 (en) | Activiti-based flow chart adjustment method and apparatus, electronic device, and storage medium | |
CN115629909A (en) | Service data processing method and device, electronic equipment and storage medium | |
CN116954810A (en) | Method, system, storage medium and program product for creating container application instance | |
CN114331445A (en) | API (application programming interface), method, storage medium and electronic equipment for accessing massive users | |
CN112965763B (en) | Service processing system, method, device and storage medium | |
CN111913732A (en) | Service updating method and device, management server and storage medium |
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 |