CN113806008A - Cluster access method and device, electronic equipment and readable storage medium - Google Patents

Cluster access method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN113806008A
CN113806008A CN202110142397.8A CN202110142397A CN113806008A CN 113806008 A CN113806008 A CN 113806008A CN 202110142397 A CN202110142397 A CN 202110142397A CN 113806008 A CN113806008 A CN 113806008A
Authority
CN
China
Prior art keywords
cluster
address
target
page
data stream
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110142397.8A
Other languages
Chinese (zh)
Inventor
钱磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110142397.8A priority Critical patent/CN113806008A/en
Publication of CN113806008A publication Critical patent/CN113806008A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/972Access to data in other repository systems, e.g. legacy data or dynamic Web page generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Abstract

The embodiment of the invention provides a cluster access method, a cluster access device, electronic equipment and a readable storage medium. After receiving the first access request, the server determines a first actual address of a father page according to the cluster identifier contained in the path parameter of the target proxy address, accesses the target cluster according to the first actual address to obtain a first data stream and returns the first data stream to the terminal device, and the terminal device generates the father page of the target cluster according to the first data stream for a user to check the target cluster. By adopting the scheme, the link address does not need to be filtered from the first data stream and is reconstructed, the error rate is low, the efficiency is high, and the purpose of quickly accessing the target cluster is achieved.

Description

