CN114039976B - Master-slave management method and system for server cluster - Google Patents

Master-slave management method and system for server cluster Download PDF

Info

Publication number
CN114039976B
CN114039976B CN202111275662.6A CN202111275662A CN114039976B CN 114039976 B CN114039976 B CN 114039976B CN 202111275662 A CN202111275662 A CN 202111275662A CN 114039976 B CN114039976 B CN 114039976B
Authority
CN
China
Prior art keywords
server
slave
master
cascade
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.)
Active
Application number
CN202111275662.6A
Other languages
Chinese (zh)
Other versions
CN114039976A (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.)
Shenzhen Consys Technology Co ltd
Original Assignee
Shenzhen Consys Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Consys Technology Co ltd filed Critical Shenzhen Consys Technology Co ltd
Priority to CN202111275662.6A priority Critical patent/CN114039976B/en
Publication of CN114039976A publication Critical patent/CN114039976A/en
Application granted granted Critical
Publication of CN114039976B publication Critical patent/CN114039976B/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
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • 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/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • 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 
    • H04L67/1051Group master selection mechanisms

Landscapes

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

Abstract

The invention discloses a server cluster master-slave management method and system. Belonging to the field of computers. The server cluster master-slave management method comprises the following steps of; acquiring all server units in a server cluster, and adjusting the server units to a first state; acquiring identity authentication information; according to the acquisition state of the identity authentication information, executing one of the following steps: if the server unit acquires the identity authentication information, the server unit is used as a slave server; or if the server unit does not acquire the identity authentication information under the preset first condition, the server unit is brought into the to-be-processed server set, and host election is carried out on the server unit in the to-be-processed server set to obtain a master server and a slave server. The method can effectively manage the server cluster while reducing the operation difficulty.

Description

