CN114143330A - Configuration method, device and system of time server - Google Patents
Configuration method, device and system of time server Download PDFInfo
- Publication number
- CN114143330A CN114143330A CN202111444513.8A CN202111444513A CN114143330A CN 114143330 A CN114143330 A CN 114143330A CN 202111444513 A CN202111444513 A CN 202111444513A CN 114143330 A CN114143330 A CN 114143330A
- Authority
- CN
- China
- Prior art keywords
- time
- time server
- server
- main
- service equipment
- 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.)
- Withdrawn
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- 238000004891 communication Methods 0.000 claims description 40
- 230000004913 activation Effects 0.000 claims description 18
- 230000008859 change Effects 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 8
- 238000012544 monitoring process Methods 0.000 claims description 4
- 238000012163 sequencing technique Methods 0.000 claims description 4
- 230000002159 abnormal effect Effects 0.000 abstract description 4
- 230000004044 response Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
- H04J3/0635—Clock or time synchronisation in a network
- H04J3/0638—Clock or time synchronisation among nodes; Internode synchronisation
- H04J3/0658—Clock or time synchronisation among packet nodes
- H04J3/0661—Clock or time synchronisation among packet nodes using timestamps
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/2866—Architectures; Arrangements
- H04L67/30—Profiles
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Hardware Redundancy (AREA)
Abstract
The application discloses a configuration method, a device and a system of a time server. The method comprises the following steps: determining a main time server and a standby time server in the time server cluster; sending a time synchronization request to time service equipment, wherein the time synchronization request is used for acquiring target time from the time service equipment; receiving target time fed back by the time service equipment based on the time synchronization request; and synchronizing the target time to the main time server and each standby time server, wherein the main time server is used for providing services for the service terminal according to the target time. The method provided by the application effectively ensures the time synchronization of the master time server and the slave time server in the server cluster. And when the main time server is abnormal, the standby time server is switched to provide service for the service equipment, so that the time consistency can be ensured.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, an apparatus, and a system for configuring a time server.
Background
Because the time of the server nodes in the cluster storage system is inconsistent, which affects the security, communication, data I/O and other performances of the cluster storage system, in order to ensure the system security and availability of the cluster storage system, the time consistency between the server nodes in the system needs to be strictly maintained. However, in the conventional cluster storage system, in order to ensure the security and confidentiality of the system, the server node is prohibited from connecting to the external network, which results in a problem that no external time source is used as a synchronization object of the cluster server node.
In a data center, a large number of business systems need to be kept time-to-time consistent in order to achieve data consistency. In the existing data center, all service devices synchronize external network time sources, and a great network safety hidden danger exists. Or a time source server in the data center synchronizes an external time source, other service systems synchronize the time source, and a single-section fault of the time source exists.
Disclosure of Invention
In order to solve the technical problem or at least partially solve the technical problem, the application provides a configuration method, device and system of a time server.
According to an aspect of the embodiments of the present application, there is provided a method for configuring a time server, which is applied to a time server cluster, where the time server cluster includes at least two time servers, and the method includes:
determining a main time server and a standby time server in the time server cluster;
sending a time synchronization request to time service equipment, wherein the time synchronization request is used for acquiring target time from the time service equipment;
receiving target time fed back by the time service equipment based on the time synchronization request;
and synchronizing the target time to the main time server and each standby time server.
Further, the determining a master time server and a backup time server in the time server cluster includes:
starting an activation component in each time server;
analyzing the configuration file received by the time server based on the activation component to obtain a weight value carried in the configuration file, wherein the weight value is used for representing the importance degree of the time server;
and determining the time server with the highest weight value as a main time server, and determining the time servers in the time server cluster except the main time server as standby time servers.
Further, the method further comprises:
under the condition that the configuration file does not carry a weight value, determining the service pressure of each time server;
sequencing each time server according to the service pressure;
and taking the time server with the minimum service pressure as a main time server, and taking the time servers in the time server cluster except the main time server as standby time servers.
Further, after determining the timeserver with the highest weight value as a primary timeserver and determining timeservers other than the primary timeserver in the timeserver cluster as standby timeservers, the method further includes:
monitoring a communication message received by the main time server based on an activation component in the main time server, and analyzing the communication message to obtain change information carried in the communication message;
and under the condition that the change information is used for indicating that the main time server needs to be updated and configured, selecting a standby time server meeting preset conditions from the standby time servers to replace the main time server.
Further, after transmitting the target time to the master time server, so that the master time server synchronizes the target time to each standby time server, the method further includes:
receiving a time acquisition request sent by service equipment;
responding to the time acquisition request, and detecting the state information of the main time server;
and under the condition that the state information is used for indicating that the main time server is available, the main time server performs time synchronization operation on the service equipment according to the time acquisition request.
Further, the method further comprises:
in the event that the status information indicates that the master time server is unavailable, shutting down an active component in the master time server to cause the master time server to suspend execution time synchronization operations;
and selecting the standby time server meeting preset conditions from the standby time servers to replace the main time server to perform time synchronization operation.
According to another aspect of the embodiments of the present application, there is also provided a time server configuration apparatus, including:
the determining module is used for determining a main time server and a standby time server in the time server cluster;
the system comprises a sending module, a receiving module and a sending module, wherein the sending module is used for sending a time synchronization request to time service equipment, and the time synchronization request is used for acquiring target time from the time service equipment;
the receiving module is used for receiving target time fed back by the time service equipment based on the time synchronization request;
and the control module is used for synchronizing the target time to the main time server and each standby time server.
According to another aspect of the embodiments of the present application, there is also provided a configuration system of a time server, including: the time service system comprises time service equipment, a time server cluster and service equipment, wherein the time server cluster comprises a plurality of time servers;
the time server cluster is used for sending a time synchronization request to time service equipment, wherein the time synchronization request is used for acquiring target time from the time service equipment, receiving the target time fed back by the time service equipment based on the time synchronization request, determining a main time server and standby time servers in the time server cluster, and transmitting the target time to the main time server so that the main time server synchronizes the target time to each standby time server;
the service equipment is used for sending a time acquisition request to the time server cluster;
the time server cluster is used for responding to the time acquisition request and detecting the state information of the main time server; and under the condition that the state information is used for indicating that the main time server is available, the main time server performs time synchronization operation on the service equipment according to the time acquisition request.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program that executes the above steps when the program is executed.
According to another aspect of the embodiments of the present application, there is also provided an electronic apparatus, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus; wherein: a memory for storing a computer program; a processor for executing the steps of the method by running the program stored in the memory.
Embodiments of the present application also provide a computer program product containing instructions, which when run on a computer, cause the computer to perform the steps of the above method.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: the method provided by the embodiment of the application effectively ensures the time synchronization of the master time server and the slave time server in the server cluster. And when the main time server is abnormal, the standby time server is switched to provide service for the service equipment, so that the time consistency can be ensured.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
Fig. 1 is a flowchart of a configuration method of a time server according to an embodiment of the present application;
fig. 2 is a flowchart of a method for configuring a time server according to another embodiment of the present application;
fig. 3 is a flowchart of a method for configuring a timeserver according to another embodiment of the present application;
fig. 4 is a block diagram of a configuration apparatus of a time server according to an embodiment of the present application;
fig. 5 is a block diagram of a configuration system of a time server according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments, and the illustrative embodiments and descriptions thereof of the present application are used for explaining the present application and do not constitute a limitation to the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another similar entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The embodiment of the application provides a configuration method, a device and a system of a time server. The method provided by the embodiment of the invention can be applied to any required electronic equipment, for example, the electronic equipment can be electronic equipment such as a server and a terminal, and the method is not particularly limited herein, and is hereinafter simply referred to as electronic equipment for convenience in description.
According to an aspect of embodiments of the present application, a method embodiment of a configuration method of a timeserver is provided. Fig. 1 is a flowchart of a configuration method of a time server according to an embodiment of the present application, and as shown in fig. 1, the method includes:
step S11, determine the master time server and the backup time server in the time server cluster.
In the embodiment of the application, after the time server cluster is deployed, the activation components on each time server in the time server cluster are started, and the main time server and the standby time server in the time server cluster are determined based on the activation components.
Specifically, the step S13 of determining the master time server and the standby time server in the time server cluster includes the following steps a 1-A3:
step A1, the activation component in each timeserver is started.
Step A2, analyzing the configuration file received by the time server based on the activation component to obtain a weight value carried in the configuration file, wherein the weight value is used for representing the importance degree of the time server;
in the embodiment of the application, a user presets a configuration file of each time server, the configuration file carries a weight value corresponding to the time server, the weight value is used for representing the importance degree of the time server, after the configuration file is set, the user can upload the configuration file to the time server, and at the moment, the activation component can analyze the configuration file to obtain the weight value.
Step A3, determining the time server with the highest weight value as the main time server, and determining the time servers in the time server cluster except the main time server as the standby time server.
In the embodiment of the application, the weight values of the time servers in the time server cluster are compared, the time server with the highest weight value is determined as the main time server, and the time server with the weight value lower than the highest weight value is determined as the standby time server.
And step S12, sending a time synchronization request to the time service equipment, wherein the time synchronization request is used for acquiring the target time from the time service equipment.
The method provided by the embodiment of the application is applied to a time server cluster, the time server cluster comprises at least two time servers, the time server cluster sends a time synchronization request to time service equipment deployed outside the cluster, and the time service equipment generates response information based on the time synchronization request after receiving the time synchronization request and feeds the response information carrying current time (namely target time) back to the time server cluster.
And step S13, receiving the target time fed back by the time service equipment based on the time synchronization request.
In the embodiment of the application, after receiving the response information fed back by the time service equipment, the time server cluster analyzes the response information to obtain the target time carried by the response information.
Step S14, synchronize the target time to the master time server and each backup time server.
In the present embodiment, after the time server cluster receives the target time, the target time is synchronized to the master time server and each backup time server. Therefore, the method provided by the application effectively ensures the time synchronization of the master time server and the slave time server in the server cluster. And when the main time server is abnormal, the standby time server is switched to provide service for the service equipment, so that the time consistency can be ensured.
In this embodiment of the present application, after determining the time server with the highest weight value as the primary time server and determining the time servers in the time server cluster except the primary time server as the standby time server, the method further includes:
step B1, monitoring the communication message received by the main time server based on the active component in the main time server, and analyzing the communication message to obtain the change information carried in the communication message;
and step B2, selecting the standby time server meeting the preset conditions from the standby time servers to replace the main time server when the change information is used for indicating that the main time server needs to be updated and configured.
In the embodiment of the application, after the main time server and the standby time server are determined, a communication message received by the main time server can be monitored based on an activation component in the main time server, the communication message can be sent by a user through a client, and when the user needs to change the main time server according to business requirements or needs to maintain the main time server, the communication message is sent to the main time server, wherein the communication message carries change information. And then analyzing the communication message based on an activation component in the main time server to obtain change information carried in the communication message, and then selecting a standby time server meeting preset conditions from the standby time servers according to the change information to replace the main time server.
In the embodiment of the application, the communication message is sent to the main time server through the client, so that the switching between the main time server and the standby time server can be realized when business requirements or server maintenance face.
Fig. 2 is a flowchart of a method for configuring a time server according to another embodiment of the present application, where as shown in fig. 2, the method further includes:
step S21, in the case that the configuration file does not carry a weight value, determining the service pressure of each timeserver.
Step S22, the respective timeservers are sorted according to service pressure.
In step S23, the timeserver with the smallest service pressure is used as the primary timeserver, and timeservers in the timeserver cluster other than the primary timeserver are used as backup timeservers.
In the embodiment of the application, under the condition that the configuration file does not carry the weight value, the service pressure of each time server in the time server cluster is determined. And then sequencing the time servers according to the sequence from high service pressure to low service pressure, taking the time server with the minimum service pressure as a main time server, and taking the time servers except the main time server in the time server cluster as standby time servers.
In the embodiment of the application, when the activation component deployed in the time server is the weight value analyzed from the configuration file, the time servers are sorted according to the service pressure, so that the time server with the minimum service pressure is determined as the main time server, and the service performance of the main time server is guaranteed to be the highest.
In this embodiment of the present application, after transmitting the target time to the master time server, so that the master time server synchronizes the target time to each of the standby time servers, the method further includes:
step S31, receiving a time acquisition request sent by the service device.
Step S32, in response to the time acquisition request, detects status information of the master time server.
In this embodiment of the present application, the service device may send a time acquisition request to the time server cluster, and after receiving the time acquisition request, the activation component deployed in the master time server may determine whether the master time server is available.
In step S33, when the status information indicates that the master time server is available, the master time server performs a time synchronization operation on the service device according to the time acquisition request.
In an embodiment of the present application, the method further comprises:
step C1, in case the status information is used to indicate that the master time server is unavailable, shutting down the active component in the master time server to make the master time server suspend the execution time synchronization operation;
and step C2, selecting the standby time server meeting the preset conditions from the standby time servers, and replacing the main time server to perform time synchronization operation.
According to the method provided by the embodiment of the application, after the time acquisition request sent by the service equipment is received, whether the main time server is available or not is judged by judging the state information of the main time server, and the time synchronization operation is executed to the service equipment under the condition that the main time server is available. The effectiveness of the main time server in executing the time synchronization operation is effectively ensured.
Fig. 4 is a block diagram of a configuration apparatus of a time server according to an embodiment of the present application, where the configuration apparatus may be implemented as part of or all of an electronic device through software, hardware, or a combination of the two. As shown in fig. 4, the apparatus includes:
a sending module 41, configured to send a time synchronization request to a time service device, where the time synchronization request is used to obtain a target time from the time service device;
the receiving module 42 is configured to receive target time fed back by the time service device based on the time synchronization request;
a determining module 43, configured to determine a master time server and a standby time server in a time server cluster;
and the control module 44 is configured to transmit the target time to the master time server, so that the master time server synchronizes the target time to each standby time server.
In the embodiment of the present application, the determining module 43 is configured to start an activation component in each timeserver; analyzing the configuration text received by the time server based on the activation component to obtain a weight value carried in the configuration file, wherein the weight value is used for representing the importance degree of the time server; and determining the time server with the highest weight value as a main time server, and determining the time servers except the main time server in the time server cluster as standby time servers.
In this embodiment of the present application, the configuration apparatus of the time server further includes: the processing module is used for determining the service pressure of each time server under the condition that the configuration file does not carry the weight value; sequencing each time server according to the service pressure; and taking the time server with the minimum service pressure as a main time server, and taking the time servers in the time server cluster except the main time server as standby time servers.
In this embodiment of the present application, the configuration apparatus of the time server further includes: the change module is used for monitoring the communication message received by the master time server; analyzing the communication message based on an activation component in the main time server to obtain change information carried in the communication message; and under the condition that the change information is used for indicating that the main time server needs to be updated and configured, selecting the standby time server meeting the preset conditions from the standby time servers to replace the main time server.
In this embodiment of the present application, the configuration apparatus of the time server further includes: the execution module is used for receiving a time acquisition request sent by the service equipment; detecting state information of a main time server in response to a time acquisition request; and under the condition that the state information is used for indicating that the main time server is available, the main time server performs time synchronization operation on the service equipment according to the time acquisition request.
In this embodiment of the application, the execution module is further configured to, in a case that the state information indicates that the master time server is unavailable, close an active component in the master time server, so that the master time server suspends the execution time synchronization operation; and selecting the standby time server meeting preset conditions from the standby time servers to replace the main time server to perform time synchronization operation.
Fig. 5 is a block diagram of a configuration system of a time server according to an embodiment of the present application, where the apparatus may be implemented as part of or all of an electronic device through software, hardware, or a combination of the two. As shown in fig. 5, the system includes: the system comprises time service equipment 51, a time server cluster 52 and service equipment 53, wherein the time server cluster 52 comprises a plurality of time servers;
the time server cluster 52 is used for sending a time synchronization request to the time service device 51, wherein the time synchronization request is used for acquiring target time from the time service device, receiving the target time fed back by the time service device based on the time synchronization request, determining a main time server and standby time servers in the time server cluster, and transmitting the target time to the main time server so that the main time server synchronizes the target time to each standby time server;
the service device 53 is configured to send a time acquisition request to the time server cluster;
a time server cluster 52 for detecting status information of the master time server in response to the time acquisition request; in the case where the status information is used to indicate that the master time server is available, the master time server performs a time synchronization operation to the service device 53 according to the time acquisition request.
The embodiment of the application effectively ensures the time synchronization of the master time server and the slave time server in the server cluster. And when the main time server is abnormal, the standby time server is switched to provide service for the service equipment, so that the time consistency can be ensured.
An embodiment of the present application further provides an electronic device, as shown in fig. 6, the electronic device may include: the system comprises a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, wherein the processor 1501, the communication interface 1502 and the memory 1503 complete communication with each other through the communication bus 1504.
A memory 1503 for storing a computer program;
the processor 1501 is configured to implement the steps of the above embodiments when executing the computer program stored in the memory 1503.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment provided by the present application, a computer-readable storage medium is further provided, which stores instructions that, when executed on a computer, cause the computer to perform the method for configuring a timeserver as described in any of the above embodiments.
In a further embodiment provided by the present application, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of configuring a timeserver as described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk), among others.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.
The above description is merely exemplary of the present application and is presented to enable those skilled in the art to understand and practice the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
1. A configuration method of a time server is applied to a time server cluster, wherein the time server cluster comprises at least two time servers, and the method comprises the following steps:
determining a main time server and a standby time server in the time server cluster;
sending a time synchronization request to time service equipment, wherein the time synchronization request is used for acquiring target time from the time service equipment;
receiving target time fed back by the time service equipment based on the time synchronization request;
and synchronizing the target time to the main time server and each standby time server, wherein the main time server is used for providing services for service equipment according to the target time.
2. The method of claim 1, wherein determining a primary time server and a backup time server in the cluster of time servers comprises:
starting an activation component in each time server;
analyzing the configuration file received by the time server based on the activation component to obtain a weight value carried in the configuration file, wherein the weight value is used for representing the importance degree of the time server;
and determining the time server with the highest weight value as a main time server, and determining the time servers in the time server cluster except the main time server as standby time servers.
3. The method of claim 2, further comprising:
under the condition that the configuration file does not carry a weight value, determining the service pressure of each time server;
sequencing each time server according to the service pressure;
and taking the time server with the minimum service pressure as a main time server, and taking the time servers in the time server cluster except the main time server as standby time servers.
4. The method of claim 2, wherein after determining the timeserver with the highest weight value as a primary timeserver and determining timeservers other than the primary timeserver in the cluster of timeservers as standby timeservers, the method further comprises:
monitoring a communication message received by the main time server based on an activation component in the main time server, and analyzing the communication message to obtain change information carried in the communication message;
and under the condition that the change information is used for indicating that the main time server needs to be updated and configured, selecting a standby time server meeting preset conditions from the standby time servers to replace the main time server.
5. The method of claim 1, wherein after transmitting the target time to the master time server to cause the master time server to synchronize the target time to each of the standby time servers, the method further comprises:
receiving a time acquisition request sent by service equipment;
responding to the time acquisition request, and detecting the state information of the main time server;
and under the condition that the state information is used for indicating that the main time server is available, the main time server performs time synchronization operation on the service equipment according to the time acquisition request.
6. The method of claim 3, further comprising:
in the event that the status information indicates that the master time server is unavailable, shutting down an active component in the master time server to cause the master time server to suspend execution time synchronization operations;
and selecting the standby time server meeting preset conditions from the standby time servers to replace the main time server to perform time synchronization operation.
7. An apparatus for configuring a time server, comprising:
the determining module is used for determining a main time server and a standby time server in the time server cluster;
the system comprises a sending module, a receiving module and a sending module, wherein the sending module is used for sending a time synchronization request to time service equipment, and the time synchronization request is used for acquiring target time from the time service equipment;
the receiving module is used for receiving target time fed back by the time service equipment based on the time synchronization request;
and the control module is used for synchronizing the target time to the main time server and each standby time server.
8. A configuration system for a time server, comprising: the time service system comprises time service equipment, a time server cluster and service equipment, wherein the time server cluster comprises a plurality of time servers;
the time server cluster is used for determining a main time server and a standby time server in the time server cluster, and sending a time synchronization request to time service equipment, wherein the time synchronization request is used for acquiring target time from the time service equipment, receiving the target time fed back by the time service equipment based on the time synchronization request, and transmitting the target time to the main time server so that the main time server synchronizes the target time to each standby time server;
the service equipment is used for sending a time acquisition request to the time server cluster;
the time server cluster is used for responding to the time acquisition request and detecting the state information of the main time server; and under the condition that the state information is used for indicating that the main time server is available, the main time server performs time synchronization operation on the service equipment according to the time acquisition request.
9. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program is operative to perform the method steps of any of the preceding claims 1 to 6.
10. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus; wherein:
a memory for storing a computer program;
a processor for performing the method steps of any of claims 1-6 by executing a program stored on a memory.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111444513.8A CN114143330A (en) | 2021-11-30 | 2021-11-30 | Configuration method, device and system of time server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111444513.8A CN114143330A (en) | 2021-11-30 | 2021-11-30 | Configuration method, device and system of time server |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114143330A true CN114143330A (en) | 2022-03-04 |
Family
ID=80390053
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111444513.8A Withdrawn CN114143330A (en) | 2021-11-30 | 2021-11-30 | Configuration method, device and system of time server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114143330A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116032949A (en) * | 2023-03-29 | 2023-04-28 | 成都数之联科技股份有限公司 | Time synchronization method, apparatus, electronic device, and computer-readable storage medium |
-
2021
- 2021-11-30 CN CN202111444513.8A patent/CN114143330A/en not_active Withdrawn
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116032949A (en) * | 2023-03-29 | 2023-04-28 | 成都数之联科技股份有限公司 | Time synchronization method, apparatus, electronic device, and computer-readable storage medium |
CN116032949B (en) * | 2023-03-29 | 2023-06-16 | 成都数之联科技股份有限公司 | Time synchronization method, apparatus, electronic device, and computer-readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107465767B (en) | Data synchronization method and system | |
CN107295080B (en) | Data storage method applied to distributed server cluster and server | |
CN108696581B (en) | Distributed information caching method and device, computer equipment and storage medium | |
CA2896865C (en) | Method and system for using a recursive event listener on a node in hierarchical data structure | |
CN110830283B (en) | Fault detection method, device, equipment and system | |
WO2014166265A1 (en) | Method, terminal, cache server and system for updating webpage data | |
US9596313B2 (en) | Method, terminal, cache server and system for updating webpage data | |
CN110120961B (en) | Distributed service cluster and route synchronization method thereof | |
CN107315825A (en) | A kind of index upgrade system, method and device | |
CN112333249B (en) | Business service system and method | |
CN105959078B (en) | A kind of cluster method for synchronizing time, cluster and clock synchronization system | |
CN110417586B (en) | Service monitoring method, service node, server and computer readable storage medium | |
CN111181765A (en) | Task processing method and device | |
CN108874531B (en) | Method, device and system for fusing service and electronic equipment | |
CN113364852A (en) | File transmission method and device and server | |
CN114143330A (en) | Configuration method, device and system of time server | |
CN116302716A (en) | Cluster deployment method and device, electronic equipment and computer readable medium | |
CN112860505A (en) | Method and device for regulating and controlling distributed clusters | |
CN112437146B (en) | Equipment state synchronization method, device and system | |
CN115629909A (en) | Service data processing method and device, electronic equipment and storage medium | |
CN114443438A (en) | Node state detection method, node abnormity processing method and device | |
CN114816866A (en) | Fault processing method and device, electronic equipment and storage medium | |
CN114726711A (en) | Method and system for cooperative processing service between devices | |
CN114301763A (en) | Distributed cluster fault processing method and system, electronic device and storage medium | |
CN109753292B (en) | Method and device for deploying multiple applications in multiple single instance database 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 | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20220304 |