Cluster access method and device, electronic equipment and readable storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a cluster access method and device, electronic equipment and a readable storage medium.
Background
Kubernetes, a container management tool, includes a main node and a plurality of computing nodes respectively connected to the main node in a communication manner, wherein the main node is used for managing and controlling the plurality of computing nodes. A plurality of container groups are deployed in each computing node, and one or more containers for bearing applications are packaged in each container group.
A group of containers is also referred to as a flink cluster, and a flink cluster includes a master node and at least one slave node. In the running process of the Flink cluster, a user needs to access the Flink cluster to check cluster information such as the state of the Flink cluster, the running state of tasks, running logs and the like. Generally, the cluster information is carried on a Web product Interface (Web UI) of the flink cluster, which is also called a home page or a parent page of the flink cluster. In the access process, a user requests a Web UI of a flink cluster through terminal equipment, the sub-pages are accessed through clicking and the like on the Web UI, and the sub-pages refer to pages corresponding to nested links on the parent pages.
However, due to security considerations, the network of the network flink cluster where the terminal device is located is not available, and at this time, the user cannot request the Web UI of the flink cluster and cannot access the target flink cluster.
Disclosure of Invention
The embodiment of the invention provides a cluster access method, a cluster access device, electronic equipment and a readable storage medium, wherein a cluster identifier of a target cluster is used as a path parameter of a proxy address and is transmitted to a server, so that the server can obtain and return related data of the target cluster, and the aim of quickly accessing the target cluster is fulfilled.
In a first aspect, an embodiment of the present application provides a cluster access method, including:
a server receives a first access request from a terminal device, wherein the first access request is used for requesting to acquire a first data stream of a parent page of a target cluster, the first access request carries a target proxy address of the target cluster, and the parent page comprises information of the target cluster;
the server determines a first actual address of the target cluster according to the target proxy address, wherein the first actual address is an address of the target cluster in a first network, the target proxy address is an address of the target cluster in a second network, and the first network and the second network are mutually disconnected;
the server accesses the target cluster according to the first real address to acquire the first data stream;
and the server sends the first data stream to the terminal equipment.
In a possible implementation manner, the determining, by the server, the first actual address of the target cluster according to the target proxy address includes:
the server analyzes the path parameter of the target agent address to obtain the cluster identifier;
and the server determines the first actual address according to the cluster identifier.
In a possible implementation manner, after the server sends the first data stream to the terminal device, the method further includes:
the server receives a second access request carrying a first splicing address from the terminal equipment, wherein the second access request is used for requesting to access a target sub-page of the father page, and the first splicing address is formed by splicing the target proxy address and the relative address of the target sub-page;
the server acquires a second data stream according to the first splicing address;
and the server sends the second data stream to the terminal equipment.
In a possible implementation manner, the acquiring, by the server, the second data stream according to the first splicing address includes:
the server analyzes the first splicing address to obtain the target proxy address and the relative address;
the server determines the first actual address according to a target cluster identifier in the path parameter of the target proxy address;
the server splices the first actual address and the relative address to obtain a second spliced address;
and the server accesses the target cluster according to the second splicing address to acquire the second data stream.
In one possible implementation, the target sub-page is a dynamically generated sub-page based on a flink framework.
In a possible implementation manner, before the server receives the first access request from the terminal device, the method further includes:
the server receives a list request from the terminal equipment, wherein the list request is used for requesting to acquire a cluster list;
and the server sends a third data stream to the terminal equipment, wherein the third data stream is used for generating a list page containing the cluster list.
In a second aspect, an embodiment of the present application provides a cluster access method, including:
the method comprises the steps that terminal equipment displays a cluster list, wherein different clusters in the cluster list correspond to different agent addresses;
when a user selects a target cluster in the cluster list, the terminal device sends a first access request carrying the target proxy address to a server, wherein the first access request is used for requesting to access a parent page of the target cluster, and the parent page comprises information of the target cluster;
the terminal equipment receives a first data stream from the server, wherein the first data stream is used for generating the father page;
the terminal equipment generates the father page according to the first data stream;
and the terminal equipment displays the father page.
In a possible implementation manner, after the terminal device displays the parent page, the method further includes:
when a user selects a sub-page identifier of a target sub-page in the parent page, the terminal device determines a relative address of the target sub-page;
the terminal equipment splices the target proxy address and the relative address to obtain a first spliced address;
the terminal equipment sends a second access request carrying the first splicing address to the server, wherein the second access request is used for requesting to access the target sub-page;
the terminal equipment receives a second data stream from the server;
the terminal equipment generates the target sub-page according to the second data stream;
and the terminal equipment displays the target sub-page.
In one possible implementation, the target sub-page is a dynamically generated sub-page based on a flink framework.
In a possible implementation manner, the displaying, by the terminal device, the cluster list includes:
the terminal equipment sends a list request to the server, wherein the list request is used for requesting to acquire the cluster list;
the terminal equipment receives a third data stream from the server, wherein the third data stream is used for generating a list page containing the cluster list;
and the terminal equipment generates and displays the list page according to the third data stream.
In a third aspect, an embodiment of the present application provides a cluster access apparatus, including:
a receiving module, configured to receive a first access request from a terminal device, where the first access request is used to request to obtain a first data stream of a parent page of a target cluster, where the first access request carries a target proxy address of the target cluster, and the parent page includes information of the target cluster;
a processing module, configured to determine a first actual address of the target cluster according to the target proxy address, where the first actual address is an address of the target cluster in a first network, and the target proxy address is an address of the target cluster in a second network, where the first network and the second network are mutually disconnected;
an obtaining module, configured to access the target cluster according to the first real address to obtain the first data stream;
and the sending module is used for sending the first data stream to the terminal equipment.
In a possible implementation manner, the processing module is configured to analyze a path parameter of the target proxy address to obtain the cluster identifier, and determine the first actual address according to the cluster identifier.
In a feasible implementation manner, the receiving module is further configured to receive a second access request carrying a first splicing address from the terminal device after the sending module sends the first data stream to the terminal device, where the second access request is used to request to access a target sub-page of the parent page, and the first splicing address is formed by splicing the target proxy address and a relative address of the target sub-page;
the processing module is further configured to obtain a second data stream according to the first splicing address;
the sending module is further configured to send the second data stream to the terminal device.
In a feasible implementation manner, when obtaining a second data stream according to the first splicing address, the processing module is configured to parse the first splicing address to obtain the target proxy address and the relative address, determine the first actual address according to a target cluster identifier in a path parameter of the target proxy address, splice the first actual address and the relative address to obtain a second splicing address, and access the target cluster according to the second splicing address to obtain the second data stream.
In one possible implementation, the target sub-page is a dynamically generated sub-page based on a flink framework.
In a possible implementation manner, before receiving the first access request from the terminal device, the receiving module is further configured to receive a list request from the terminal device, where the list request is used to request to obtain a cluster list;
the sending module is further configured to send a third data stream to the terminal device, where the third data stream is used to generate a list page including the cluster list.
In a fourth aspect, an embodiment of the present application provides a cluster access apparatus, including:
the display module is used for displaying a cluster list, and different clusters in the cluster list correspond to different proxy addresses;
a sending module, configured to send a first access request carrying the target proxy address to a server when a user selects a target cluster in the cluster list, where the first access request is used to request to access a parent page of the target cluster, and the parent page includes information of the target cluster;
a receiving module, configured to receive a first data stream from the server, where the first data stream is used to generate the parent page;
the processing module is used for generating the father page according to the first data stream;
the display module is further used for displaying the father page.
In a possible implementation manner, after the display module displays the parent page, when a user selects a sub-page identifier of a target sub-page in the parent page, the processing module is further configured to determine a relative address of the target sub-page, and splice the target proxy address and the relative address to obtain a first spliced address;
the sending module is further configured to send a second access request carrying the first splicing address to the server, where the second access request is used to request to access the target sub-page;
the receiving module is further configured to receive a second data stream from the server;
the processing module is further configured to generate the target sub-page according to the second data stream;
the display module is further used for displaying the target sub-page.
In one possible implementation, the target sub-page is a dynamically generated sub-page based on a flink framework.
In a possible implementation manner, the sending module is further configured to send a list request to the server, where the list request is used to request to obtain the cluster list;
the receiving module is further configured to receive a third data stream from the server, where the third data stream is used to generate a list page containing the cluster list;
the display module is specifically configured to generate and display the list page according to the third data stream.
In a fifth aspect, an embodiment of the present invention provides an electronic device, including: a processor, memory, and executable instructions; wherein the executable instructions are stored in the memory and configured to be executed by the processor, the executable instructions comprising instructions for performing the method as described above in the first aspect or in various possible implementations of the first aspect.
In a sixth aspect, an embodiment of the present invention provides an electronic device, including: a processor, memory, and executable instructions; wherein the executable instructions are stored in the memory and configured to be executed by the processor, the executable instructions comprising instructions for performing the method of the second aspect or various possible implementations of the second aspect as above.
In a seventh aspect, this application embodiment provides a computer-readable storage medium, in which computer-executable instructions are stored, and when executed by a processor, the computer-executable instructions are used to implement the method in the first aspect or the various possible implementation manners of the first aspect.
In an eighth aspect, embodiments of the present application provide a computer-readable storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are executed by a processor to implement the method according to the first aspect or the various possible implementation manners of the first aspect.
In a ninth aspect, an embodiment of the present application provides a computer program product including instructions, the program product including: a computer program, stored in a readable storage medium, from which at least one processor of an electronic device can read the computer program, execution of the computer program by the at least one processor causing the electronic device to perform the method of the first aspect.
In a tenth aspect, an application embodiment provides a computer program product containing instructions, the program product comprising: a computer program, stored in a readable storage medium, from which at least one processor of an electronic device can read the computer program, execution of the computer program by the at least one processor causing the electronic device to perform the method of the second aspect.
According to the cluster access method, the cluster access device, the electronic equipment and the readable storage medium, the cluster identification of the target cluster is used as the path parameter of the proxy address and transmitted to the server, so that the server can obtain and return the relevant data of the target cluster, and the purpose of quickly accessing the target cluster is achieved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic diagram of a cluster system to which a cluster access method provided in an embodiment of the present application is applied;
fig. 2 is a flowchart of a cluster access method provided in an embodiment of the present application;
FIG. 3 is a flow chart of a cluster access method provided by another embodiment of the present application;
fig. 4 is a schematic structural diagram of a cluster access device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of another cluster access device provided in the embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The Flink is a frame and distributed stream batch integrated processing engine, and a platform product based on the Flink framework needs to accurately and conveniently display a Flink cluster state, a task running state, daily monitoring, a running log and the like in the face of different users. The native Web UI page of the flink is used as a carrier for integrating various details such as the scale of a flink cluster, the health degree, the running state of a task and the like, is a part of functions which are required by a product based on the flink framework and can be obtained at a very low cost, and therefore, research and development personnel integrate the Web UI into a platform product based on the flink framework.
In the prior art, for better management and resource isolation, Kubernets are used for container management. Kubernetes, a container management tool, includes a host node and a plurality of computing nodes each communicatively coupled to the host node. The flink cluster runs in Kubernets, and one flink cluster comprises a management node and a slave node. When a fin cluster contains a plurality of management nodes, there may be a plurality of Web UIs that result in the fin cluster, and the address of each Web UI is not fixed. For example, when a master node in a flink cluster fails, a slave node in the flink cluster replaces the failed master node, and the address of the Web UI is transformed.
However, due to security requirements, a user cannot directly access the Web UI and further cannot access nested sub-pages of the Web UI. However, it is a difficult and complicated process to open the access right of the Web UI of the flink cluster for each user.
In order to solve the problem that a user cannot access a Web UI and nested sub-pages of the Web UI, the existing solution is as follows: in the earlier stage, the Web UI is acted based on the function of an application layer, and the general idea is as follows: assuming that a network in which a cluster is located is a first network, a network in which a terminal device of a user is located is a second network, the first network and the second network are different networks, for example, the first network is located in a Virtual Private Cloud (Virtual Private Cloud), and the second network is located in another VPC, the terminal device cannot directly access a Web UI of the cluster. The address of the clustered Web UI in the first network is also referred to as a virtual address. In order to enable the terminal equipment to access the Web UI or the sub-pages, a proxy server is arranged, the Web UI of each flight cluster and the addresses of the nested sub-pages are modified in advance, and the actual Web UI address is used as a parameter of the virtual proxy address. After determining all contents of the Web UI, the proxy server filters the contents, filters out non-links in the contents, and obtains a proxy address by taking an actual address of a link (namely a sub-page) as a parameter. And then, the proxy server transforms the addresses of all the sub-pages in the Web UI into virtual proxy addresses. Therefore, in the process that the user accesses the cluster, no matter the Web UI or the sub-page is, the address is modified into the virtual proxy address in advance, and therefore the user can acquire the Web UI or the sub-page through the proxy server. The link is, for example, a link related to a nested sub page such as HyperText Markup Language (HTML).
The research shows that: the existing proxy mechanism has the following disadvantages:
1. low efficiency and low speed.
Because a plurality of sub-pages are nested in the Web UI, after the proxy server obtains the relevant data of the Web UI, the data are filtered to obtain the addresses of the sub-pages, and the addresses of the sub-pages are also modified, so that the process is time-consuming. Also, when the Web UI contents are excessive, the CPU occupancy is high.
2. The error rate is high.
When the addresses of nested sub-pages are analyzed from the data stream of the Web UI, missing situations easily occur, and when the situation is accessed by a user, situations that the sub-pages do not exist or the authority is limited easily occur.
3. The dynamic subpage is inaccessible.
For the native Web UI of the high-version flink, the addresses of some sub-pages are dynamically spliced in a js function according to the actual environment. The existing proxy mechanism can not deal with the situation because the addresses of the Web UI and the sub-pages are reformed in advance and the addresses of the dynamic sub-pages can not be taken in advance, so that a user can not access the dynamic sub-pages.
Based on this, the embodiment of the present application provides a cluster access method, which is implemented in a brand-new address resolution manner, and by transferring a cluster identifier of a target cluster to a server as a path parameter of a proxy address, so that the server can obtain and return related data of the target cluster, thereby achieving the purpose of quickly accessing the target cluster.
Fig. 1 is a schematic diagram of a cluster system to which a cluster access method provided in the embodiment of the present application is applied. Referring to fig. 1, the present application uses kubernets for container management. Kubernetes, a container management tool, includes a host node and a plurality of computing nodes each communicatively coupled to the host node. A compute node is a workload node and a master node is used to manage and control multiple compute nodes. Multiple containers are deployed in each compute node. Some of the containers are used to form flink clusters, such as flink cluster 1 and flink cluster 2 in the figure.
A flink cluster contains a manager node, also known as master node, and a slave node, also known as worker node. The number of the management nodes can be multiple, a leader (leader) node exists in the management nodes, and when the leader node fails, a standby management node can be upgraded to the leader node. Each flink cluster has a unique cluster identity.
The server is a server which provides pages such as a WeB UI and the like for the user, and the server performs address splicing and the like after receiving the access request, acquires the data stream and sends the data stream to the terminal equipment. The server may include a Web server and a proxy server, which may be integrated or separately located, the Web server and the terminal device being located in the second network, and the proxy server and the cluster being located in the first network. The Web server is used for providing contents displayed by front-end pages and the like for the terminal equipment, and the proxy server is used for accessing the target cluster and returning data streams. Unless otherwise stated, the following description is made by taking an example of an integrated configuration of a Web service and a proxy server.
Hereinafter, the cluster access method described in the embodiment of the present application is described in detail based on the architecture shown in fig. 1. For example, please refer to fig. 2, fig. 2 is a flowchart of a cluster access method provided in an embodiment of the present application, including the following steps:
201. and the terminal equipment displays the cluster list.
Wherein different clusters in the cluster list map different proxy addresses.
Illustratively, a cluster list is displayed on a display screen of the terminal device, each cluster in the cluster list corresponds to a respective proxy address, and a path parameter of the proxy address includes a cluster identifier of the cluster. The proxy address is the address of the parent page of the cluster in the second network.
202. And when the user selects the target cluster in the cluster list, the terminal equipment sends a first access request to the server.
Accordingly, the server receives the first access request.
The first access request is used for requesting to acquire a first data stream of a parent page of a target cluster, the first access request carries a target proxy address of the target cluster, and the parent page comprises information of the target cluster.
Illustratively, a user selects a target cluster in the cluster list by touching, clicking and the like, and triggers the terminal device to send a first access request to the server, where the first access request carries an agent address of the target cluster, and a path parameter of the agent address of the target cluster includes a cluster identifier of the target cluster.
203. And the server determines a first actual address of the target cluster according to the target cluster identifier in the path parameter of the target proxy address of the target cluster.
The first actual address is an address of the target cluster in a first network, the target proxy address is an address of the target cluster in a second network, and the first network and the second network are mutually disconnected.
Illustratively, the first network and the second network are not connected, which means that the first network and the second network are located in a non-passing VPC, etc. Each cluster has a unique cluster identifier, and the server can determine a first actual address of a parent page of the target cluster according to the cluster identifier of the target cluster, wherein the parent page is also called a Web UI (user interface), a home page and the like.
The destination agent address is for example: { proxy Domain }/$ { proxy App Path }/$ { cluster Id }/$ { middle Path }. The proxy Domain is a Domain name machine port of the proxy server, the proxy App Path is a proxy application Path, the cluster Id is a unique identifier (cluster identifier) of a cluster to which the Web UI belongs, and the midle Path is used as a Path buffer, so that nested addresses in the Web UI are prevented from crossing a parent page Path, and the nested addresses cannot reach the proxy.
204. And the server accesses the target cluster according to the first real address to acquire the first data stream.
After the server determines the first actual address, the server can access the target cluster to obtain a first data stream, such as a byte stream, for generating a parent page of the target cluster, where the first data stream includes non-links, and the like.
205. The server sends the first data stream to the terminal device.
Correspondingly, the terminal equipment receives the first data stream sent by the server.
206. And the terminal equipment generates the father page according to the first data stream.
207. And the terminal equipment displays a father page so that the user can view the target cluster on the father page.
Illustratively, the terminal device receives a first data stream and displays a first page of a target cluster through page rendering. Through the home page, the user can check the target cluster state, the task running state, daily monitoring, running logs and the like.
According to the cluster access method provided by the embodiment of the application, when a user accesses a target cluster, the user selects the target cluster from a cluster list displayed by a terminal device, and the terminal device is triggered to send a first access request for requesting to access a parent page of the target cluster to a server, wherein the first access request carries a target proxy address. After receiving the first access request, the server determines a first actual address of a father page according to the cluster identifier contained in the path parameter of the target proxy address, accesses the target cluster according to the first actual address to obtain a first data stream and returns the first data stream to the terminal device, and the terminal device generates the father page of the target cluster according to the first data stream for a user to check the target cluster. By adopting the scheme, the cluster identifier of the target cluster is used as the path parameter of the proxy address and transmitted to the server, so that the server can obtain and return the first data stream for generating the father page.
In the embodiment of the application, an implementation mode of a nested address in a Web UI is utilized: relative addresses, the first data stream used to generate the parent page contains links and non-links. Whenever the address of the parent page is pointed to the proxy server, then the addresses of the nested links, i.e. the addresses of the child pages, all point to the proxy server.
In the embodiment of the present application, a container management is performed by using kubernets, and a cluster is a flink cluster. There may be multiple management nodes in a flink cluster, and due to kubernets scheduling and other reasons, the master node may change, resulting in a change in the first actual address of the parent page of the target cluster. While the cluster identification of the target cluster is unchanged. Therefore, the unique cluster identifier of the target cluster is hidden in the path parameter and is transmitted as the path parameter. And the server identifies a target cluster which the user wants to access according to the cluster identifier, and determines a Web UI address of the target cluster, namely the first actual address, so as to access.
By adopting the scheme, the purpose that the server analyzes the first actual address is achieved by implicitly transmitting the relevant information of the cluster to which the flash WebUI belongs by utilizing the path parameters in the web access path.
In general, many nested addresses are exposed on the parent page of the target cluster, with different nested addresses indicating different child pages. In the existing proxy mechanism, after a first data stream of a parent page of a target cluster is acquired, the first data stream is filtered to obtain link addresses, and the link addresses are transformed into addresses accessible by a proxy server. In the following, how to access the sub-page is explained in detail. Exemplarily, referring to fig. 3, fig. 3 is a flowchart of a cluster access method according to another embodiment of the present application.
The embodiment comprises the following steps:
301. and when the user selects the sub-page identifier of the target sub-page in the parent page, the terminal equipment determines the relative address of the target sub-page.
Illustratively, a parent page is displayed on a terminal device of a user, the parent page is provided with a plurality of click-to-jump controls, and different controls represent different sub-pages. And the user touches or clicks one of the controls through a mouse to trigger the terminal equipment to automatically determine the relative address of the target sub-page. For example, the browser of the terminal device automatically determines the relative address. The relative address is an address relative to the target proxy address of the parent page. For example, the destination agent address is: { proxy Domain }/$ { proxy App Path }/$ { cluster Id }/$ { middle Path }, relative address: { realSourceRelative Path }.
302. And the terminal equipment splices the target proxy address and the relative address to obtain a first spliced address.
Continuing to take the target agent address as: { proxy Domain }/$ { proxy App Path }/$ { cluster Id }/$ { middle Path }, relative address: { realSourceRelative Path } takes as an example, the first splice address is $ { proxyHost: port }/$ { proxyappath }/$ { clusterId }/$ { middlePath }/$ { realradio active Path }.
303. And the terminal equipment sends a second access request to the server.
The second access request is used for requesting to access a target sub-page of the father page, the second access request carries a first splicing address, and the first splicing address is formed by splicing the target proxy address and the relative address of the target sub-page.
304. And the server acquires a second data stream according to the first splicing address.
Illustratively, the server can determine the actual address of the target sub-page according to the first splicing address, and accesses the target cluster according to the actual address of the target sub-page to acquire the second data stream.
For example,
305. and the server sends the second data stream to the terminal equipment.
Illustratively, the server does not need to analyze the data stream, but sends the second data stream to the terminal device in the form of byte stream, thereby greatly improving the data transmission efficiency and reducing the data processing pressure of the CPU.
306. And the terminal equipment generates a target sub-page according to the second data stream.
And the terminal equipment receives the second data stream and displays the sub-page of the target cluster through page rendering. Through the sub-pages, the user can view the target cluster state, the task running state, the daily monitoring or running log and the like.
307. And the terminal equipment displays the target sub-page so that the user can view the target sub-page.
By adopting the scheme, for nested links of child pages such as scripting languages (JavaScript, js) and Cascading Style Sheets (CSS) scripts on a parent page, the server can automatically carry out address splicing according to the target proxy address of the parent page and the relative address of the target child page, and the links in the parent page do not need to be filtered in advance and are not required to be reformed in advance. Therefore, the utilization rate of the CPU can be reduced and the efficiency can be improved.
In the above embodiments, the example is described in which the child page is a child page nested in the parent page. However, the embodiment of the present application is not limited, and in other possible implementations, the sub page may also be a page dynamically generated based on a high version of the flink.
Illustratively, with the advent of high versions of flink, particularly after the flink 1.9 version, some dynamic child pages can be generated, which are not child pages originally nested in parent pages, but child pages that are automatically generated according to the user's operation and some JS scripts or algorithms. Because the existing proxy mechanism is used for transforming the address of the sub-page into the virtual address related to the proxy service in advance, the existing proxy mechanism prevents a user from accessing a page dynamically generated based on a high-version flink.
In the embodiment of the application, the relative address may be a relative address of a nested sub-page or a relative address of a sub-page dynamically generated based on a high-version flink, so that the cluster access method provided by the embodiment of the application can access the sub-page dynamically generated based on the high-version flink.
In the above embodiment, the target cluster includes a master node and a slave node, and when the master node of the target cluster changes, the parent page of the target cluster is updated.
Illustratively, a flink cluster comprises a plurality of main nodes and a plurality of slave nodes, and operations such as kubernets scheduling, user continuous starting and stopping of the cluster lead the flink cluster to be changed continuously, so that a Web UI (user interface) is caused, namely, the address of a father page is large and unfixed, IP (Internet protocol) conversion is difficult to realize on a transmission layer, and some control authority cannot be increased. Therefore, the embodiment of the present application continues to implement the proxy mechanism in a seven-layer proxy manner, i.e., in a manner of doing proxy at the application layer.
In the embodiment of the application, even if the management node of a flink cluster changes, so that the parent page changes, namely the actual address of the parent page changes, the cluster identifier of the flink cluster does not change, and the changed parent page is registered on the proxy server. Therefore, the proxy server can access the parent page according to the cluster identifier. The reason why the actual address of the parent page changes may be, for example: and changing the management node of the target cluster, and the like, thereby realizing high reliability of the target cluster.
In the above embodiment, after the second access request reaches the proxy server, the proxy server analyzes the first splicing address to obtain the target proxy address and the relative address, and can determine the first actual address of the parent page according to the target proxy address, and splice the first actual address and the relative address of the child page to obtain the second splicing address, which is the actual address of the target child page, so as to implement access to the child page. By adopting the scheme, the purpose that the server accurately acquires the related information of the sub-page is achieved.
In the above embodiment, after the server parses the first splicing address to obtain the target address and the relative address, it is further determined whether the relative address is included in a control list, where the control list includes the relative address of the sub-page that restricts the access right of the user. And when the relative address is contained in the control list, determining a second data stream for generating the target sub-page according to the relative address, and returning the second data stream to the server.
And when the relative address is contained in the control list, the server sends prompt information to terminal equipment, wherein the prompt information is used for prompting that the user cannot access the target sub-page.
For example, a control list is pre-stored on the server, and some relative addresses for limiting the user to access are stored in the control list, that is, the user cannot access the sub-pages corresponding to the relative addresses. And after the server analyzes the relative address each time, comparing the relative address with the control list, and if the relative address belongs to the control list, returning prompt information to prompt the user that the target sub-page cannot be accessed. In addition, the server can return other set page contents besides the prompt information. For the resource without system special limitation, the server accesses the real resource address and transmits the data to the user interface in the form of byte stream.
In the above embodiment, before the terminal device accesses the target cluster, a list request is sent to the server to request a third data stream for generating a list page, where the list page is used to display the cluster list. And after receiving the list request, the server generates the proxy address of each cluster. For any cluster, the path parameter of the proxy address of the cluster contains the cluster identifier of the cluster. And then, the server sends a third data stream to the terminal equipment, wherein the third data stream carries the proxy address of each cluster. And after the terminal equipment receives the third data stream, rendering a display page of the cluster list according to the third data stream. By adopting the scheme, the terminal device displays the cluster list for the user to select the target cluster, and the selected cluster can trigger the interaction between the terminal device and the server, so that the problem that the cluster cannot be accessed due to the network failure is avoided.
The following are embodiments of the apparatus of the present invention that may be used to perform embodiments of the method of the present invention. For details which are not disclosed in the embodiments of the apparatus of the present invention, reference is made to the embodiments of the method of the present invention.
Fig. 4 is a schematic structural diagram of a cluster access device according to an embodiment of the present application. The cluster access means 400 may be implemented in software and/or hardware. As shown in fig. 4, the cluster access device 400 includes: a receiving module 41, a processing module 42, an obtaining module 43 and a sending module 44.
A receiving module 41, configured to receive a first access request from a terminal device, where the first access request is used to request to acquire a first data stream of a parent page of a target cluster, where the first access request carries a target proxy address of the target cluster, and the parent page includes information of the target cluster;
a processing module 42, configured to determine a first actual address of the target cluster according to the target proxy address, where the first actual address is an address of the target cluster in a first network, and the target proxy address is an address of the target cluster in a second network, where the first network and the second network are mutually disconnected;
an obtaining module 43, configured to access the target cluster according to the first real address to obtain the first data stream;
a sending module 44, configured to send the first data stream to the terminal device.
In a possible implementation manner, the processing module 42 is configured to analyze a path parameter of the target proxy address to obtain the cluster identifier, and determine the first actual address according to the cluster identifier.
In a possible implementation manner, after the sending module 44 sends the first data stream to the terminal device, the receiving module 41 is further configured to receive a second access request carrying a first splicing address from the terminal device, where the second access request is used to request to access a target sub-page of the parent page, and the first splicing address is formed by splicing the target proxy address and a relative address of the target sub-page;
the processing module 42 is further configured to obtain a second data stream according to the first splicing address;
the sending module 44 is further configured to send the second data stream to the terminal device.
In a feasible implementation manner, when obtaining a second data stream according to the first splicing address, the processing module 42 is configured to analyze the first splicing address to obtain the target proxy address and the relative address, determine the first actual address according to a target cluster identifier in a path parameter of the target proxy address, splice the first actual address and the relative address to obtain a second splicing address, and access the target cluster according to the second splicing address to obtain the second data stream.
In one possible implementation, the target sub-page is a dynamically generated sub-page based on a flink framework.
In a possible implementation manner, before receiving the first access request from the terminal device, the receiving module 41 is further configured to receive a list request from the terminal device, where the list request is used to request to obtain a cluster list;
the sending module 44 is further configured to send a third data stream to the terminal device, where the third data stream is used to generate a list page containing the cluster list.
The cluster access device provided in the embodiment of the present application may perform the actions of the server in the foregoing method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 5 is a schematic structural diagram of another cluster access device provided in the embodiment of the present application. The cluster access means 500 may be implemented in software and/or hardware. As shown in fig. 5, the cluster access device 500 includes: a display module 51, a sending module 52, a receiving module 53 and a processing module 54.
A display module 51, configured to display a cluster list, where different clusters in the cluster list correspond to different proxy addresses;
a sending module 52, configured to send, when a user selects a target cluster in the cluster list, a first access request carrying the target proxy address to a server, where the first access request is used to request to access a parent page of the target cluster, and the parent page includes information of the target cluster;
a receiving module 53, configured to receive a first data stream from the server, where the first data stream is used to generate the parent page;
a processing module 54, configured to generate the parent page according to the first data stream;
the display module 51 is further configured to display the parent page.
In a possible implementation manner, after the display module 51 displays the parent page, when a user selects a sub-page identifier of a target sub-page in the parent page, the processing module 54 is further configured to determine a relative address of the target sub-page, and splice the target proxy address and the relative address to obtain a first spliced address;
the sending module 52 is further configured to send a second access request carrying the first splicing address to the server, where the second access request is used to request to access the target sub-page;
the receiving module 53 is further configured to receive a second data stream from the server;
the processing module 54 is further configured to generate the target sub-page according to the second data stream;
the display module 51 is further configured to display the target sub-page.
In one possible implementation, the target sub-page is a dynamically generated sub-page based on a flink framework.
In a possible implementation manner, the sending module 52 is further configured to send a list request to the server, where the list request is used to request to obtain the cluster list;
the receiving module 53 is further configured to receive a third data stream from the server, where the third data stream is used to generate a list page containing the cluster list;
the display module 51 is specifically configured to generate and display the list page according to the third data stream.
The cluster access device provided in the embodiment of the present application may perform the actions of the terminal device in the foregoing method embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 6, the electronic device 600 includes:
a processor 61 and a memory 62;
the memory 62 stores executable instructions;
the at least one processor 61 executes the executable instructions stored by the memory 62, causing the processor 61 to perform the method as applied to the server; alternatively, the processor 61 is caused to perform the method as applied to the terminal device.
For a specific implementation process of the processor 61, reference may be made to the above method embodiments, which implement the principle and the technical effect similarly, and this embodiment is not described herein again.
Optionally, the electronic device 600 further comprises a communication component 63. Wherein the processor 61, the memory 62 and the communication means 63 may be connected by a bus 64.
Embodiments of the present application further provide a computer-readable storage medium, in which executable instructions are stored, and when executed by a processor, the executable instructions are used to implement the method applied to a server as above; alternatively, the executable instructions are adapted to be executed by a processor to implement the method as applied to a terminal device.
There is also provided, in accordance with an embodiment of the present application, a computer program product, including: a computer program, stored in a readable storage medium, from which at least one processor of the electronic device can read the computer program, the at least one processor executing the computer program causing the electronic device to perform the solution provided by any of the embodiments described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (15)