Master-slave management method and system for server cluster
Technical Field
The invention relates to the field of computers, in particular to a server cluster master-slave management method and system.
Background
In the related art, the existing cluster management method mostly depends on experience of technicians to realize cluster server maintenance, and the operation threshold is high. Therefore, how to provide a server cluster management method with simple operation and high visibility becomes a problem to be solved urgently.
Disclosure of Invention
The present invention aims to solve at least one of the technical problems existing in the prior art. Therefore, the invention provides a master-slave management method for a server cluster, which can realize the management of the server cluster while reducing the operation difficulty.
The invention also provides a server cluster master-slave management system with the server cluster master-slave management method.
According to an embodiment of the first aspect of the present invention, a server cluster master-slave management method includes:
acquiring all server units in a server cluster, and adjusting the server units to a first state;
acquiring identity authentication information; according to the acquisition state of the identity authentication information, executing one of the following steps:
if the server unit acquires the identity authentication information, the server unit is used as a slave server;
or,
if the server unit does not acquire the identity authentication information under the preset first condition, the server unit is brought into a to-be-processed server set, and host selection is performed on the server unit in the to-be-processed server set to obtain a master server and a slave server.
The server cluster master-slave management method provided by the embodiment of the invention has at least the following beneficial effects: the master-slave management method of the server cluster can acquire all the server units in the server cluster and communicate with all the server units so as to adjust the working states of all the server units to a first state and control the server units to acquire identity authentication information; by reading the acquisition state of each server unit for the identity authentication information, selecting and executing one of the following steps: if the server unit acquires the identity authentication information, the working state of the server unit corresponding to the acquired identity authentication information is adjusted to a slave server state, and the corresponding server unit is used as a slave server; or if the server unit does not acquire the identity authentication information under the preset first condition, the corresponding server unit is brought into the to-be-processed server set, and host election is carried out on all the server units in the to-be-processed server set, so that all the server units in the to-be-processed server set are divided into a master server and a slave server, and the corresponding master server and the corresponding slave server are obtained. The method can effectively divide all the server units into the master server and the slave servers by the method of acquiring the identity authentication information and selecting the host, thereby simplifying the management method of the server cluster and effectively reducing the management difficulty of the server cluster.
According to some embodiments of the invention, the method further comprises:
and controlling the master server to output a first heartbeat message to the slave server.
According to some embodiments of the invention, the method further comprises:
controlling the main server to receive the second heartbeat message output by the slave server;
and controlling the main server to generate first cascade information according to the second heartbeat message.
According to some embodiments of the invention, the method further comprises:
if the main server acquires the identity authentication information at least three times, controlling all server units to perform host election to obtain host election data;
obtaining a target server unit according to the host election data;
and taking the target server unit as a target master server and taking the master server as a slave server.
According to some embodiments of the invention, the method further comprises:
and if the slave server does not send the second heartbeat message or does not receive the first heartbeat message under a preset third condition, adjusting the state of the slave server to the first state.
According to some embodiments of the invention, the method further comprises:
acquiring first cascade information of the main server;
generating second cascade information of the target main server according to the first cascade information;
and synchronizing the second cascade information to the target main server.
According to some embodiments of the present invention, if the server unit does not acquire the identity authentication information under a preset first condition, the server unit is brought into a to-be-processed server set, and a host election is performed on the server unit in the to-be-processed server set to obtain a master server and a slave server, including:
acquiring third cascade information of server units in the server set to be processed;
obtaining a cascade number set according to the third cascade information;
obtaining the maximum cascade number according to the cascade number set;
and obtaining a master server and a slave server according to the maximum cascade number.
According to some embodiments of the invention, the obtaining a master server and a slave server according to the maximum concatenation number includes:
according to the maximum cascade number, executing one of the following steps:
if the maximum cascade number corresponds to one server unit, the server unit corresponding to the maximum cascade number is used as a main server;
taking the rest server units in the server set to be processed as slave servers;
or,
if the maximum cascade number corresponds to at least two server units, acquiring the MAC address of the server unit corresponding to the maximum cascade number;
and obtaining the master server and the slave server according to the MAC address.
An embodiment of a server cluster master-slave management system according to a second aspect of the present invention includes:
cluster software for executing the server cluster master-slave management method according to any one of claims 1 to 9;
the server unit is used for acquiring and sending the identity authentication information, the first heartbeat message and the second heartbeat message; the first concatenation information, the second concatenation information, the third concatenation information, and the MAC address are also stored and updated.
The server cluster master-slave management system provided by the embodiment of the invention has at least the following beneficial effects:
the server cluster master-slave management system provided by the invention can realize the server cluster master-slave management method according to the embodiment of the first aspect of the invention through cluster software, so as to obtain all server units in the server cluster, and communicate with all server units, thereby adjusting the working states of all server units to a first state and controlling the server units to obtain identity authentication information; by reading the acquisition state of each server unit for the identity authentication information, selecting and executing one of the following steps: if the server unit acquires the identity authentication information, the working state of the server unit corresponding to the acquired identity authentication information is adjusted to a slave server state, and the corresponding server unit is used as a slave server; or if the server unit does not acquire the identity authentication information under the preset first condition, the corresponding server unit is brought into the server set to be processed, and host election is carried out on all the server units in the server set to be processed; the server cluster master-slave machine management system provided by the invention can acquire and send the identity authentication information, the first heartbeat message and the second heartbeat message through the server unit; the first cascade information, the second cascade information, the third cascade information and the MAC address are stored and updated to realize the server cluster master-slave management method according to the embodiment of the first aspect of the invention. The server cluster master-slave machine management system provided by the invention can effectively manage the server units through cluster software, so that the configuration of the server units is realized, the difficulty of cluster management is reduced, and meanwhile, the division of master-slave servers of all the server units in the cluster servers is realized, so that the management of the cluster servers is realized.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The invention is further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flow chart of a method for managing a master-slave machine of a server cluster according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for managing a server cluster master-slave machine according to an embodiment of the present invention.
FIG. 3 is a flowchart illustrating a method for managing a server cluster master-slave machine according to an embodiment of the present invention.
FIG. 4 is a flowchart illustrating a method for managing a server cluster master-slave machine according to an embodiment of the present invention.
FIG. 5 is a flowchart illustrating a method for managing a server cluster master-slave machine according to an embodiment of the present invention.
Fig. 6 is a specific flowchart of step S400 in fig. 1.
Fig. 7 is a specific flowchart of step S440 in fig. 6.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the invention.
In the description of the present invention, it should be understood that references to orientation descriptions such as upper, lower, front, rear, left, right, etc. are based on the orientation or positional relationship shown in the drawings, are merely for convenience of description of the present invention and to simplify the description, and do not indicate or imply that the apparatus or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus should not be construed as limiting the present invention.
In the description of the present invention, the meaning of a number is one or more, the meaning of a number is two or more, and greater than, less than, exceeding, etc. are understood to exclude the present number, and the meaning of a number is understood to include the present number. The description of the first and second is for the purpose of distinguishing between technical features only and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.
In the description of the present invention, unless explicitly defined otherwise, terms such as arrangement, installation, connection, etc. should be construed broadly and the specific meaning of the terms in the present invention can be reasonably determined by a person skilled in the art in combination with the specific contents of the technical scheme.
In the description of the present invention, the descriptions of the terms "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
In a first aspect, referring to fig. 1, the present invention provides a server cluster master-slave management method. Comprising the following steps:
s100, acquiring all server units in a server cluster, and adjusting the server units to a first state;
s200, acquiring identity authentication information; according to the acquisition state of the identity authentication information, executing one of the following steps:
s300, if the server unit acquires the identity authentication information, the server unit is used as a slave server;
or,
s400, if the server unit does not acquire the identity authentication information under the preset first condition, the server unit is brought into a to-be-processed server set, and host selection is performed on the server unit in the to-be-processed server set to obtain a master server and a slave server.
The master-slave management method of the server cluster can acquire the communication addresses of all the server units in the server cluster, realize communication with each server unit according to the server units corresponding to the communication addresses, and control each server unit to be in a first state according to the communication instructions. Specifically, the first state may be an isolated state, and the server unit in the isolated state stores only the current isolated state of the server unit and clears the cascade state of the server unit. The method can also control the server units to acquire the identity authentication information, monitor the acquisition state of each server unit for the identity authentication information, and execute one of the following steps according to the acquisition state of the identity authentication information: if the monitoring result shows that the server unit receives the identity authentication information, controlling the server unit which correspondingly acquires the identity authentication information to adjust to a slave server state, and taking the server unit which acquires the identity authentication information as a slave server; or if the monitoring result shows that the part of server units do not acquire the identity authentication information under the preset first condition, the part of server units which do not acquire the identity authentication information are brought into the server set to be processed, and host selection is performed on all servers in the server set to be processed, so that the server units in the server set to be processed are classified, and a master server and a slave server are generated. The method can effectively divide all server units into the master server and the slave server through the method for acquiring the identity authentication information and selecting the host, thereby realizing automatic division of the cluster servers, controlling the divided master server and divided slave servers, simplifying the server cluster management method and effectively reducing the management difficulty of the server clusters.
In some specific embodiments, the preset first condition may be that no authentication information is received three times in a preset period of receiving authentication information, and in some embodiments, the first condition may be other, without limitation.
In some embodiments, the method further comprises:
and controlling the master server to output the first heartbeat message to the slave server.
The method can control the slave server to automatically change the working state of the slave server according to the acquired first heartbeat message by outputting the first heartbeat message to the slave server. Specifically, when the slave server receives the first heartbeat message output by the master server, the slave server may determine that the slave server itself is still in a connection state with the master server, control the working state of the slave server according to the current connection state to be in the slave server state, and receive information output by the master server. In some specific embodiments, after receiving the first heartbeat message output by the master server, the slave server synchronizes the local cascade information according to the first heartbeat message, and stores the synchronized local cascade information into the slave server. By the method, the master server can detect and control the working state of the slave servers, so that the slave servers connected with the master server in the whole server cluster are controlled.
In some embodiments, referring to fig. 2, the method further comprises:
s510, controlling the main server to receive a second heartbeat message output by the slave server;
s520, the control main server generates first cascade information according to the second heartbeat message.
The method can control the main server to receive the second heartbeat message output by the slave server and generate the first cascade information according to the second heartbeat message. Specifically, initialized cascade information is pre-stored in each server unit, when a certain server unit is adjusted to a main server state through host election, and after the server unit is used as a main server, the method changes the cascade information of the main server, namely, the cascade information of the host is updated according to a second heartbeat message output from the server, and first cascade information is generated according to the updated cascade information. By the method, the master server can effectively synchronize the slave server information which is in communication interaction with the master server in the current server cluster, so that the effect of automatically controlling the slave servers through the master server can be achieved, and the difficulty of a server cluster management method is effectively reduced.
In some embodiments, referring to fig. 3, the method further comprises:
s610, the main server is controlled to acquire a third heartbeat message under a preset second condition;
s620, updating the first cascade information according to the second heartbeat message and the third heartbeat message.
The method can control the main server to acquire the third heartbeat message under the preset second condition, and update the first cascade information according to the second heartbeat message and the third heartbeat message. Specifically, under a preset second condition, the master server may process a third heartbeat message output by the slave server which performs communication interaction with the master server, compare the third heartbeat message with a second heartbeat message obtained by the master server after the host computer is elected, obtain a slave server still connected in the server cluster network currently according to a comparison result, screen the slave server leaving the server cluster network through the second heartbeat message, and update current first cascade information of the master server according to a screening result. According to the method, the master server can acquire the slave servers in the current server cluster network in real time, and update the first cascade information stored in the master server according to the connection state of the slave servers in the current server cluster network, so that the management of the master server on the slave servers is realized, and meanwhile, the connection state of the slave servers in the server cluster can be clarified, so that the simple and efficient control of the server cluster is realized.
In some embodiments, referring to fig. 4, the method further comprises:
s710, if the main server acquires at least three times of identity authentication information, controlling all server units to perform host election to acquire host election data;
s720, obtaining a target server unit according to host election data;
s730, the target server unit is taken as a target master server, and the master server is taken as a slave server.
The method can control the main server to acquire the identity authentication information, generally, the main server only outputs a first heartbeat message or receives a second heartbeat message, when the method controls the main server and the slave servers of the server units in the server cluster to change, the main server can receive the identity authentication information, control the main server to perform host election with all the server units after receiving the identity authentication information for at least three times, and determine a target server unit according to a host election result, thereby controlling the target server unit to change the working state to the main server state, taking the target server as a target main server, simultaneously adjusting the working state of the original main server to the slave server state, and taking the original main server as the slave server. The method can change the master-slave relation of the servers in the server cluster, thereby changing the master server and improving the control flexibility of the cluster servers; and the master server state and the slave server state of the server are automatically changed through the acquisition state of the server unit for the identity authentication information, so that the control of the server cluster can be realized more conveniently and simply.
In some embodiments, the method further comprises:
and if the slave server does not send the second heartbeat message or does not receive the first heartbeat message under the preset third condition, the state of the slave server is adjusted to the first state.
The method can control the slave server to monitor the acquisition state of the first heartbeat message and the acquisition state of the second heartbeat message under a preset third condition, and when the fact that the second heartbeat message is not sent or the first heartbeat message is not received is detected under the preset third condition, the corresponding slave server is judged to have left the server cluster network. In order to reduce the management load of the server cluster, the method can adjust the working state of the corresponding slave server to the first state, so as to avoid the slave server which does not send the second heartbeat message or does not receive the first heartbeat message from occupying redundant resources.
In some embodiments, referring to fig. 5, the method further comprises:
s810, acquiring first cascade information of a main server;
s820, generating second cascade information of the target main server according to the first cascade information;
s830, synchronizing the second cascade information to the target main server.
The method can control the main server to acquire first cascade information, wherein the first cascade information comprises server unit information of a slave server which is in communication connection with the main server, so that a target main server is controlled to generate second cascade information according to the first cascade information; the target primary server may further synchronize the second cascade information to the target primary server, thereby acquiring server unit information of the secondary server included in the first cascade information in the primary server. By the method, the target main server can effectively synchronize the connection state and the subordinate relation between the main server and the subordinate server in the server cluster before the main server is changed, so that the stability of control logic of the cluster server when the main server is changed is improved, and the effectiveness of a management method of the main server and the subordinate server of the server cluster is ensured.
In some embodiments, referring to fig. 6, step S400 includes:
s410, obtaining third cascade information of server units in a server set to be processed;
s420, obtaining a cascade number set according to third cascade information;
s430, obtaining the maximum cascade number according to the cascade number set;
s440, obtaining a master server and a slave server according to the maximum cascade number.
The method can acquire the third cascade information of the server units in the server set to be processed, and acquire the cascade number set according to the third cascade information. According to the number of the cascade in the cascade number set, the method can obtain the maximum cascade number and the server unit corresponding to the maximum cascade number, and takes part of the server units as a master server and the rest of the server units in the server set to be processed as slave servers according to a preset judging rule. According to the method, all server units in the server set to be processed can be divided into the master server and the slave server, and the master-slave management of the server cluster is realized according to the management logic of the master server and the slave server, wherein the realization process depends on the preset judgment rule of the method, the management difficulty of the server cluster can be effectively reduced, and the management efficiency of the master-slave management method of the server cluster is improved.
In some embodiments, referring to fig. 7, step S440 includes:
s444, according to the maximum number of cascade, executing one of the following steps:
s442, if the maximum cascade number corresponds to one server unit, the server unit corresponding to the maximum cascade number is taken as a main server;
s443, the control main server generates first cascade information according to the second heartbeat message;
or,
s444, if the maximum cascade number corresponds to at least two server units, acquiring the MAC address of the server unit corresponding to the maximum cascade number;
s445, obtaining the master server and the slave server according to the MAC address.
The method can divide the server units according to the maximum cascade number, specifically, if the maximum cascade number corresponds to one server unit, the server unit corresponding to the maximum cascade number is used as a main server, and the main server is controlled to generate first cascade information according to the second heartbeat message. And if the maximum cascade number corresponds to at least two server units, acquiring the MAC address of the server unit corresponding to the maximum cascade number, and acquiring a master server and a slave server according to the MAC address. Through steps S441 to S445, the method provides a determination rule for adjusting the working states of all server units in the server cluster to be processed, that is, when the maximum number of cascades corresponds to only one server unit, the working states of the server units corresponding to the maximum number of cascades are adjusted to the master server state, the server units adjusted to the master server state are used as master servers, and the rest of server units in the server cluster to be processed are used as slave servers. When the maximum cascade number corresponds to at least two server units, judging according to MAC addresses of a plurality of server units corresponding to the maximum cascade number, and obtaining a master server and a slave server according to a judging result. Specifically, the method can obtain the MAC addresses of a plurality of server units corresponding to the maximum number of cascade connections, judge the value corresponding to the MAC address to obtain the minimum value of the MAC address, adjust the working state of the server unit corresponding to the minimum value of the MAC to the state of the master server, take the server unit adjusted to the state of the master server as the master server, and take the rest of server units in the server set to be processed as the slave servers. According to the method, the server units in the server cluster can be automatically divided into the master server and the slave servers by executing the steps S441 to S445, so that the server units in the server cluster can be efficiently managed according to the master-slave relationship of the servers, and the management difficulty of each server unit in the server cluster can be reduced.
In a second aspect, the present invention provides a server cluster master-slave management system, including:
cluster software for executing the server cluster master-slave management method according to the embodiment of the first aspect of the present invention;
the server unit is used for acquiring and sending the identity authentication information, the first heartbeat message and the second heartbeat message; also uses the storage and updating of the first cascade information, the second cascade information, the third cascade information and the MAC address
The server cluster master-slave management system provided by the invention can realize the server cluster master-slave management method according to the embodiment of the first aspect of the invention through cluster software, so as to obtain all server units in the server cluster, and communicate with all server units, thereby adjusting the working states of all server units to a first state and controlling the server units to obtain identity authentication information; by reading the acquisition state of each server unit for the identity authentication information, selecting and executing one of the following steps: if the server unit acquires the identity authentication information, the working state of the server unit corresponding to the acquired identity authentication information is adjusted to a slave server state, and the corresponding server unit is used as a slave server; or if the server unit does not acquire the identity authentication information under the preset first condition, the corresponding server unit is brought into the server set to be processed, and host election is carried out on all the server units in the server set to be processed; the server cluster master-slave machine management system provided by the invention can acquire and send the identity authentication information, the first heartbeat message and the second heartbeat message through the server unit; the first cascade information, the second cascade information, the third cascade information and the MAC address are stored and updated to realize the server cluster master-slave management method according to the embodiment of the first aspect of the invention. The server cluster master-slave machine management system provided by the invention can effectively manage the server units through cluster software, so that the configuration of the server units is realized, the difficulty of cluster management is reduced, and meanwhile, the division of master-slave servers of all the server units in the cluster servers is realized, so that the management of the cluster servers is realized.
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of one of ordinary skill in the art without departing from the spirit of the present invention. Furthermore, embodiments of the invention and features of the embodiments may be combined with each other without conflict.

