Master-slave relation switching method, slave server, master server and system
A main server, server technology, applied in the server field, can solve the problem of low request response efficiency, and achieve the effect of shortening request response time, improving reliability, and improving request response efficiency
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0054] see Figure 4 , is a schematic flowchart of the master-slave relationship switching method provided in Embodiment 1 of the present invention, which is applied to a slave server, and the slave server and the master server are in the same local area network, and the slave server can be implemented by software and / or hardware, The method specifically includes steps S01 to S04:
[0055] Step S01, calculate the load score of the slave server according to a preset calculation formula.
[0056] Wherein, the preset calculation formula can be as follows:
[0057] score=A*ip offet +B*cpu%+C*mem%;
[0058] Among them, score is the load score, cpu% is the CPU usage rate, mem% is the memory usage rate, and ip offet is the offset between the ip address of the slave server and the ip address of the master server, and A, B, and C are weight coefficients. The lower the score, the lower the resource usage, the higher the priority, and the server with the highest priority will be swi...
Embodiment 2
[0072] see Figure 5 , is a schematic flowchart of a master-slave relationship switching method provided in Embodiment 2 of the present invention, which is applied to a slave server. The slave server and the master server are in the same local area network, and the slave server can be controlled by software and / or hardware. To achieve, the method includes step S11 to step S16.
[0073] Step S11, calculating the load score of the slave server according to a preset calculation formula.
[0074] Wherein, the preset calculation formula is as follows:
[0075] score=0.2*ip offet +0.5*cpu%+0.3*mem%;
[0076] Among them, score is the load score, cpu% is the CPU usage rate, mem% is the memory usage rate, and ip offet is the offset between the ip address of the slave server and the ip address of the master server.
[0077] Step S12, acquiring the load score of the main server.
[0078] Step S13, judging whether the load score of the master server is higher than the load score of ...
Embodiment 3
[0088] see Figure 7 , is a schematic flowchart of a master-slave relationship switching method provided in Embodiment 3 of the present invention, which is applied to a master server, where the master server and at least one slave server are in the same local area network, and the master server can be controlled by software and / or implemented by hardware, the method includes step S21 to step S22.
[0089] Step S21, judging whether the switching signal sent by the server is received.
[0090] Step S22, switching the primary server to a backup primary server.
[0091] Specifically, the step of switching the primary server to a backup primary server may specifically include:
[0092] Switching the state of the main server to a backup state, and at the same time changing the current address of the main server to the original address of the main server.
[0093] Wherein, the original address is an originally assigned IP address. Specifically, when the main server detects a swit...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


