Summary of the invention
The invention provides a kind of server access methods, devices and systems, the wasting of resources when having solved client, inefficient problem by the four-layer load-equalizing access server.
A kind of server access method comprises:
Load balance scheduler is described client select target server according to the application layer user profile in the client requests of client transmission;
Described load balance scheduler is indicated the directly described destination server of visit of described client.
Further, described load balance scheduler indicates the described destination server of the direct visit of described client to comprise:
Described load balance scheduler generates the HTTP redirection instruction according to the application layer user profile in the described client requests, the address of carrying described destination server in described HTTP redirection instruction;
Described load balance scheduler sends described HTTP redirection instruction to described client, indicates the directly described destination server of visit of described client.
Further, described load balance scheduler is according to the application layer user profile in the client requests of client transmission, for described client select target server comprises:
Described load balance scheduler obtains at least one server that corresponding service is provided according to described application layer user profile;
From described at least one server, select the lighter server of load as destination server.
The present invention also provides a kind of server access method, comprising:
Client sends client requests to load balance scheduler, carries the application layer user profile of described client in described client requests;
Described client receives the HTTP redirection instruction that described load balance scheduler responds described client requests, the address of carrying destination server in described HTTP redirection instruction;
Described client sends client requests according to the address of described destination server to described destination server.
The present invention also provides a kind of load balance scheduler, comprising:
Server is selected module, and the application layer user profile according in the client requests of client transmission is described client select target server;
Indicating module is used to indicate the directly described destination server of visit of described client.
Further, described server selects module to comprise:
The scope determining unit is used for obtaining at least one server that corresponding service is provided according to described application layer user profile;
Select performance element, be used for, select the lighter server of load as destination server from described at least one server.
Further, described indicating module comprises:
The instruction generation unit is used for the application layer user profile according to described client requests, generates the HTTP redirection instruction, the address of carrying described destination server in described HTTP redirection instruction;
Instruction issues the unit, is used for sending described HTTP redirection instruction to described client, indicates the directly described destination server of visit of described client.
The present invention also provides a kind of client, comprising:
The command reception module is used to receive the HTTP redirection instruction, the address of carrying destination server in described HTTP redirection instruction;
The client requests sending module is used for sending client requests to load balance scheduler, carries the application layer user profile of described client in described client requests; Or,
After described command reception module receives the HTTP redirection instruction,, send client requests to described destination server according to the address of described destination server.
The present invention also provides a kind of server access system, comprises load balance scheduler and client;
Described load balance scheduler is used for the application layer user profile according to the client requests of client transmission, is described client select target server, and indicates the directly described destination server of visit of described client;
Described client, be used for sending client requests to load balance scheduler, in described client requests, carry the application layer user profile of described client, receive the HTTP redirection instruction that described load balance scheduler sends, the address of in described HTTP redirection instruction, carrying destination server, and, send client requests to described destination server according to the address of described destination server.
Embodiments of the invention provide a kind of server access method, device and system, when load balance scheduler receives the client requests of client transmission, at first extract the user profile in this client requests, generate corresponding HTTP redirection instruction according to user profile, the address of in this HTTP redirection instruction, carrying destination server, send described HTTP redirection instruction to described client then, indicate the directly described destination server of visit of described client, client is after receiving this HTTP redirection instruction, will be according to the address of wherein destination server, destination server is conducted interviews, realized dynamic load leveling to client requests, improved server access efficient, the unbalanced problem of server load when having solved client by the four-layer load-equalizing access server.
Embodiment
When realizing client by four-layer load-equalizing to the visit of server, can't learn the content of user in the application layer input, so can only be arranged to the content that is in a plurality of servers in the same SiteServer LBS in full accord, client requests is transmitted according to IP and port by load balance scheduler, system flexibility is poor, has wasted server resource.
In order to address the above problem, embodiments of the invention provide a kind of server access method, use this method to finish to the flow process of server access as shown in Figure 1, comprising:
Step 101, load balance scheduler receive the client requests that client sends;
In this step, client sends client requests to load balance scheduler, asks the business in this load balance scheduler place virtual server.In this client requests, carry application layer user profile, user profile comprises keyword, file suffixes of client requests content etc.
Step 102, load balance scheduler be according to client requests, the select target server;
This step comprises specifically as shown in Figure 2:
Step 1021, described load balance scheduler obtain at least one server that corresponding service is provided according to the application layer user profile in the described client requests;
In this step, load balance scheduler is determined the type of service of client requests according to application layer user profile, and then determines to provide at least one server of this business.
Step 1022, from described at least one server, select the lighter server of load as destination server;
In this step, the load state of each server that load balance scheduler detection step 1021 is obtained, and select the lighter server of load as destination server, for client provides professional.
Step 103, load balance scheduler generate and send the HTTP redirection instruction to described client, indicate the directly described destination server of visit of described client;
In this step, load balance scheduler generates the HTTP redirection instruction according to the destination server of determining in the step 102, and the address of carrying destination server in this instruction sends to client with this HTTP redirection instruction.
Step 104, client send client requests according to the address of described destination server to described destination server;
In this step, client receives described HTTP redirection instruction, according to the address of the destination server that wherein carries, sends client requests to destination server, and when after this needing to use professional that this destination server provides, directly send client requests to this destination server.
In addition,, can be equipped with a backup machine, realize two-node cluster hot backup for each server for the enhanced system reliability.
Because the embodiment of the invention can be carried out load balancing at the user profile of application layer, thus can be with each server institute loaded service granularity refinement, and each server also is improved to the treatment effeciency of client requests.
Embodiments of the invention also provide a kind of load balance scheduler, and its structure comprises as shown in Figure 3:
Server is selected module 301, and the application layer user profile according in the client requests of client transmission is described client select target server;
Indicating module 302 is used to indicate the directly described destination server of visit of described client.
Further, the structure of described server selection module 301 comprises as shown in Figure 4:
Scope determining unit 3011 is used for obtaining at least one server that corresponding service is provided according to described application layer user profile;
Select performance element 3012, be used for, select the lighter server of load as destination server from described at least one server.
Further, the structure of described indicating module 302 comprises as shown in Figure 5:
Instruction generation unit 3021 is used for the application layer user profile according to described client requests, generates the HTTP redirection instruction, the address of carrying described destination server in described HTTP redirection instruction;
Instruction issues unit 3022, is used for sending described HTTP redirection instruction to described client, indicates the directly described destination server of visit of described client.
Embodiments of the invention also provide a kind of client, and its structure comprises as shown in Figure 6:
Command reception module 601 is used to receive the HTTP redirection instruction, the address of carrying destination server in described HTTP redirection instruction;
Client requests sending module 602 is used for sending client requests to load balance scheduler, carries the application layer user profile of described client in described client requests; Or,
After described command reception module receives the HTTP redirection instruction,, send client requests to described destination server according to the address of described destination server.
Embodiments of the invention also provide a kind of server access system, and its structure comprises load balance scheduler 701 and client 702 as shown in Figure 7;
Described load balance scheduler 701 is used for the application layer user profile according to the client requests of client 702 transmissions, is described client 720 select target servers, and indicates the directly described destination server of visit of described client 702;
Described client 702, be used for sending client requests to load balance scheduler 701, in described client requests, carry the application layer user profile of described client 702, receive the HTTP redirection instruction that described load balance scheduler 701 sends, the address of in described HTTP redirection instruction, carrying destination server, and, send client requests to described destination server according to the address of described destination server.
Above-mentioned load balance scheduler, the client and server access system, can combine with a kind of server access method that embodiments of the invention provide, when load balance scheduler receives the client requests of client transmission, at first extract the user profile in this client requests, generate corresponding HTTP redirection instruction according to user profile, the address of in this HTTP redirection instruction, carrying destination server, send described HTTP redirection instruction to described client then, indicate the directly described destination server of visit of described client, client is after receiving this HTTP redirection instruction, will be according to the address of wherein destination server, destination server is conducted interviews, realized dynamic load leveling to client requests, improved server access efficient, the unbalanced problem of server load when having solved client by the four-layer load-equalizing access server.
One of ordinary skill in the art will appreciate that and realize that all or part of step that the foregoing description method is carried is to instruct relevant hardware to finish by program, described program can be stored in a kind of computer-readable recording medium, this program comprises one of step or its combination of method embodiment when carrying out.
In addition, each functional unit in each embodiment of the present invention can adopt the form of hardware to realize, also can adopt the form of software function module to realize.If described integrated module realizes with the form of software function module and during as independently production marketing or use, also can be stored in the computer read/write memory medium.
The above-mentioned storage medium of mentioning can be a read-only memory, disk or CD etc.
The above; only be the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the described protection range of claim.