Claims (6)

1. The server cluster master-slave management method is characterized by comprising the following steps:
acquiring all server units in a server cluster, and adjusting the server units to a first state; wherein the first state is an isolated state;
acquiring identity authentication information; according to the acquisition state of the identity authentication information, executing one of the following steps:
if the server unit acquires the identity authentication information, the server unit is used as a slave server;
or,
if the server unit does not acquire the identity authentication information under a preset first condition, the server unit is brought into a to-be-processed server set, and host selection is performed on the server unit in the to-be-processed server set to obtain a master server and a slave server;
controlling the master server to output a first heartbeat message to the slave server;
controlling the main server to receive the second heartbeat message output by the slave server;
controlling the main server to generate first cascade information according to the second heartbeat message;
controlling the main server to acquire a third heartbeat message under a preset second condition;
updating the first cascade information according to the second heartbeat message and the third heartbeat message;
if the server unit does not acquire the identity authentication information under a preset first condition, the server unit is brought into a to-be-processed server set, and host election is performed on the server unit in the to-be-processed server set to obtain a master server and a slave server, including:
acquiring third cascade information of server units in the server set to be processed;
obtaining a cascade number set according to the third cascade information;
obtaining the maximum cascade number according to the cascade number set;
and obtaining a master server and a slave server according to the maximum cascade number.
2. The server cluster master-slave management method according to claim 1, further comprising:
if the main server acquires the identity authentication information at least three times, controlling all server units to perform host election to obtain host election data;
obtaining a target server unit according to the host election data;
and taking the target server unit as a target master server and taking the master server as a slave server.
3. The server cluster master-slave management method according to claim 2, further comprising:
and if the slave server does not send the second heartbeat message or does not receive the first heartbeat message under a preset third condition, adjusting the state of the slave server to the first state.
4. A server cluster master-slave management method according to claim 3, further comprising:
acquiring first cascade information of the main server;
generating second cascade information of the target main server according to the first cascade information;
and synchronizing the second cascade information to the target main server.
5. The method for managing the master-slave machines of the server cluster according to claim 1, wherein obtaining the master server and the slave server according to the maximum number of cascades comprises:
according to the maximum cascade number, executing one of the following steps:
if the maximum cascade number corresponds to one server unit, the server unit corresponding to the maximum cascade number is used as a main server;
taking the rest server units in the server set to be processed as slave servers;
or,
if the maximum cascade number corresponds to at least two server units, acquiring the MAC address of the server unit corresponding to the maximum cascade number;
and obtaining the master server and the slave server according to the MAC address.
6. The server cluster master-slave management system is characterized by comprising:
cluster software for executing the server cluster master-slave management method according to any one of claims 1 to 5;
the server unit is used for acquiring and sending the identity authentication information, the first heartbeat message and the second heartbeat message; the first concatenation information, the second concatenation information, the third concatenation information, and the MAC address are also stored and updated.
CN202111275662.6A 2021-10-29 2021-10-29 Master-slave management method and system for server cluster Active CN114039976B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111275662.6A CN114039976B (en) 2021-10-29 2021-10-29 Master-slave management method and system for server cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111275662.6A CN114039976B (en) 2021-10-29 2021-10-29 Master-slave management method and system for server cluster