1. A cluster access method, comprising:
a server receives a first access request from a terminal device, wherein the first access request is used for requesting to acquire a first data stream of a parent page of a target cluster, the first access request carries a target proxy address of the target cluster, and the parent page comprises information of the target cluster;
the server determines a first actual address of the target cluster according to the target proxy address, wherein the first actual address is an address of the target cluster in a first network, the target proxy address is an address of the target cluster in a second network, and the first network and the second network are mutually disconnected;
the server accesses the target cluster according to the first real address to acquire the first data stream;
and the server sends the first data stream to the terminal equipment.
2. The method of claim 1, wherein the server determines the first real address of the target cluster according to the target proxy address, comprising:
the server analyzes the path parameter of the target agent address to obtain the cluster identifier;
and the server determines the first actual address according to the cluster identifier.
3. The method of claim 1, wherein after the server sends the first data stream to the terminal device, the method further comprises:
the server receives a second access request carrying a first splicing address from the terminal equipment, wherein the second access request is used for requesting to access a target sub-page of the father page, and the first splicing address is formed by splicing the target proxy address and the relative address of the target sub-page;
the server acquires a second data stream according to the first splicing address;
and the server sends the second data stream to the terminal equipment.
4. The method of claim 3, wherein the server obtaining the second data stream according to the first splicing address comprises:
the server analyzes the first splicing address to obtain the target proxy address and the relative address;
the server determines the first actual address according to a target cluster identifier in the path parameter of the target proxy address;
the server splices the first actual address and the relative address to obtain a second spliced address;
and the server accesses the target cluster according to the second splicing address to acquire the second data stream.
5. The method of claim 4, wherein the target sub-page is a dynamically generated sub-page based on a flink architecture.
6. The method according to any one of claims 1-5, wherein before the server receives the first access request from the terminal device, further comprising:
the server receives a list request from the terminal equipment, wherein the list request is used for requesting to acquire a cluster list;
and the server sends a third data stream to the terminal equipment, wherein the third data stream is used for generating a list page containing the cluster list.
7. A cluster access method, comprising:
the method comprises the steps that terminal equipment displays a cluster list, wherein different clusters in the cluster list correspond to different agent addresses;
when a user selects a target cluster in the cluster list, the terminal device sends a first access request carrying the target proxy address to a server, wherein the first access request is used for requesting to access a parent page of the target cluster, and the parent page comprises information of the target cluster;
the terminal equipment receives a first data stream from the server, wherein the first data stream is used for generating the father page;
the terminal equipment generates the father page according to the first data stream;
and the terminal equipment displays the father page.
8. The method of claim 7, wherein after the terminal device displays the parent page, further comprising:
when a user selects a sub-page identifier of a target sub-page in the parent page, the terminal device determines a relative address of the target sub-page;
the terminal equipment splices the target proxy address and the relative address to obtain a first spliced address;
the terminal equipment sends a second access request carrying the first splicing address to the server, wherein the second access request is used for requesting to access the target sub-page;
the terminal equipment receives a second data stream from the server;
the terminal equipment generates the target sub-page according to the second data stream;
and the terminal equipment displays the target sub-page.
9. The method of claim 8, wherein the target sub-page is a dynamically generated sub-page based on a flink architecture.
10. The method according to any one of claims 7-9, wherein the terminal device displays a cluster list comprising:
the terminal equipment sends a list request to the server, wherein the list request is used for requesting to acquire the cluster list;
the terminal equipment receives a third data stream from the server, wherein the third data stream is used for generating a list page containing the cluster list;
and the terminal equipment generates and displays the list page according to the third data stream.
11. A cluster access apparatus, comprising:
a receiving module, configured to receive a first access request from a terminal device, where the first access request is used to request to obtain a first data stream of a parent page of a target cluster, where the first access request carries a target proxy address of the target cluster, and the parent page includes information of the target cluster;
a processing module, configured to determine a first actual address of the target cluster according to the target proxy address, where the first actual address is an address of the target cluster in a first network, and the target proxy address is an address of the target cluster in a second network, where the first network and the second network are mutually disconnected;
an obtaining module, configured to access the target cluster according to the first real address to obtain the first data stream;
and the sending module is used for sending the first data stream to the terminal equipment.
12. A cluster access apparatus, comprising:
the display module is used for displaying a cluster list, and different clusters in the cluster list correspond to different proxy addresses;
a sending module, configured to send a first access request carrying the target proxy address to a server when a user selects a target cluster in the cluster list, where the first access request is used to request to access a parent page of the target cluster, and the parent page includes information of the target cluster;
a receiving module, configured to receive a first data stream from the server, where the first data stream is used to generate the parent page;
the processing module is used for generating the father page according to the first data stream;
the display module is further used for displaying the father page.
13. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of the claims 1-10 when executing the program.
14. A readable storage medium having stored therein instructions, which when run on an electronic device, cause the electronic device to perform the method of any one of claims 1-10.
15. A computer program product, characterized in that it comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 10.
CN202110142397.8A 2021-02-02 2021-02-02 Cluster access method and device, electronic equipment and readable storage medium Pending CN113806008A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110142397.8A CN113806008A (en) 2021-02-02 2021-02-02 Cluster access method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110142397.8A CN113806008A (en) 2021-02-02 2021-02-02 Cluster access method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN113806008A true CN113806008A (en) 2021-12-17

