CN110602136A - Cluster access method and related product - Google Patents

Cluster access method and related product Download PDF

Info

Publication number
CN110602136A
CN110602136A CN201910913676.2A CN201910913676A CN110602136A CN 110602136 A CN110602136 A CN 110602136A CN 201910913676 A CN201910913676 A CN 201910913676A CN 110602136 A CN110602136 A CN 110602136A
Authority
CN
China
Prior art keywords
client
cluster
access
access request
configuration information
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
Application number
CN201910913676.2A
Other languages
Chinese (zh)
Other versions
CN110602136B (en
Inventor
谢镇鸿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201910913676.2A priority Critical patent/CN110602136B/en
Publication of CN110602136A publication Critical patent/CN110602136A/en
Application granted granted Critical
Publication of CN110602136B publication Critical patent/CN110602136B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer And Data Communications (AREA)

Abstract

A cluster access method and related products are provided. The cluster access method comprises the following steps: the method comprises the steps that client proxy equipment receives a first access request of a first cluster sent by user equipment; the client agent device controls the first cluster to process the first access request by utilizing a first client, wherein the first client is started by the client agent device according to first configuration information of the first cluster; when the client agent equipment detects that the first configuration information is updated, the client agent equipment starts a second client according to the updated first configuration information; when the client agent device receives a second access request of the first cluster, controlling the target cluster to process the second access request by using the second client. Therefore, access failure caused by that the user process utilizes the client which is not updated to process the access cluster can be effectively avoided, and the probability of cluster access success is improved.

Description

Cluster access method and related product
Technical Field
The present application relates to the field of cluster technologies, and in particular, to a cluster access method and a related product.
Background
Enterprises typically use clients to securely access Hadoop clusters to handle the relevant big data tasks. However, as the business scale of an enterprise increases, nodes of the Hadoop cluster are continuously added to meet business needs, and meanwhile, failed nodes are continuously updated and eliminated, that is, the nodes of the Hadoop cluster are continuously changed, so that the cluster configuration of the Hadoop cluster is changed. Cluster access failures may result if the clients used to access the cluster are still using the old cluster configuration.
Disclosure of Invention
The application provides a cluster access method and a related product, which can update a client in time to ensure the success rate of accessing a cluster.
In a first aspect, the present application provides a cluster access method, including:
the method comprises the steps that client proxy equipment receives a first access request of a first cluster sent by user equipment;
the client agent device controls the first cluster to process the first access request by utilizing a first client, wherein the first client is started by the client agent device according to first configuration information of the first cluster;
when the client agent equipment detects that the first configuration information is updated, the client agent equipment starts a second client according to the updated first configuration information; when the client agent device receives a second access request of the first cluster, controlling the target cluster to process the second access request by using the second client.
According to the cluster access method, when the configuration information of the cluster is updated, the client proxy equipment starts a new client at the client proxy equipment in time according to the updated configuration information, and processes the subsequently received access request of the cluster by using the new client, so that access failure caused by the fact that a user process processes to access the cluster by using the client which is not updated can be effectively avoided, and the probability of cluster access success is improved.
In some possible embodiments, before the client agent device controls the first cluster to process the first access request by using the first client, the cluster access method includes:
the client proxy equipment judges whether the first client is started or not;
and when the first client is not started, the client proxy equipment starts the first client according to the first configuration information of the first cluster.
Therefore, when the client proxy equipment does not start the first client, the first client is started according to the first configuration information of the first cluster, so that the first access request can be processed by the first client in time, and the success rate of cluster access is improved.
In some possible embodiments, the cluster access method further includes:
when the client agent device starts a first client corresponding to the first cluster and the running state of the first client is not a normal state, the client agent device starts a third client according to the first configuration information of the first cluster, and the third client is utilized to control the first cluster to process the first access request.
Therefore, when the client corresponding to the cluster is abnormally operated, a new client is restarted in time to process the access request corresponding to the cluster, so that the client agent equipment can normally process each access request, the access request processing failure caused by the abnormal operation of the client is avoided, and the probability of the access request failure can be reduced.
In some possible embodiments, the first cluster access request includes first request content and a user identifier corresponding to the user process;
the client agent device controlling the first cluster to process the first access request by using a first client comprises:
the client proxy equipment acquires an authentication file corresponding to the user identifier from a user database corresponding to the first cluster by using a first client, and sends the user identifier and the authentication file to the first cluster;
the client agent device receives a first access credential sent by the first cluster by using the first client, wherein the first access credential is sent by the first cluster after the first cluster confirms that a user corresponding to the user identifier has an access condition of the first cluster based on the user identifier and the authentication file;
the client agent device sends a first request execution instruction to the first cluster by using the first client, wherein the first request execution instruction comprises the first access credential and first execution content, and the first execution instruction is used for instructing the first cluster to process the first request content when the authentication file is confirmed to be valid.
Therefore, the cluster can authenticate the identity and the authority of the user and process the request content, so that the security of the cluster can be improved.
In some possible embodiments, after the client agent device starts a second client according to the updated first configuration information, the cluster access method further includes:
when the client proxy device starts the second client and the first client is controlling the first cluster to process a third access request, the client proxy device stops running the first client after the third access request processing is completed;
when the client agent device starts the second client and the first client does not control the first cluster to process the access request, the client agent device stops running the first client.
Therefore, after the first client processes the received access request, the client proxy equipment controls to stop running the first client, so that the first client can complete processing of the received access request, and the success rate of cluster access is improved. When the client proxy equipment starts the second client, the first client is directly ended, so that the access request received by the first client cannot be executed, and the access failure is avoided.
In a second aspect, the present application provides a client proxy device comprising:
the request receiving module is used for receiving a first access request of a first cluster sent by user equipment;
a first request processing module, configured to control the first cluster to process the first access request by using a first client, where the first client is started according to first configuration information of the first cluster;
the first client starting module is used for starting a second client according to the updated first configuration information when the first configuration information is detected to be updated;
and the second request processing module is used for controlling the target cluster to process a second access request by utilizing the second client when the second access request of the first cluster is received.
According to the client-side agent device, when the configuration information of the cluster is updated, the new client side is started on the client-side agent device in time according to the updated configuration information, and the new client side is used for processing the subsequently received access request of the cluster, so that access failure caused by the fact that a user process utilizes the client side which is not updated to process access to the cluster can be effectively avoided, and the probability of cluster access success is improved.
In some possible embodiments, the client proxy device further comprises:
the first judgment module is used for judging whether the first client is started or not;
and the second client starting module is used for starting the first client according to the first configuration information of the first cluster when the first client is not started.
Therefore, when the client proxy equipment does not start the first client, the first client is started according to the first configuration information of the first cluster, so that the first access request can be processed by the first client in time, and the success rate of cluster access is improved.
In some possible embodiments, the client proxy device further comprises:
and the third client starting module is used for starting a third client according to the first configuration information of the first cluster when the first client corresponding to the first cluster is started and the running state of the first client is not a normal state, and controlling the first cluster to process the first access request by using the third client.
Therefore, when the client corresponding to the cluster is abnormally operated, a new client is restarted in time to process the access request corresponding to the cluster, so that the client agent equipment can normally process each access request, the access request processing failure caused by the abnormal operation of the client is avoided, and the probability of the access request failure can be reduced.
In some possible embodiments, the first cluster access request includes first request content and a user identifier corresponding to the user process;
the first request processing module includes:
an authentication file obtaining unit, configured to obtain, by using a first client, an authentication file corresponding to the user identifier from a user database corresponding to the first cluster, and send the user identifier and the authentication file to the first cluster;
a credential receiving unit, configured to receive, by using the first client, a first access credential sent by the first cluster, where the first access credential is sent by the first cluster after the first cluster confirms that a user corresponding to the user identifier has an access condition of the first cluster based on the user identifier and the authentication file;
an instruction sending unit, configured to send, by the first client, a first request execution instruction to the first cluster, where the first request execution instruction includes the first access credential and first execution content, and the first execution instruction is used to instruct the first cluster to process the first request content when the authentication file is confirmed to be valid.
Therefore, the cluster can authenticate the identity and the authority of the user and process the request content, so that the security of the cluster can be improved.
In some possible embodiments, the client proxy device further comprises:
a first stopping module, configured to stop running the first client after processing of a third access request is completed when the second client is started by a first client starting module and the first client is controlling the first cluster to process the third access request;
and the second stopping module is used for stopping running the first client when the second client is started by the first client starting module and the first client does not control the first cluster to process the access request.
Therefore, after the first client processes the received access request, the client proxy equipment controls to stop running the first client, so that the first client can complete processing of the received access request, and the success rate of cluster access is improved. When the client proxy equipment starts the second client, the first client is directly ended, so that the access request received by the first client cannot be executed, and the access failure is avoided.
In a third aspect, the present application provides a server comprising a processor and a memory. The memory stores computer instructions; the processor executes the computer instructions stored by the memory to cause the server to perform the cluster access method provided by the first aspect or the various possible implementations of the first aspect, to cause the server to deploy the client agent device provided by the second aspect or the various possible implementations of the second aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, where computer instructions are stored in the computer-readable storage medium, and the computer instructions instruct the server to execute the cluster access method provided by the first aspect or various possible implementations of the first aspect, or instruct the server to deploy the client proxy device provided by the second aspect or various possible implementations of the second aspect.
In a fifth aspect, the present application provides a computer program product comprising computer instructions stored in a computer readable storage medium. The processor of the server may read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the server to execute the cluster access method provided by the above first aspect or the various possible implementations of the first aspect, so that the server deploys the client proxy device provided by the above second aspect or the various possible implementations of the second aspect.
In a sixth aspect, the present application provides a chip, which may include programmable logic circuits and/or program instructions, and when the chip is run, is configured to implement the cluster access method according to any one of the first aspect.
Drawings
FIG. 1 is a schematic diagram of a network architecture of a prior art cluster access system;
fig. 2 is a schematic network architecture diagram of a cluster access system according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a cluster access method provided in an embodiment of the present application;
fig. 4 is a schematic view of an application scenario of a cluster access method provided in an embodiment of the present application;
fig. 5 is a schematic view of another application scenario of the cluster access method according to the embodiment of the present application;
fig. 6 is a schematic view of another application scenario of the cluster access method provided in the embodiment of the present application;
fig. 7 is a schematic view of another application scenario of the cluster access method according to the embodiment of the present application;
fig. 8 is a schematic view of still another application scenario of the cluster access method according to the embodiment of the present application;
fig. 9 is a schematic view of still another application scenario of the cluster access method according to the embodiment of the present application;
fig. 10 is a schematic diagram of another network architecture of a cluster access system according to an embodiment of the present application;
fig. 11 is a schematic diagram of another network architecture of the cluster access system according to the embodiment of the present application;
fig. 12 is a schematic diagram of still another network architecture of a cluster access system according to an embodiment of the present application;
fig. 13 is another schematic flowchart of a cluster access method according to an embodiment of the present application;
fig. 14 is a schematic block diagram of a client proxy device according to an embodiment of the present application;
fig. 15 is a schematic hardware structure diagram of a server according to an embodiment of the present application.
Detailed Description
The technical solution in the present application will be described below with reference to the accompanying drawings.
A cluster (cluster) is a group of mutually independent computers interconnected through a high-speed network, which form a group and are managed in a single system mode; each computer in the cluster may act as a node in the cluster. In general, a user device may access a corresponding cluster through a client, and the client is used for connecting with the cluster. The client receives an access request of a user, finds a cluster corresponding to the access request, and executes the access request by using nodes in the cluster.
Because the client version corresponding to each cluster is different, and some clients need to store the configuration information of the clusters in the environment variables of the process when the client runs, it is often difficult for one client to be compatible with multiple clusters. That is, one client typically has access to only one cluster. As shown in fig. 1, in the prior art, it is common for a user process on a user device to access different clusters through different clients on the user device. The corresponding client of each cluster is started based on the configuration information of the cluster. The configuration information of each cluster comprises address information of each node in the cluster and service information deployed on each node. And sending an access request for accessing the cluster to the corresponding client through the user process, and when the client runs, accessing the corresponding cluster based on the configuration information of the corresponding cluster. Therefore, when a user needs to access different clusters, an access request for accessing the different clusters needs to be sent to different clients, which results in tedious user operation.
When the client for accessing the cluster is started, the user equipment loads the configuration information of the corresponding cluster to the memory, so that the client can realize cluster access based on the configuration information of the cluster. Then, the user process may access each cluster using its corresponding client. For example, as shown in fig. 1, after the client B is started, the user process may first send an access request Y1 to the client B, and request the cluster B corresponding to the client B to execute the access request Y1. After receiving the access request Y1, the client B processes the access request Y1 by using the cluster B; client B remains running and the user device sends another access request Y2 requesting access to the cluster B. After client B receives access request Y2, it processes access request Y2 using cluster B.
Thus, if after the client is started, the nodes of the cluster change or the services deployed on the nodes have updates, such as adding nodes to the cluster, deleting nodes, and the like. The configuration information of the cluster may also be updated, but the client is still running based on the configuration information that is not updated. The client side can acquire the address information of the node to be accessed by the access request according to the configuration information which is not updated, so that the access request processing is easy to fail. In this case, the user is required to manually stop running the client, restart the client according to the new configuration information, and then process the access request by using the restarted client. This results in the user needing to pay attention to the update state of the configuration information of the cluster in order to ensure that the client can operate based on the updated configuration information.
The application provides a client proxy device. The client proxy device includes a client proxy component. The client agent component can start the client corresponding to each cluster on the client agent equipment according to the configuration information corresponding to each cluster. Each client can be connected with the corresponding cluster according to the configuration information of the cluster. And when the client agent component receives an access request for accessing the cluster, which is sent by the user equipment, the client agent component sends the access request to a client corresponding to the cluster. The client agent component controls the client to establish connection with the cluster, and controls the cluster to process the access request by utilizing the client. For example, as shown in fig. 2, the client agent component receives an access request of a cluster a sent by the user equipment, and if the client agent device does not run a client corresponding to the cluster a, the client agent component starts a client a on the client agent device according to the configuration information of the cluster a. The client a establishes a connection with the cluster a, so that the client agent component can process the access request of the cluster a by using the client a. If the client-side agent component receives the client-side a started by the client-side agent device according to the configuration information of the cluster a before receiving the access request of the cluster a sent by the user device, the client-side agent component can process the access request of the cluster a by using the started client-side a when receiving the access request of the cluster a sent by the user device. The client agent component monitors the update status of the configuration information corresponding to each cluster. And when the client agent component detects that the configuration information of the cluster corresponding to the running client is updated, the client agent component starts a new client at the client agent equipment according to the updated configuration information. The new client is utilized to process subsequently received access requests for the cluster. For example, if the configuration information of the cluster a corresponding to the running client a is updated, the client agent component additionally starts a new client a 'on the client agent device according to the updated configuration information, and processes the access request of the cluster a subsequently received by the client agent component by using a'.
Thus, when a user process needs to access a certain cluster, the user process only needs to send an access request to the client proxy device to request to access the cluster, and the client proxy component of the client proxy device receives the access request and executes the access request by using the client corresponding to the cluster. And the client agent component also monitors the updating state of the configuration information of the cluster, and when the configuration information of the cluster is updated, a new client is started by using the updated configuration information to continuously process the subsequent access request of the cluster. Therefore, a user needing to access the cluster does not need to care which client side processes the access request, and does not need to care whether the configuration information of the cluster is updated, so that the process of accessing the cluster is more convenient and quicker. And when the configuration information of the cluster is updated, the client agent component can use the updated configuration information to create a new client in the client agent device to continue processing the subsequent access request of the cluster, and the process is not perceived by the user. And the client proxy component automatically starts the client according to the latest configuration information, so that the probability of cluster access failure can be reduced.
Referring to fig. 2, fig. 2 is a network architecture diagram of a cluster access system according to an embodiment of the present application, where the cluster access system includes a user device, a client proxy device, and one or more clusters. The cluster access system shown in fig. 2 includes a plurality of clusters, and the embodiment of the present application is also applicable to a cluster access system having only one cluster. The cluster of embodiments of the present application may be, for example, but is not limited to, a Hadoop cluster. The user equipment is equipment running with a user process. The client agent device comprises a client agent component, and a plurality of clients run on the client agent device. The user equipment and the client agent equipment may be deployed on the same physical machine, or may be deployed on different physical machines.
Referring to fig. 3, fig. 3 is a schematic flowchart illustrating a cluster access method according to an embodiment of the present application. The cluster access method comprises the following steps:
301. the user device sends a first access request of the first cluster to the client agent device through the user process.
The first access request includes a cluster identification of the first cluster and first request content. The first access request is for requesting the client proxy device to control the first cluster to process the first requested content. The first request content includes task information for a task requested to be processed by the first cluster by the user equipment.
302. The client proxy component of the client proxy device receives the first access request, and determines whether a first client corresponding to the first cluster is started in the client proxy device, where the first client is a process started according to the first configuration information of the first cluster, and if so, executes step 304.
Specifically, each running client corresponds to one client identifier. Each client is used for processing the access request of one cluster, and each cluster corresponds to the client for processing the access request of the cluster. Then each client also corresponds to a cluster identity. The client agent component stores a mapping relation table, and the mapping relation table contains the mapping relation between the client identifier and the cluster identifier corresponding to each running client in the client agent equipment. In this way, the client agent component may look up the first client identifier corresponding to the cluster identifier of the first cluster from the mapping table. If the first client identifier mapped to the cluster identifier of the first cluster is found from the mapping relation table, the client agent component can determine that the first client mapped to the first cluster is started in the client agent equipment; if the first client identifier mapped by the cluster identifier of the first cluster is not found from the mapping relation table, the client agent component may determine that the first client corresponding to the first cluster is not started in the client agent device.
The started client may have a corresponding client process running on the client proxy device. The client identifier corresponding to each client may be, for example, a port number of a client process corresponding to the client. Then, after finding the first client identifier mapped to the cluster identifier of the first cluster, the client proxy component obtains the port number of the first client process corresponding to the first client. The client proxy component may then send the first access request to the first client process according to the port number. The first request content in the first access request is then sent by the first client process to the first cluster to cause the first cluster to process the first request content.
303. If the first client corresponding to the first cluster is not started, the client agent component starts the first client at the client agent device according to the first configuration information of the first cluster, and then performs step 305.
The client agent component may find first configuration information of the first cluster from the configuration database according to the cluster identifier of the first cluster, and start the first client using the first configuration information.
The first configuration information includes connection information of the first cluster and service information deployed by the first cluster. When the first client is started, the client proxy equipment loads the first configuration information into the memory, so that the first client can establish connection with the first cluster according to the first configuration information of the first cluster, and sends the first request content in the first access request to the first cluster, so that the first cluster processes the first request content.
The configuration database stores cluster identifications of a plurality of clusters and configuration information corresponding to each cluster. In the configuration database, the cluster identifier of each cluster and the configuration information of the cluster establish a corresponding relationship. Therefore, the client agent component can find the configuration information corresponding to the cluster identifier from the configuration database according to the cluster identifier in the access request, and start the client to process the access request according to the found configuration information. The configuration database may be a local database of the client agent component so that the client agent device may more quickly launch the client based on the configuration information in the configuration database.
After the first client is started, the client agent component issues the lease to the first client according to a preset lease issue strategy so as to control the first client to keep running or control the first client to stop running. The user can set a lease issue strategy according to actual requirements.
The lease issue policy may be a timed issue policy. The client agent component issues leases for the running clients according to a preset time point, for example, the leases are issued according to a preset time interval, so that the running state of each client can be kept after the client is started. For example, when the access frequency of each cluster in the cluster access system is high, the lease issue policy is adopted, so that the client corresponding to each cluster can keep a running state after being started, and then when the client agent component processes the access request of each cluster, the times of starting the client can be reduced, the time of starting the client is saved, and the access efficiency is improved.
The lease issue strategy can also be as follows: and when the client proxy component sends an access request to the client, issuing a lease to the client, so that the client corresponding to the cluster with higher access frequency can be ensured to keep running state. For example, when the access frequency of a part of clusters in the cluster access system is high and the access frequency of another part of clusters is low, the lease issue policy is adopted, so that the client corresponding to the cluster with the high access frequency can be ensured to keep the running state, and the clients of other clusters with the low access frequency can be timely quitted when being idle, so as to save the resources of the client agent device. Then, by adopting the lease issue strategy, when the client proxy component processes the access request of the cluster with higher access frequency, the times of starting the client can be reduced, the time for starting the client is reduced, and the processing efficiency of the access request is improved.
The lease issue strategy can also be as follows: after the client starts, the client proxy component does not issue a lease to the client. Therefore, after the client processes the access request, the client agent component timely controls the client to stop running, so that resources occupied by the client can be timely recovered. For example, when there are many clusters in the cluster access system and the access frequency of each cluster is low, the lease issue policy is adopted, so that after each client processes an access request, the client agent component controls to end the client in time to recycle the resources of the client agent device.
Then, after the first client is started, the client proxy component may issue the lease to the first client according to any one of the lease issue policies described above.
It should be noted that, in other embodiments, the client agent component may also adopt other lease issue policies, and the lease issue policies are only used for illustration and do not constitute a limitation to the present application.
304. If the first client corresponding to the first cluster is started, the client agent component acquires the running state of the first client and judges whether the running state of the first client is a normal state or not; if so, go to step 305, otherwise go to step 306.
If there is a first client corresponding to the first cluster, the client proxy component does not need to restart a client at the client proxy device. For example, before the client proxy component receives the first access request sent by the user process 1, an access request of the first cluster sent by another user process 2 is received, and then the client proxy component starts the first client at the client proxy device according to the first configuration information of the first cluster when receiving the access request of the first cluster sent by the user process 2. When the client-side proxy component receives the first access request sent by the user process 1, the first access request can be handed over to the first client-side for processing, and the client-side proxy component does not need to create a new client-side again according to the first configuration information. Therefore, one client can process access requests sent by different user processes.
305. The client agent component controls the first cluster to process the first access request by utilizing the first client;
in this way, after the operating state of the first client is confirmed to be a normal state, the first client is used for controlling the first cluster to process the first access request. The method can avoid the access request processing failure caused by the client agent component handing the first access request to the client with abnormal operation state, thereby reducing the probability of access request failure.
It is to be understood that the first client may be initiated by the client proxy component upon receiving the first access request, or may be initiated by the client proxy component prior to receiving the first access request. For example, the client agent component may have received other access requests for accessing the first cluster before receiving the first access request, and the client agent component may launch the first client at the client agent device according to the configuration information of the first cluster before receiving the first access request.
Specifically, the first cluster access request includes a cluster identifier of the first cluster and first request content, and the first client establishes a connection with the first cluster after being started. The first client sends the first request content of the first access request to the first cluster through the connection, so that the first cluster processes the first request content.
The first client may also be configured to process access requests received by subsequent client agent components for accessing the first cluster. For example, after the client agent component receives the first access request and receives a second access request for accessing the first cluster, and after the client agent component confirms that a first client corresponding to the first cluster is started in the client agent device, the client agent component controls the first cluster to process the second access request by using the first client.
For example, in the example shown in FIG. 4, the client proxy component of the client proxy device receives access request 1 to access cluster a. The access request 1 includes the request content and the cluster identifier of the cluster a, and the access request 1 may be understood as a first access request, and the cluster a may be understood as a first cluster. The client agent component finds the client a corresponding to the cluster a at the client agent device and sends the requested content to the cluster a by using the client a, which can be understood as the first client. In the example shown in fig. 5, after receiving access request 1, the client proxy component receives access request 2 for accessing cluster a, where access request 2 includes the request content and the cluster identifier of cluster a, and this access request 2 may be understood as a second access request. The client agent component finds the client a corresponding to the cluster a according to the cluster identifier of the cluster a, and sends the request content in the access request 2 to the cluster a by using the client a.
306. And when the running state of the first client is not the normal state, the client agent component starts a third client at the client agent equipment according to the first configuration information of the first cluster, and controls the first cluster to process the first access request by utilizing the third client.
Therefore, when the client corresponding to the cluster is abnormally operated, a new client is restarted in time to process the access request corresponding to the cluster, so that the client agent component can normally process each access request, the access request processing failure caused by the abnormal operation of the client is avoided, and the probability of the access request failure can be reduced.
For example, in the example shown in fig. 6, when there is a client a corresponding to the cluster a in the client agent device, but the operating state of the client a is not a normal state, the client agent component sends the request content in the access request 1 to the cluster a after the client agent device starts the client a 'according to the configuration information of the cluster a and the client a' establishes a connection with the cluster a, so that the cluster a processes the request content.
If the first client with the running state not being the normal state starts to process the first access request before the third client is started, the client proxy equipment controls the first cluster to process the first access request by using the third client and stops controlling the first cluster to process the first access request by using the first client when the third client is started.
307. The client agent component detects whether the first configuration information is updated;
after the first client is started, the client agent component detects whether the first configuration information of the first cluster is updated in the configuration database.
308. And when the first configuration information is detected to be updated, the client agent component starts a second client at the client agent equipment according to the updated first configuration information.
The second client is used for processing the access request of the first cluster subsequently received by the client agent component. For example, after the second client is started, when the client agent component receives a second access request of the first cluster sent by the user equipment, the client agent component controls the first cluster to process the second access request by using the second client.
In the example shown in fig. 7, the client agent component detects an update to the configuration information for cluster a, and the client agent component launches client a "at the client agent device according to the updated configuration information for cluster a. The client a "user processes the access request of cluster a subsequently received by the client agent component.
For example, as shown in fig. 8, after the client agent component starts the client a ″ and receives the access request 3 requesting to access the cluster a, the client agent component delivers the access request 3 to the client a ″ for processing, and the client a ″ sends the request content of the access request 3 to the cluster a, so that the cluster a processes the request content.
Further, when it is detected that the first configuration information is updated, after the client agent component starts the second client according to the updated first configuration information, the client agent component controls to stop running the first client. Specifically, after the second client is started, the client proxy component stops issuing the lease to the first client, so that the first client stops running after the current lease expires.
And if the first client controls the first cluster to process the third access request when the client agent component starts the second client according to the updated first configuration information, the client agent component controls to end the first client after the third access request is processed. Therefore, after the first client processes the received access request, the client proxy component controls to stop running the first client, so that the first client can complete processing of the received access request, and the probability of successful cluster access is improved. When the client agent component starts the second client, the first client is directly stopped to operate, so that the access request received by the first client cannot be executed, and the access failure is avoided. For example, as shown in fig. 9, when the client agent component starts the client a ″, the client a is controlling the cluster a to process the request content in the access request 4, and the access request 4 can be understood as a third access request, then the client agent component controls to end the client a after the processing of the request content in the access request 4 is completed.
It should be noted that, if the lease of the first client has expired and the third access request is not processed, the client proxy component still controls the first client to stop running after the third access request is processed.
If the first client does not have the access request being processed when the client agent component starts the second client, the first client stops running after the current lease expires because the client agent component stops issuing the lease to the first client. Therefore, after the client agent component starts the second client according to the updated configuration information, the first client started by the non-updated configuration information is controlled to be ended, resources occupied by the first client can be timely recycled, and the operating efficiency of the client agent equipment is improved.
The configuration database stores configuration information of a plurality of clusters, and when a node of any one cluster is changed or a service deployed on the node is updated, the configuration information of the cluster in the configuration database is also updated. The client agent component may monitor the configuration data for updates to the configuration information for each cluster. For example, the client agent component may detect whether the configuration information of each cluster in the configuration data is updated according to a preset time interval.
Specifically, the client agent component may monitor whether the updated configuration information exists in the configuration database, and obtain the cluster identifier corresponding to the updated configuration information when the updated configuration information exists in the configuration database. Then the client agent component searches the client identifier corresponding to the cluster identifier from the mapping relation table according to the cluster identifier. And if the client identifier corresponding to the cluster identifier exists, a new client is renewed according to the updated configuration information. For example, when the cluster identifier corresponding to the updated configuration information is the cluster identifier of the first cluster, the client proxy component may confirm that the configuration information of the first cluster is detected to be updated, and that the first client corresponding to the first cluster exists, and the client proxy component starts the second client at the client proxy device according to the updated first configuration information.
In an alternative embodiment, when a user updates a cluster, for example, changes a node of the cluster or updates a service deployed on the node, the user updates configuration information of the cluster in the configuration database. Therefore, the client side agent component can start the client side corresponding to the cluster according to the latest configuration information of the cluster in time.
In another optional embodiment, the cluster access system further includes a common database, where configuration information of multiple clusters is stored in the common database, and when a user changes a node of a cluster or updates a service deployed on the node, the user updates the configuration information of the cluster in the common database at the same time. The common database is accessible to one or more client proxy components. Referring to fig. 10, when the cluster access system includes a plurality of client agent components, each client agent component may update the configuration information in the configuration database according to the configuration information in the public database, so that the client agent component may obtain the latest configuration information of each cluster from the configuration database, and start the client corresponding to each cluster according to the latest configuration information. In this way, when the configuration information of any one cluster is updated, the configuration information of the cluster in the configuration database of the client agent component is also updated. If the cluster access system has a plurality of client agent components, the plurality of client agent components can update the configuration information in the configuration database according to the updated configuration information in the public database when the configuration information in the public database is updated.
Specifically, the client agent component may detect whether the first configuration information of the first cluster is updated in the public database. When the first configuration information of the first cluster is updated in the public database, the client agent component downloads the updated first configuration information in the public database to the configuration database, confirms that the first configuration information is updated, and starts a second client according to the updated first configuration information.
It should be noted that in the cluster access method in the embodiment of the present application, the first cluster is one of a plurality of clusters of the cluster access system. The client proxy device may also process access requests of other clusters by using the cluster access method of the embodiment of the present application. For example, the user process may send a third access request to the client proxy device for accessing the second cluster. And the client agent component of the client agent device sends the third access request to a fourth client corresponding to the second cluster, and processes the third access request by using the fourth client. The fourth client is initiated by the client agent component according to the configuration information of the second cluster. It can be seen that when a user needs to access a plurality of different clusters, the access can be realized by sending an access request to the client proxy device, and the user only needs to provide a cluster identifier and corresponding request content, and does not care which client is used to process the access request, and does not need to care about the configuration information of the clusters. In this way, a user may more conveniently access multiple different clusters using the client proxy component.
Moreover, one client proxy device may also receive access requests sent by a plurality of different user processes, and each client may also process access requests sent by a plurality of different user processes. Therefore, a plurality of different user processes can utilize the same client to process the access request, so that the client agent equipment can be prevented from repeatedly starting the client corresponding to the same cluster, and the resources of the client agent equipment are saved.
According to the cluster access method, when the configuration information of the cluster is updated, the client proxy equipment starts a new client at the client proxy equipment in time according to the updated configuration information, and processes the subsequently received access request of the cluster by using the new client, so that access failure caused by the fact that a user process processes to access the cluster by using the client which is not updated can be effectively avoided, and the probability of cluster access success is improved. Moreover, the client proxy device starts a new client according to the updated configuration information, and processes the subsequently received access request of the cluster by using the new client, which is imperceptible to the user process. Therefore, when the user process utilizes the client proxy component to process the access request, the user process does not need to care which client is used to access the cluster, and when the configuration information of the cluster is updated, the user process does not need to manually restart the client and utilizes the new client to process the access request. When a user has a requirement for accessing a certain cluster, the client proxy equipment only needs to send an access request containing the cluster identifier of the cluster to the client proxy equipment through a user process, and the client proxy equipment controls the cluster to process the access request according to the latest configuration information of the cluster. In this way, the user may more conveniently access the various clusters using the client proxy device.
Therefore, the client proxy equipment starts a new client according to the updated configuration information when the configuration information of the cluster is updated, and restarts a new client corresponding to the client when the running state of the client is abnormal, so that access failure caused by the fact that the client runs based on the un-updated configuration or the running state of the client is abnormal is avoided, and high availability of the client can be realized.
Based on the foregoing embodiment, in an optional embodiment, the client proxy component may monitor the running state of each running client, and when detecting that the running state is not a client in a normal state, restart a new client in the client proxy device according to the configuration information of the cluster corresponding to the client. Therefore, each client in the client agent device can be ensured to normally operate, and the client agent component can utilize each client in the client agent device to more efficiently process the access request by utilizing each client.
Based on the foregoing embodiments, in some embodiments, the first cluster is a cluster that needs to be subjected to security authentication, and the first access request includes a user identifier, a cluster identifier of the first cluster, and first request content. In step 305, when the client proxy component controls a first cluster to process a first access request by using a first client of the client proxy device, the client proxy component first obtains an authentication file corresponding to the user identifier from a user database corresponding to the first cluster by using the first client, and sends the user identifier and the authentication file to the first cluster; then the first cluster confirms that the user identification is matched with the authentication file based on the user identification and the authentication file, acquires the authority information of the user corresponding to the user identification, and sends a first access credential to a client agent component according to the authority information; after receiving a first access credential, a client agent component sends a first request execution instruction to the first cluster by using a first client, wherein the first request execution instruction comprises the first access credential and first execution content, and the first execution instruction is used for instructing the first cluster to process the first request content. The first cluster receives the first execution instruction and processes the first request content after verifying that the first access credential is valid. In the process, the cluster firstly authenticates the identity and the authority of the user and then processes the request content, so that the security of the cluster can be improved.
The user database of each cluster stores user identifications of a plurality of users and authentication files corresponding to the user identifications, and the authentication files can be password files containing password information or passwords, for example. The user database for each cluster may be stored in the configuration database as a configuration file for each cluster.
Specifically, the user corresponding to the user identifier may have access rights to all nodes of the first cluster, or may only have access rights to some nodes of the first cluster. The authority information is recorded with authority information about each node corresponding to the user identifier. The first cluster generates a first access credential according to the permission information. And when the first cluster receives the first execution instruction, processing the first request content after confirming that the user has the access right of the node to be accessed in the first request content according to the first access credential. Therefore, the first cluster can accurately process the access request according to the access authority of the user, and the security of the cluster is effectively improved.
Based on the above embodiments, as shown in fig. 11, in some embodiments, a cluster access system includes a user device, a service discovery center, a common database, a plurality of client proxy devices, and one or more clusters. A user process is run on the user equipment. The client proxy device includes a client proxy component. The service discovery center detects the running state of the client agent components in each client agent device based on a heartbeat mechanism, the user process obtains the running state information of each client agent component from the service discovery center, selects a target client agent component from the plurality of client agent components according to the running state information of each client agent component, and sends an access request to the agent module of the target client agent component. This enables a high availability of the client proxy component.
Specifically, each client agent component sends a heartbeat message to the service discovery center according to a preset heartbeat time interval, and the service discovery center detects whether each client agent component is normal or not according to the heartbeat message sent by each client agent component. When the service discovery center detects that the heartbeat message of one client agent component is interrupted, the operation state of the client agent component can be confirmed to be abnormal.
Preferably, the common database and service discovery center may be deployed on a highly available cluster. A highly available cluster may be, for example, a cluster that stores multiple sets of redundant data. For example, the service discovery center may be deployed in Zookeeper and the public database may be deployed in HDFS. This may enable a high availability of the entire cluster access system.
In order to better understand the technical scheme of the application, the application provides a more specific embodiment. As shown in fig. 12, fig. 12 is a schematic diagram of another network architecture of the cluster system according to the embodiment of the present application. The cluster access system includes a user device, a client agent device and one or more clusters. A user process is run on the user equipment. The client agent device comprises a client agent component and a plurality of clients. The user equipment and the client agent equipment can be deployed on the same physical machine or different physical machines.
The client agent component comprises an agent module, a client management module and a configuration database. The client management module comprises a connection pool submodule, a lease management submodule and a configuration management submodule.
The agent module is used for receiving the cluster access request sent by the user equipment through the user process and sending the received cluster access request to the client management module.
The client management module is used for delivering the access request to the client corresponding to the cluster to be accessed for processing, managing the client corresponding to each cluster and updating the configuration information of each cluster in the configuration database. Specifically, the connection pool submodule is configured to start a client corresponding to each cluster according to the configuration information of each cluster in the configuration database, and to deliver the access request to the client corresponding to the cluster to be accessed for processing. And the lease management submodule is used for issuing the lease to the client according to a preset lease issuing strategy so as to manage the service life of the client. The configuration management submodule is used for detecting the updating condition of the configuration information of each cluster in the configuration database and informing the lease management submodule of stopping issuing the lease to the client corresponding to the overdue configuration.
Referring to fig. 13, fig. 13 is another flowchart illustrating a cluster access method according to an embodiment of the present application. The cluster access method comprises the following steps:
1301. the user device sends a first access request of the first cluster to the client agent device through the user process.
The first access request includes a cluster identification of the first cluster and first request content. The first access request is for requesting the client agent component to control the first cluster to process the first requested content.
1302. An agent module of a client agent component in the client agent device sends the first access request to the connection pool submodule.
Specifically, the proxy module provides a general cluster access interface, and the cluster access interface is used for receiving an access request sent by the user equipment to access each cluster in the cluster access system. That is, when a user process needs to access each cluster in the cluster access system, the user process can be implemented by sending an access request to the cluster access interface.
1303. The connection pool submodule judges whether the client proxy equipment starts a first client corresponding to the first cluster, wherein the first client is a process started by the connection pool submodule according to the first configuration information of the first cluster. If the client agent device does not start the first client corresponding to the first cluster, step 1304 and 1306 are executed, and if the client agent device starts the first client corresponding to the first cluster, step 307 is executed.
The connection pool sub-module may look up the first client identifier corresponding to the cluster identifier of the first cluster from the mapping relationship table. The started client may have a corresponding client process running on the client proxy device. The client identifier corresponding to each client may be, for example, a port number of a client process corresponding to the client. After finding the port number mapped by the cluster identifier of the first cluster, the connection pool sub-module may send the first access request to the first client process corresponding to the first client according to the port number.
1304. When the first client corresponding to the first cluster is not started, the connection pool sub-module starts the first client according to the first configuration information of the first cluster, and then performs steps 1305 and 1309.
The connection pool submodule finds first configuration information of the first cluster from the configuration database according to the cluster identification of the first cluster, and starts the first client by utilizing the first configuration information.
1305. The connection pool submodule sends a first client identifier of the first client to the lease management submodule;
after the connection pool submodule starts the first client, the first client identifier of the first client is sent to the lease management submodule so as to instruct the lease management submodule to issue a lease to the first client according to a preset lease issue strategy, and therefore the first client can operate in a time period corresponding to the lease.
1306. The lease management submodule issues a lease to a first client according to a preset lease issue strategy;
when the connection pool submodule starts the first client, the connection pool submodule issues an initial lease to the first client, and the initial lease corresponds to an initial running time length, so that the first client runs within the initial running time length after starting.
After the first client is started, the lease management module issues the lease to the first client according to a preset lease issue strategy. And after the first client is started, the user can set a lease issue strategy according to actual requirements.
For a specific lease issue policy, reference may be made to the example of the lease issue policy in the foregoing embodiment, and details are not described here for avoiding redundancy.
1307. When a first client corresponding to the first cluster exists, the connection pool submodule acquires the running state of the first client and judges whether the running state of the first client is a normal state;
1308. and when the running state of the first client is not the normal state, the connection pool submodule starts a third client according to the first configuration information of the first cluster, and controls the first cluster to process the first access request by using the third client.
Therefore, the problem that the access request processing fails because the connection pool submodule sends the access request to the client with the operation state not being the normal state can be avoided, and the probability of the access request failure can be reduced.
When the operation state of the first client is the normal state, step 1309 is performed.
1309. And the connection pool submodule sends the first access request to the first client and processes the first access request by utilizing the first client.
Specifically, when the first client is started, a connection is established with the first cluster, and the first client sends the first request content in the first access request to the first cluster by using the connection, so that the first cluster processes the first access request.
1310. The configuration management submodule detects whether the first configuration information is updated.
The configuration database stores configuration information of a plurality of clusters, and when a node of any one cluster is changed or a service deployed on the node is updated, the configuration information of the cluster in the configuration database is also updated. The configuration management submodule can monitor whether the configuration information of each cluster in the configuration data is updated or not. For example, the configuration management sub-module may detect whether the configuration information of each cluster in the configuration data is updated according to a preset time interval.
For the update mechanism of the configuration information in the configuration database, reference may be made to the explanation of the configuration database in the above embodiment, which is not described herein again to avoid redundancy.
1311. When detecting that the first configuration information is updated, the configuration management submodule sends a configuration updating instruction to the connection pool submodule, wherein the configuration updating instruction comprises the cluster identification of the first cluster.
1312. And the connection pool submodule starts the second client according to the updated first configuration information.
Specifically, the connection pool submodule acquires the updated first configuration information from the configuration database according to the cluster identifier of the first cluster. In this way, the configuration management submodule may start the second client according to the updated first configuration information in the configuration database. The second client is used for processing the access request of the first cluster.
Specifically, after the second client is started, when the agent module receives a second access request of the first cluster sent by the user equipment through the user process, the agent module sends the second access request to the connection pool submodule, the connection pool submodule sends the second access request to the second client, and the second client processes the second access request.
After the second client is started, the connection pool submodule sends a client starting instruction and a client stopping instruction to the lease management module, wherein the client starting instruction comprises a client identifier of the first client, and the client stopping instruction comprises the client identifier of the first client. And the lease management submodule issues the lease to the second client according to the client starting instruction and a preset lease issue strategy and stops issuing the lease to the first client according to the client stopping instruction. Therefore, the client proxy equipment can timely recover the resources occupied by the first client.
If the first client is processing the third access request when the second client is started, the first client stops running after the third access request processing is completed.
Specifically, each time the configuration information of the cluster corresponding to the running client is updated, the configuration management sub-module starts a new client according to the updated configuration information, and the client started according to the updated configuration information is used for processing a subsequent access request about the cluster.
The configuration management submodule can monitor whether updated configuration information exists in the configuration database or not, and when the updated configuration information exists in the configuration database, the configuration management submodule obtains a cluster identifier corresponding to the updated configuration information, then searches a client identifier corresponding to the cluster identifier from the mapping relation table according to the cluster identifier, and if the client identifier corresponding to the cluster identifier exists, sends a configuration updating instruction to the connection pool submodule, wherein the configuration updating instruction comprises the cluster identifier, so that the connection pool submodule finds the updated configuration information from the configuration database according to the cluster identifier, and restarts a new client according to the updated configuration information. For example, when the cluster identifier corresponding to the updated configuration information is the cluster identifier of the first cluster, the configuration management submodule may determine that the first configuration information of the first cluster is updated and that the first client corresponding to the first cluster exists, and then the configuration management submodule sends a configuration update instruction to the connection pool submodule, where the configuration update instruction includes the cluster identifier of the first cluster. And the connection pool submodule acquires updated first configuration information from the configuration database according to the cluster identifier of the first cluster and starts the second client according to the updated first configuration information.
Based on the foregoing embodiments, in some embodiments, when the first cluster is a cluster that needs to be subjected to security authentication, the first access request includes a user identifier, a cluster identifier of the first cluster, and first request content, where the first request content includes task information that is to be processed by a user process requesting the first cluster. That is, if the first cluster is a cluster that needs to be subjected to security authentication, the user identifier and the cluster identifier of the first cluster need to be provided when the user triggers the first access request. In step 1309, when the connection pool module processes the first access request by using the first client, the first client first obtains the authentication file corresponding to the user identifier from the user information database of the first cluster, and then sends an authentication request to the first cluster according to the cluster identifier of the first cluster, where the authentication request includes the authentication file and the user identifier. And the first cluster authenticates the user identifier and the authentication file, and sends a first access credential to the first client according to the authority information of the user corresponding to the user identifier when the authentication file is confirmed to be matched with the user identifier. The first client sends the first request content and the first access credential to the first cluster so as to process the first request content by using the first cluster. After the first cluster verifies the validity of the first credential, the first request content is processed, so that the security of the cluster can be improved.
The user database of each cluster stores user identifications of a plurality of users and authentication files corresponding to the user identifications, and the authentication files can be password files containing password information or passwords, for example. The user database for each cluster may be stored in the configuration database as a configuration file for each cluster.
Specifically, the user corresponding to the user identifier may have access rights to all nodes of the first cluster, or may only have access rights to some nodes of the first cluster. The authority information is recorded with authority information about each node corresponding to the user identifier. The first cluster generates a first access credential according to the permission information. And when the first cluster receives the first execution instruction, processing the first request content after confirming that the user has the access right of the node to be accessed in the first request content according to the first access credential. Therefore, the first cluster can accurately process the access request according to the access authority of the user, and the security of the cluster is effectively improved.
Referring to fig. 14, an embodiment of the present application further provides a client proxy apparatus 400, including:
a request receiving module 401, configured to receive a first access request of a first cluster sent by a user equipment;
a first request processing module 402, configured to control the first cluster to process the first access request by using a first client, where the first client is started according to first configuration information of the first cluster;
a first client starting module 403, configured to start a second client according to the updated first configuration information when it is detected that the first configuration information is updated;
a second request processing module 404, configured to, when receiving a second access request of the first cluster, control, by the second client, the target cluster to process the second access request.
The first request processing module 401 in the present embodiment may be understood as a part of the agent module in the above-described embodiment; the first client startup module 402 in the embodiment of the present application may be understood as a part of the connection pool sub-module in the above embodiment; the second request processing module 403 in the embodiment of the present application may be understood as a part of the connection pool sub-module in the above-described embodiment.
According to the client proxy device 400 of the embodiment of the application, when the configuration information of the cluster is updated, a new client is started in time according to the updated configuration information, and the new client is used for processing the subsequently received access request of the cluster, so that access failure caused by the fact that a user process uses an un-updated client to process access to the cluster can be effectively avoided, and the probability of cluster access success is improved.
In some possible embodiments, the client proxy device 400 further comprises:
the first judgment module is used for judging whether the first client is started or not;
and the second client starting module is used for starting the first client according to the first configuration information of the first cluster when the first client is not started.
The first determining module in this embodiment may be understood as a part of the connection pool submodule in the above embodiment; the second client startup module in this embodiment may be understood as a part of the connection pool sub-module in the above-described embodiment.
Therefore, when the client proxy equipment does not start the first client, the first client is started according to the first configuration information of the first cluster, so that the first access request can be processed by the first client in time, and the success rate of cluster access is improved.
In some possible embodiments, the client proxy device 400 further comprises:
and the third client starting module is used for starting a third client according to the first configuration information of the first cluster when the first client corresponding to the first cluster is started and the running state of the first client is not a normal state, and controlling the first cluster to process the first access request by using the third client.
The third client startup module in this embodiment may be understood as a part of the connection pool sub-module in the above-described embodiment.
Therefore, when the client corresponding to the cluster is abnormally operated, a new client is restarted in time to process the access request corresponding to the cluster, so that the client agent equipment can normally process each access request, the access request processing failure caused by the abnormal operation of the client is avoided, and the probability of the access request failure can be reduced.
In some possible embodiments, the first cluster access request includes first request content and a user identifier corresponding to the user process;
the first request processing module 402 includes:
an authentication file obtaining unit, configured to obtain, by using a first client, an authentication file corresponding to the user identifier from a user database corresponding to the first cluster, and send the user identifier and the authentication file to the first cluster;
a credential receiving unit, configured to receive, by using the first client, a first access credential sent by the first cluster, where the first access credential is sent by the first cluster after the first cluster confirms that a user corresponding to the user identifier has an access condition of the first cluster based on the user identifier and the authentication file;
an instruction sending unit, configured to send, by the first client, a first request execution instruction to the first cluster, where the first request execution instruction includes the first access credential and first execution content, and the first execution instruction is used to instruct the first cluster to process the first request content when the authentication file is confirmed to be valid.
Therefore, the cluster can authenticate the identity and the authority of the user and process the request content, so that the security of the cluster can be improved.
In some possible embodiments, after the second client is started according to the updated first configuration information, the client proxy apparatus further includes:
a first stopping module, configured to, when the second client is started and the first client is controlling the first cluster to process a third access request, stop running the first client after processing of the third access request is completed;
and the second stopping module is used for stopping running the first client when the second client is started and the first client does not control the first cluster to process the access request.
The first stopping module in this embodiment may be understood as a part of the connecting pool sub-module in the above-described embodiment; the second stopping module in this embodiment may be understood as a part of the connecting pool sub-module in the above-described embodiment.
Therefore, after the first client processes the received access request, the client proxy equipment controls to stop running the first client, so that the first client can complete processing of the received access request, and the success rate of cluster access is improved. And when the second client is started, the first client is directly ended, so that the access request received by the first client cannot be executed, and the access failure is avoided.
It should be noted that the supplementary description of the cluster access method in the embodiment of the present application is also applicable to the client proxy device 400 in the embodiment of the present application, and is not described herein again to avoid redundancy.
An embodiment of the application provides a server, which comprises a processor and a memory. The memory stores computer instructions; the processor executes the computer instructions stored in the memory to cause the server to execute the cluster access method of any of the above embodiments, and cause the server to deploy the client agent device of any of the above embodiments.
Alternatively, fig. 15 schematically provides one possible basic hardware architecture of the server described herein.
Referring to fig. 15, a server 500 includes a processor 501, a memory 502, a communication interface 503, and a bus 504.
In the server 500, the number of the processors 501 may be one or more, and fig. 15 only illustrates one of the processors 501. Alternatively, the processor 501 may be a Central Processing Unit (CPU). If the server 500 has multiple processors 501, the types of the multiple processors 501 may be different, or may be the same. Alternatively, the plurality of processors 501 of the server 500 may also be integrated as a multi-core processor.
Memory 502 stores computer instructions and data; the memory 502 may store computer instructions and data required to implement the cluster access methods provided herein, e.g., the memory 502 stores instructions for implementing the steps of the cluster access methods. The memory 502 may be any one or any combination of the following storage media: nonvolatile memory (e.g., Read Only Memory (ROM), Solid State Disk (SSD), hard disk (HDD), optical disk), volatile memory.
The communication interface 503 may be any one or any combination of the following devices: a network interface (e.g., an ethernet interface), a wireless network card, etc. having a network access function.
The communication interface 503 is used for the server 500 to perform data communication with other computing devices or terminals.
The bus 504 may connect the processor 501 with the memory 502 and the communication interface 503. Thus, via bus 504, processor 501 may access storage 502 and may also interact with other computing devices or terminals via communication interface 503.
In the present application, server 500 executes computer instructions in memory 502 that cause server 500 to implement the cluster access methods provided herein or that cause server 500 to deploy client proxy devices.
The present application provides a computer-readable storage medium, in which computer instructions are stored, and the computer instructions instruct the server to execute the cluster access method of any of the above embodiments, or instruct the server to deploy the client proxy device of any of the above embodiments. A computer program product is provided that includes computer instructions stored in a computer readable storage medium. The processor of the server may read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the server to execute the cluster access method of any of the above embodiments, so that the server deploys the client proxy device of any of the above embodiments.
Embodiments of the present application provide a chip, where the chip may include a programmable logic circuit and/or a program instruction, and when the chip is operated, the chip is configured to implement the cluster access method according to any of the embodiments.
It should be understood that the Processor mentioned in the embodiments of the present Application may be a Central Processing Unit (CPU), and may also be other general purpose processors, Digital Signal Processors (DSP), Application Specific Integrated Circuits (ASIC), Field Programmable Gate Arrays (FPGA) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will also be appreciated that the memory referred to in the embodiments of the application may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of example, but not limitation, many forms of RAM are available, such as Static random access memory (Static RAM, SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), Double data rate Synchronous Dynamic random access memory (DDR SDRAM), Enhanced Synchronous SDRAM (ESDRAM), Synchronous link SDRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
It should be noted that when the processor is a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, the memory (memory module) is integrated in the processor.
It should be noted that the memory described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
It should also be understood that reference herein to first, second, third, fourth, and various numerical designations is made only for ease of description and should not be used to limit the scope of the present application.
It should be understood that the term "and/or" herein is merely one type of association relationship that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs.
The modules in the client proxy equipment in the embodiment of the application can be merged, divided and deleted according to actual needs.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some 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 application.

Claims (14)

1. A cluster access method, comprising:
the method comprises the steps that client proxy equipment receives a first access request of a first cluster sent by user equipment;
the client agent device controls the first cluster to process the first access request by utilizing a first client, wherein the first client is started by the client agent device according to first configuration information of the first cluster;
when the client agent equipment detects that the first configuration information is updated, the client agent equipment starts a second client according to the updated first configuration information; when the client agent device receives a second access request of the first cluster, controlling the target cluster to process the second access request by using the second client.
2. The cluster access method of claim 1, wherein before the client agent device utilizes a first client to control the first cluster to process the first access request, the cluster access method comprises:
the client proxy equipment judges whether the first client is started or not;
and when the first client is not started, the client proxy equipment starts the first client according to the first configuration information of the first cluster.
3. The cluster access method of claim 2, further comprising:
when the client agent device starts a first client corresponding to the first cluster and the running state of the first client is not a normal state, the client agent device starts a third client according to the first configuration information of the first cluster, and the third client is utilized to control the first cluster to process the first access request.
4. The cluster access method according to any one of claims 1 to 3, wherein the first cluster access request comprises first request content and a user identifier corresponding to the user process;
the client agent device controlling the first cluster to process the first access request by using a first client comprises:
the client proxy equipment acquires an authentication file corresponding to the user identifier from a user database corresponding to the first cluster by using a first client, and sends the user identifier and the authentication file to the first cluster;
the client agent device receives a first access credential sent by the first cluster by using the first client, wherein the first access credential is sent by the first cluster after the first cluster confirms that a user corresponding to the user identifier has an access condition of the first cluster based on the user identifier and the authentication file;
the client agent device sends a first request execution instruction to the first cluster by using the first client, wherein the first request execution instruction comprises the first access credential and first execution content, and the first execution instruction is used for instructing the first cluster to process the first request content when the authentication file is confirmed to be valid.
5. The cluster access method according to any of claims 1-4, wherein after the client agent device starts a second client according to the updated first configuration information, the cluster access method further comprises:
when the client proxy device starts the second client and the first client is controlling the first cluster to process a third access request, the client proxy device stops running the first client after the third access request processing is completed;
when the client agent device starts the second client and the first client does not control the first cluster to process the access request, the client agent device stops running the first client.
6. A client proxy device, comprising:
the request receiving module is used for receiving a first access request of a first cluster sent by user equipment;
a first request processing module, configured to control the first cluster to process the first access request by using a first client, where the first client is started according to first configuration information of the first cluster;
the first client starting module is used for starting a second client according to the updated first configuration information when the first configuration information is detected to be updated;
and the second request processing module is used for controlling the target cluster to process a second access request by utilizing the second client when the second access request of the first cluster is received.
7. The client proxy device of claim 6, further comprising:
the first judgment module is used for judging whether the first client is started or not;
and the second client starting module is used for starting the first client according to the first configuration information of the first cluster when the first client is not started.
8. The client proxy device of claim 7, further comprising:
and the third client starting module is used for starting a third client according to the first configuration information of the first cluster when the first client corresponding to the first cluster is started and the running state of the first client is not a normal state, and controlling the first cluster to process the first access request by using the third client.
9. The client proxy device of any of claims 6-8, wherein the first cluster access request comprises first request content and a user identification corresponding to the user process;
the first request processing module includes:
an authentication file obtaining unit, configured to obtain, by using a first client, an authentication file corresponding to the user identifier from a user database corresponding to the first cluster, and send the user identifier and the authentication file to the first cluster;
a credential receiving unit, configured to receive, by using the first client, a first access credential sent by the first cluster, where the first access credential is sent by the first cluster after the first cluster confirms that a user corresponding to the user identifier has an access condition of the first cluster based on the user identifier and the authentication file;
an instruction sending unit, configured to send, by the first client, a first request execution instruction to the first cluster, where the first request execution instruction includes the first access credential and first execution content, and the first execution instruction is used to instruct the first cluster to process the first request content when the authentication file is confirmed to be valid.
10. The client proxy device of any of claims 6-9, wherein the client proxy device further comprises:
a first stopping module, configured to, when the second client is started and the first client is controlling the first cluster to process a third access request, stop running the first client after processing of the third access request is completed;
and the second stopping module is used for stopping running the first client when the second client is started and the first client does not control the first cluster to process the access request.
11. A server, comprising a processor and a memory, the memory storing computer instructions; the processor executing the computer instructions stored by the memory causes the server to perform the cluster access method of any of claims 1-5 or causes the server to deploy the client proxy device of any of claims 6-10.
12. A computer-readable storage medium having stored therein computer instructions for instructing a server to perform the cluster access method of any one of claims 1 to 5, or instructing a server to deploy the client proxy device of any one of claims 6 to 10.
13. A computer program product, characterized in that it comprises computer instructions instructing a server to perform the cluster access method of any of claims 1-5 or instructing the server to deploy the client proxy device of any of claims 6-10.
14. A chip which may comprise programmable logic circuits and/or program instructions for implementing the cluster access method of any one of claims 1 to 5 when the chip is run.
CN201910913676.2A 2019-09-25 2019-09-25 Cluster access method and related product Active CN110602136B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910913676.2A CN110602136B (en) 2019-09-25 2019-09-25 Cluster access method and related product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910913676.2A CN110602136B (en) 2019-09-25 2019-09-25 Cluster access method and related product

Publications (2)

Publication Number Publication Date
CN110602136A true CN110602136A (en) 2019-12-20
CN110602136B CN110602136B (en) 2021-09-14

Family

ID=68863573

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910913676.2A Active CN110602136B (en) 2019-09-25 2019-09-25 Cluster access method and related product

Country Status (1)

Country Link
CN (1) CN110602136B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111695098A (en) * 2020-06-04 2020-09-22 中国工商银行股份有限公司 Multi-distributed cluster access method and device
CN111737741A (en) * 2020-06-19 2020-10-02 中国工商银行股份有限公司 Distributed database cluster access method and intermediate service layer
CN113472823A (en) * 2020-03-30 2021-10-01 深圳Tcl数字技术有限公司 Server access method and device, intelligent terminal and storage medium
WO2024026838A1 (en) * 2022-08-05 2024-02-08 Oppo广东移动通信有限公司 Communication method, apparatus and device, and storage medium, chip, product and program

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183377A (en) * 2007-12-10 2008-05-21 华中科技大学 High availability data-base cluster based on message middleware
CN102104628A (en) * 2010-12-29 2011-06-22 北京新媒传信科技有限公司 Server cluster system and management method thereof
CN102609463A (en) * 2012-01-13 2012-07-25 广东电网公司电力科学研究院 Data cluster management system based on quasi-realtime platform
CN107483491A (en) * 2017-09-19 2017-12-15 山东大学 The access control method of distributed storage under a kind of cloud environment
US20180337891A1 (en) * 2015-05-27 2018-11-22 Ping Identity Corporation Methods and systems for api proxy based adaptive security
CN109040263A (en) * 2018-08-10 2018-12-18 北京奇虎科技有限公司 Method for processing business and device based on distributed system
CN109756366A (en) * 2018-12-24 2019-05-14 上海欣方智能系统有限公司 System is realized in intelligent network SCP cloud service based on CAAS

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183377A (en) * 2007-12-10 2008-05-21 华中科技大学 High availability data-base cluster based on message middleware
CN102104628A (en) * 2010-12-29 2011-06-22 北京新媒传信科技有限公司 Server cluster system and management method thereof
CN102609463A (en) * 2012-01-13 2012-07-25 广东电网公司电力科学研究院 Data cluster management system based on quasi-realtime platform
US20180337891A1 (en) * 2015-05-27 2018-11-22 Ping Identity Corporation Methods and systems for api proxy based adaptive security
CN107483491A (en) * 2017-09-19 2017-12-15 山东大学 The access control method of distributed storage under a kind of cloud environment
CN109040263A (en) * 2018-08-10 2018-12-18 北京奇虎科技有限公司 Method for processing business and device based on distributed system
CN109756366A (en) * 2018-12-24 2019-05-14 上海欣方智能系统有限公司 System is realized in intelligent network SCP cloud service based on CAAS

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JIANQIANG LI; SHULAN WANG; YUAN LI; HAIYAN WANG; HUIWEN WANG;: "An Efficient Attribute-Based Encryption Scheme With Policy Update and File Update in Cloud Computing", 《IEEE TRANSACTIONS ON INDUSTRIAL INFORMATICS》 *
张敏杰: "大并发访问下的企业J2EE信息系统集群架构研究", 《2009电力行业信息化年会论文集》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113472823A (en) * 2020-03-30 2021-10-01 深圳Tcl数字技术有限公司 Server access method and device, intelligent terminal and storage medium
CN113472823B (en) * 2020-03-30 2023-06-27 深圳Tcl数字技术有限公司 Server access method and device, intelligent terminal and storage medium
CN111695098A (en) * 2020-06-04 2020-09-22 中国工商银行股份有限公司 Multi-distributed cluster access method and device
CN111695098B (en) * 2020-06-04 2023-08-11 中国工商银行股份有限公司 Multi-distributed cluster access method and device
CN111737741A (en) * 2020-06-19 2020-10-02 中国工商银行股份有限公司 Distributed database cluster access method and intermediate service layer
CN111737741B (en) * 2020-06-19 2024-02-27 中国工商银行股份有限公司 Distributed database cluster access method and intermediate service layer
WO2024026838A1 (en) * 2022-08-05 2024-02-08 Oppo广东移动通信有限公司 Communication method, apparatus and device, and storage medium, chip, product and program

Also Published As

Publication number Publication date
CN110602136B (en) 2021-09-14

Similar Documents

Publication Publication Date Title
CN110602136B (en) Cluster access method and related product
US11615195B2 (en) Systems and methods for providing multi-node resiliency for blockchain peers
US10819701B2 (en) Autonomous secrets management for a managed service identity
CN109976822B (en) Configuration method and device of distributed application and distributed system
US20070244999A1 (en) Method, apparatus, and computer product for updating software
US10691790B2 (en) Autonomous secrets management for a temporary shared access signature service
US11269655B2 (en) Bare metal device management
US8533525B2 (en) Data management apparatus, monitoring apparatus, replica apparatus, cluster system, control method and computer-readable medium
US20170118211A1 (en) Native enrollment of mobile devices
CN105794182A (en) Lock server malfunction processing method and system thereof in distribution system
CN112162825A (en) Equipment configuration method, device, equipment and storage medium
CN110163003B (en) Password management method and device
US8725887B2 (en) License management system and function providing device
US20170115979A1 (en) Enforcement of updates for devices unassociated with a directory service
US8635670B2 (en) Secure centralized backup using locally derived authentication model
WO2020252724A1 (en) Log processing method and device, and computer-readable storage medium
KR101638689B1 (en) System and method for providing client terminal to user customized synchronization service
CN113821168A (en) Shared storage migration system and method, electronic equipment and storage medium
JP2008176749A (en) Id lending device, id lending program, and id lending method
EP4195033A1 (en) Method and apparatus for upgrading blockchain system, and terminal device
CN115905271B (en) Virus library updating method and device and multi-engine detection system
CN112379845B (en) Cluster capacity expansion method and device, computing equipment and storage medium
CN106970794B (en) Server cluster and starting method thereof
US20240103970A1 (en) Backup images for computing devices
US20210021472A1 (en) Enforcement of updates for devices unassociated with a directory service

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220211

Address after: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province

Patentee after: Huawei Cloud Computing Technology Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.