Publications (2)

Publication Number Publication Date
CN114039976A CN114039976A (en) 2022-02-11
CN114039976B true CN114039976B (en) 2024-01-09

Family

ID=80142587

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111275662.6A Active CN114039976B (en) 2021-10-29 2021-10-29 Master-slave management method and system for server cluster

Country Status (1)

Country Link
CN (1) CN114039976B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106789197A (en) * 2016-12-07 2017-05-31 高新兴科技集团股份有限公司 A kind of cluster election method and system
CN108134706A (en) * 2018-01-02 2018-06-08 中国工商银行股份有限公司 Block chain high-availability system mostly living, computer equipment and method
CN109218349A (en) * 2017-06-29 2019-01-15 北京微影时代科技有限公司 A kind of method and device of management server cluster
CN110865907A (en) * 2018-08-27 2020-03-06 Ovh公司 Method and system for providing service redundancy between master server and slave server
CN112202812A (en) * 2020-10-27 2021-01-08 中国联合网络通信集团有限公司 Water conservancy Internet of things terminal access authentication method and system based on block chain
CN112422320A (en) * 2020-10-27 2021-02-26 北京金山云网络技术有限公司 Master-slave switching method and device of server and server
CN112653734A (en) * 2020-12-11 2021-04-13 邦彦技术股份有限公司 Server cluster real-time master-slave control and data synchronization system and method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1423958A2 (en) * 2001-05-15 2004-06-02 Veridis Method and device for transmitting an electronic message

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106789197A (en) * 2016-12-07 2017-05-31 高新兴科技集团股份有限公司 A kind of cluster election method and system
CN109218349A (en) * 2017-06-29 2019-01-15 北京微影时代科技有限公司 A kind of method and device of management server cluster
CN108134706A (en) * 2018-01-02 2018-06-08 中国工商银行股份有限公司 Block chain high-availability system mostly living, computer equipment and method
CN110865907A (en) * 2018-08-27 2020-03-06 Ovh公司 Method and system for providing service redundancy between master server and slave server
CN112202812A (en) * 2020-10-27 2021-01-08 中国联合网络通信集团有限公司 Water conservancy Internet of things terminal access authentication method and system based on block chain
CN112422320A (en) * 2020-10-27 2021-02-26 北京金山云网络技术有限公司 Master-slave switching method and device of server and server
CN112653734A (en) * 2020-12-11 2021-04-13 邦彦技术股份有限公司 Server cluster real-time master-slave control and data synchronization system and method