Family

ID=78892827

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110142397.8A Pending CN113806008A (en) 2021-02-02 2021-02-02 Cluster access method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113806008A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115242503A (en) * 2022-07-21 2022-10-25 北京字跳网络技术有限公司 Content space sharing method and device, electronic equipment and storage medium
CN117155933A (en) * 2023-10-31 2023-12-01 北京比格大数据有限公司 Multi-cluster nano-tube method, platform, equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115242503A (en) * 2022-07-21 2022-10-25 北京字跳网络技术有限公司 Content space sharing method and device, electronic equipment and storage medium
CN117155933A (en) * 2023-10-31 2023-12-01 北京比格大数据有限公司 Multi-cluster nano-tube method, platform, equipment and storage medium
CN117155933B (en) * 2023-10-31 2024-02-27 北京比格大数据有限公司 Multi-cluster nano-tube method, platform, equipment and storage medium

Similar Documents

Publication Publication Date Title
US20230036980A1 (en) Micro-frontend system, sub-application loading method, electronic device, computer program product, and computer-readable storage medium
EP4343585A1 (en) Resource acquisition method and system, webvpn proxy server and server
CN113806008A (en) Cluster access method and device, electronic equipment and readable storage medium
CN112114890A (en) Method, device and equipment for processing small program and storage medium
US9842001B2 (en) System level acceleration server
CN113010827A (en) Page rendering method and device, electronic equipment and storage medium
CN110598135A (en) Network request processing method and device, computer readable medium and electronic equipment
CN113900834A (en) Data processing method, device, equipment and storage medium based on Internet of things technology
CN109343975A (en) Method and apparatus for asynchronous communication between the page
US20130124971A1 (en) Real time web script refresh using asynchronous polling without full web page reload
US10334014B2 (en) Accessing connected service resources in a distributed application programming interface
CN113761428A (en) Page rendering method, device and system, storage medium and electronic equipment
KR101907660B1 (en) Terminal apparatus having operating system based on web and method for providing service using thereof
US7849472B1 (en) System for instrumenting resources utilizing WS-management resource MBean wrappers for JAXB beans
CN111783005B (en) Method, device and system for displaying web page, computer system and medium
CN113220273A (en) Micro front-end application resource processing method, device, equipment and medium
JP2004246747A (en) Wrapping method and system of existing service
CN108496157B (en) System and method for providing runtime trace using an extended interface
CN113760562A (en) Link tracking method, device, system, server and storage medium
JP6205013B1 (en) Application usage system
US9537736B2 (en) Methods and systems to generate reports including report references for navigation
CN116955861A (en) Page generation method and device and front-end fusion system
CN114489622A (en) Js application, electronic device, and storage medium
CN109600403B (en) Method and device for sending information
US9027152B2 (en) Device for right managing web data, recording medium for performing method for right managing web data on computer, and device and method for providing right management information

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