Also Published As

Publication number Publication date
CN114039976A (en) 2022-02-11

Similar Documents

Publication Publication Date Title
US11307943B2 (en) Disaster recovery deployment method, apparatus, and system
EP3490224B1 (en) Data synchronization method and system
CN104079657B (en) Configurable clustered deploy(ment) device and method based on template
JP5153782B2 (en) Simplified automatic configuration and service discovery within ad hoc networks
US20170048123A1 (en) System for controlling switch devices, and device and method for controlling system configuration
CN110933137B (en) Data synchronization method, system, equipment and readable storage medium
CN109391038B (en) Deployment method of intelligent substation interval measurement and control function
EP2688333B1 (en) Parallel monitoring method and system for communication base station power sources
CN115086330B (en) Cross-cluster load balancing system
CN112437129B (en) Cluster management method and cluster management device
CN114070822A (en) Kubernetes Overlay IP address management method
CN104202204A (en) Clock synchronous control method, device and system based on SNTP
CN111131445B (en) DHCP cluster scheduling method and DHCP cluster system
EP1587251A2 (en) Home network system with multi-network manager and method for controlling the same
CN114039976B (en) Master-slave management method and system for server cluster
CN114338267B (en) Maintenance method, device, equipment, bus network and medium for multiple management nodes
JP2006260059A (en) Server device
CN100508468C (en) Self-adapting exchange method for dynamic management data of distributed node
CN111918382A (en) Wireless synchronous group control method and device
CN112865995A (en) Distributed master-slave system
CN103916280B (en) A kind of blade server management network active DHCP distribution method
CN101877714A (en) Integrated server
CN111464346B (en) Main and standby control board synchronization method and system based on ATCA (advanced telecom computing architecture)
CN115268951A (en) Installation method, device, equipment and storage medium of operating system
CN115396437B (en) Cluster building method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant