A management method and system for a network time protocol server
Through the object storage server, the task is decomposed into atomic transactions and written into the data model of the distributed application coordination server. The network time protocol server monitors and executes, which solves the problem of poor management of the network time protocol server in the existing technology and achieves high efficiency and reliability. Network Time Protocol server management.
Patent Information
- Application Number
- CN202010704029.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-21
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-07-21
AI Technical Summary
The existing technology lacks a solution for effective management of the network time protocol server, which makes it difficult to modify the configuration information when the network time protocol server fails and cannot effectively respond to emergencies.
Receive management tasks through the object storage server, decompose the tasks into atomic transactions, and write them into the data model maintained by the distributed application coordination server. The network time protocol server listens to the data model. When an atomic transaction is listened to, it reads the data from the data model. Read and execute it to realize the management of network time protocol services.
Coordinating server communication methods through distributed applications ensures the management consistency and reliability of network protocol services, realizes efficient management of network time protocol servers, avoids the complexity and errors of manual operations, and lowers the management threshold.
Smart Images

Figure CN111884747B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to network time protocol technology, and in particular to a management method, system, server and computer-readable storage medium of a network time protocol server. Background Art
[0002] The Network Time Protocol (NTP) service provided by the Network Time Protocol (NTP) server mainly solves the time error caused by the accuracy deviation of the computer equipment itself. In computer equipment in many fields such as rail transportation, finance, and communication billing, the clock data provided by the computer equipment itself is far from meeting the requirements. The reason for the time error is that the clock signal of the computer equipment comes from its own oscillator. The oscillation frequency of the crystal oscillator is not only related to its shape, material, cutting direction and other factors, but also to temperature changes, voltage, chip aging and other factors. It is difficult to ensure that the oscillation frequency is consistent with the standard frequency.
[0003] See also Figure 1 , Figure 1 It is a schematic diagram of the principle of the network structure of the network time protocol server in the related art. Each layer can provide time calibration services to external computer devices, also known as network protocol time services. Among them, layer (Stratum) 1 is the top layer, which obtains the reference time signal from Stratum0 (i.e., the external access standard time source) for time calibration, and the secondary NTP server in Stratum2 obtains the reference time signal from the primary NTP server in Stratum1 for time calibration, and the primary NTP server in Stratum3 obtains the reference time signal from the secondary NTP server in Stratum2 for time calibration; and so on.
[0004] It can be seen that the network time protocol server adopts a layer-by-layer synchronization method for time synchronization. As the number of network layers increases, the accuracy of the synchronized time decreases layer by layer.
[0005] The prior art lacks an effective solution for managing a network time protocol server. Summary of the invention
[0006] The embodiments of the present application provide a method, system, server and computer device readable storage medium for managing a network time protocol server, which can effectively manage the network time protocol server.
[0007] The technical solution of the embodiment of the present application is implemented as follows:
[0008] The present application provides a method for managing a network time protocol server, including:
[0009] The object storage server receives a task for managing a network time protocol server;
[0010] The object storage server decomposes the task into atomic transactions, and writes the atomic transactions into a distributed data model maintained by a distributed application coordination server;
[0011] The network time protocol server monitors the data model, and when it monitors that the atomic transaction is written, reads the atomic transaction from the data model maintained by the distributed application coordination server, and
[0012] The atomic transaction is performed on a Network Time Protocol service executed by the Network Time Protocol server.
[0013] The present application embodiment provides a management system for a network time protocol server, including:
[0014] Object storage server for:
[0015] Receives tasks for managing a Network Time Protocol server;
[0016] Decomposing the task into atomic transactions, and writing the atomic transactions into a distributed data model maintained by a distributed application coordination server;
[0017] The distributed application coordination server is used to:
[0018] Maintaining the distributed data model;
[0019] The network time protocol server is used to:
[0020] monitoring the data model, and when the atomic transaction is detected to be written, reading the atomic transaction from the data model maintained by the distributed application coordination server, and
[0021] The atomic transaction is performed on a Network Time Protocol service executed by the Network Time Protocol server.
[0022] In the above solution, the object storage server is also used for:
[0023] When the task is used to batch modify the configuration information of the network time protocol services running on multiple network time protocol servers and restart the network time protocol services, the following processing is performed:
[0024] Decomposing the task into atomic transactions that are executed in parallel by the plurality of network time protocol servers and are used to modify configuration information of the network time protocol service; and
[0025] According to the dependency relationship between the multiple network time protocol servers, decomposing the task into atomic transactions that are sequentially executed by the multiple network time protocol servers and are used to restart the network time protocol service;
[0026] When the task is used to modify the configuration information of a network time protocol service run by any of the network time protocol servers and restart the network time protocol service, the task is decomposed into an atomic transaction executed by the network time protocol server and used to modify the configuration information of the network time protocol service, and an atomic transaction used to restart the network time protocol service;
[0027] When the task is used to batch obtain configuration information of a network time protocol service run by multiple network time protocol servers, decomposing the task into atomic transactions executed in parallel by the multiple network time protocol servers and used to obtain the configuration information of the network time protocol service;
[0028] When the task is used to obtain configuration information of a network time protocol service run by any network time protocol server, decomposing the task into atomic transactions executed by the network time protocol server and used to obtain configuration information of the network time protocol service;
[0029] When the task is used to batch modify the available areas of the Network Time Protocol services run by multiple Network Time Protocol servers, the task is decomposed into atomic transactions executed by the multiple Network Time Protocol servers and used to modify the available areas of the Network Time Protocol services run by the Network Time Protocol servers.
[0030] In the above solution, the distributed application coordination server is a server cluster, including the following types of servers: a leader server, at least one follower server and at least one observer server; wherein the leader server is further used to:
[0031] receiving a write request for the atomic transaction;
[0032] Broadcasting the atomic transaction in the server cluster according to the write request, so that the follower server and the observer server write the atomic transaction into a log;
[0033] When the follower server and the observer server report that the log is written successfully, the atomic transaction is written into the data model maintained by itself, and the commit message of the atomic transaction is broadcast to notify the follower server and the observer server to write the atomic transaction into the data model maintained by each of them.
[0034] In the above scheme, the data model includes a directory node corresponding to each of the network protocol time servers, and the directory node includes the following sub-directory nodes: a configuration information sub-directory node, a configuration modification task status sub-directory node, a restart instruction sub-directory node, a restart service task status sub-directory node, and a configuration acquisition task status sub-directory node;
[0035] When the task is used to modify the configuration information of the network time protocol service, the atomic transaction includes the configuration information and the configuration modification task state, and the leader server is further used to:
[0036] Writing the configuration information into the configuration information sub-directory node, and modifying the configuration modification task status sub-directory node to in progress;
[0037] When the task is used to restart the network time protocol service, the atomic transaction includes a restart instruction and a restart service task state, and the leader server is further used to:
[0038] Writing the restart instruction into the restart instruction sub-directory node, and modifying the restart service task status sub-directory node to in progress;
[0039] When the task is used to obtain configuration information of the network time protocol service, the atomic transaction includes the configuration information and the configuration acquisition task status, and the leader server is further used to:
[0040] The configuration acquisition task status sub-directory node is modified to in progress, and the configuration information returned by the network time protocol server is written into the configuration information sub-directory node.
[0041] In the above solution, the network time protocol server is further used for:
[0042] The directory node to be monitored is registered in the distributed application coordination server, and when an update notification of the directory node registered for monitoring in the distributed application coordination server is received, the atomic transaction is read from the directory node registered for monitoring.
[0043] In the above solution, the multiple network time protocol servers are also used for:
[0044] executing the atomic transactions in parallel to modify configuration information of network time protocol services running in a plurality of network time protocol servers;
[0045] When all the configuration information of the network time protocol service is modified successfully, restarting the respective running network time protocol services in sequence;
[0046] The sequence is generated according to the dependency relationship between the multiple network time protocol servers.
[0047] In the above scheme, the data model includes a directory node corresponding to each of the network protocol time servers, and the directory node includes the following sub-directory nodes: a business monitoring data sub-directory node and a business monitoring status sub-directory node;
[0048] The object storage server is also used for:
[0049] The business monitoring status subdirectory node of the data model is modified to in progress, so that
[0050] The network time protocol server writes the real-time business monitoring data corresponding to the running network protocol time service in the business monitoring data subdirectory node of the data model, and modifies the business monitoring status subdirectory node to success, so that the distributed application coordination server sends an update notification to the object storage server;
[0051] When the object storage server receives the update notification, it obtains the real-time business monitoring data from the business monitoring data sub-directory node of the data model and sends it to the client for display in a visual view.
[0052] In the above solution, the object storage server is also used for:
[0053] Storing the operation record of the task in a database;
[0054] The operation record includes: the user ID of the task issuing and the time of issuing the task;
[0055] In response to a query instruction of the client based on the operation record sent by the task, the operation record of the task is sent to the client.
[0056] In the above scheme, the data model includes a directory node corresponding to each of the network protocol time servers, and the directory node includes a client time sub-directory node;
[0057] When the configuration information of the network time protocol service running on the network time protocol server becomes invalid, the object storage server is used to:
[0058] Writing the client time received from the client into the client time subdirectory node of the data model so that the distributed application coordination server sends an update notification to the network time protocol server;
[0059] When the network time protocol server receives an update notification of the client time directory node, reading the client time from the client time sub-directory node;
[0060] When the difference between the local time of the network time protocol server and the client time exceeds a time difference threshold, an alarm is sent.
[0061] The present application provides a management device for a network time protocol server, including:
[0062] Object storage service module, used for:
[0063] Receives tasks for managing a Network Time Protocol server;
[0064] Decomposing the task into atomic transactions, and writing the atomic transactions into a distributed data model maintained by a distributed application coordination server;
[0065] Network Time Protocol service module for:
[0066] Maintaining the distributed data model;
[0067] Distributed application coordination service module for:
[0068] monitoring the data model, and when the atomic transaction is detected to be written, reading the atomic transaction from the data model maintained by the distributed application coordination server, and
[0069] The atomic transaction is performed on a Network Time Protocol service executed by the Network Time Protocol server.
[0070] An embodiment of the present application provides a computer-readable storage medium storing executable instructions for implementing a method for managing a network time protocol server provided in an embodiment of the present application when executed by a processor.
[0071] The embodiments of the present application have the following beneficial effects:
[0072] The distributed application coordination server is used as the intermediary for the object storage server to manage the network time protocol server. The consistency and reliability of the management of the network protocol service are guaranteed by splitting the atomic transactions of the task. The monitoring mechanism of the data structure ensures that the atomic transactions can reach the network protocol time server in time for efficient management. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 It is a schematic diagram of the principle of the network structure of the network time protocol server in the related art;
[0074] Figure 2AIt is a schematic diagram of the architecture of the management system of the network time protocol server provided in the embodiment of the present application;
[0075] Figure 2B It is a schematic diagram of the architecture of the management system of the network time protocol server provided in the embodiment of the present application;
[0076] Figure 3 is a schematic diagram of the structure of the server 900 provided in an embodiment of the present application;
[0077] Figure 4 It is a schematic diagram of the system architecture for the distributed application coordination server 400 and the NTP server to interact with each other provided in the embodiment of the present application;
[0078] Figure 5 It is a data model diagram of the distributed application coordination server 400 provided in an embodiment of the present application;
[0079] Fig. 6A It is an optional flow chart of the management method of the network time protocol server provided in the embodiment of the present application;
[0080] Figure 6B It is an optional flow chart of the management method of the network time protocol server provided in the embodiment of the present application;
[0081] Figure 6C It is a flow chart of a method for managing a network time protocol server provided in an embodiment of the present application;
[0082] Figure 7 It is a schematic diagram of task decomposition of an object storage server provided in an embodiment of the present application;
[0083] Figure 8 It is a schematic diagram of the execution process of the atomic transaction provided in the embodiment of the present application. DETAILED DESCRIPTION
[0084] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0085] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0086] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0087] The relevant data collection and processing in the embodiments of this application should be strictly in accordance with the requirements of relevant laws and regulations when applied in examples, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of authorization of laws and regulations and the personal information subject.
[0088] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0089] 1) Distributed application coordination services, such as Zookeeper: It is an open source implementation of Chubby, a distributed lock service within Google. It is a software that provides consistency services for distributed applications, and provides functions including configuration maintenance, distributed synchronization, etc.
[0090] 2) Network Time Protocol (NTP) is a protocol used to synchronize the time of computer devices. It can enable computer devices to synchronize time with NTP servers, or NTP servers to synchronize time with the upper-level NTP service or clock source. It can provide high-precision time correction (the difference with the standard on a local area network (LAN) is less than 1 millisecond, and on a wide area network (WAN) it is tens of milliseconds), and can prevent malicious protocol attacks by means of encryption confirmation.
[0091] 3) NTP server, which runs NTP service to calibrate local time based on the time signal of the superior source, thereby providing accurate time signal to the computer equipment served, such as adding accurate timestamp in the log of the computer equipment.
[0092] 4) Monitoring platform, such as Argus: It is a monitoring and alarm visualization platform unique to the cloud platform. The platform will manage the reported monitoring data and provide visual data charts.
[0093] 5) Object Storage Service (OSS): OSS is a service that runs in the form of cloud services and interacts with the front-end (for operation and maintenance managers) and distributed application coordination services. OSS sends tasks (modify configuration and restart / report configuration information / report real-time business monitoring data) to the agent service of the NTP server through the distributed application coordination service for execution, and obtains the configuration information and real-time business monitoring data of the NTP service running in the NTP server from the Agent.
[0094] 6) Agent service, deployed in each NTP server, executes the tasks of OSS through distributed application coordination services (in the form of atomic transactions), obtains real-time business monitoring data of NTP services running in the NTP server and stores it in the distributed application coordination service.
[0095] 7) Data model is a data structure used by the distributed application coordination service to store data, including multiple levels of directory nodes, such as: client time directory node and ntp_agent directory node (ntp_agent here is only used for naming); the ntp_agent directory node includes directory nodes corresponding to multiple NTP servers, and each NTP server's directory node may include multiple sub-directory nodes for storing tasks for managing the NTP server (including issuing instructions, modifying status, modifying configuration, and obtaining real-time business monitoring data).
[0096] 8) Atomic transaction is a program execution logic unit consisting of a series of operations such as configuring data in the server, ensuring that each transaction is either executed successfully or failed, with no intermediate state.
[0097] Next, an exemplary application of the method for managing a network time protocol server provided by an embodiment of the present application in a server cluster will be described. Figure 2A , Figure 2A 1 is a schematic diagram of the architecture of the management system of the network time protocol server provided in the embodiment of the present application. It includes: object storage server 200, network time protocol server ( Figure 2A Only the network time protocol server 300 - 1 , the network time protocol server 300 - 2 and the network time protocol server 300 - 3 ), the distributed application coordination server 400 and the client 500 are shown.
[0098] The above-mentioned server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms, but the embodiments of the present application are not limited here.
[0099] Taking the task of managing the network time protocol server issued by the operation and maintenance personnel on the client as an example, the operation and maintenance personnel issue the task of managing the network time protocol server (such as the network time protocol server 300-1, the network time protocol server 300-2 and the network time protocol server 300-3) on the client 500 (for example, modifying the configuration information of the network time protocol service running on the network time protocol server (such as the network time protocol server 300-1, the network time protocol server 300-2 and the network time protocol server 300-3), restarting the network time protocol service running on the network time protocol server (such as the network time protocol server 300-1, the network time protocol server 300-2 and the network time protocol server 300-3) and obtaining the business data of the network time protocol server (such as the network time protocol server 300-1, the network time protocol server 300-2 and the network time protocol server 300-3) in real time, etc.), the object storage server 200 receives the task issued by the client, and distributes the task to the object storage server 200. The distributed application coordination server 400 establishes communication between the object storage server 200 and the network time protocol server (e.g., the network time protocol server 300-1, the network time protocol server 300-2, and the network time protocol server 300-3), that is, the object storage server 200 decomposes the received task into atomic transactions and writes them into the distributed data model maintained by the distributed application coordination server 400. When the proxy service of each network time protocol server (e.g., the network time protocol server 300-1, the network time protocol server 300-2, and the network time protocol server 300-3) monitors that the data model is written with the atomic transaction, it reads the atomic transaction from the data model maintained by the corresponding distributed application coordination server 400, and executes the atomic transaction on the network time protocol service running by the corresponding network time protocol server (e.g., the network time protocol server 300-1, the network time protocol server 300-2, and the network time protocol server 300-3).
[0100] See also Figure 2B ,based on Figure 2A The application scenario of the network time protocol server management method provided in the embodiment of the present application may also include a monitoring platform and a data model. Figure 2B1 is a schematic diagram of the architecture of the management system of the network time protocol server provided in the embodiment of the present application. It includes: object storage server 200, network time protocol server ( Figure 2B Only the network time protocol server 300-1, the network time protocol server 300-2 and the network time protocol server 300-3 are shown in the figure), the distributed application coordination server 400, the client 500, the monitoring platform 700 and the database 800. The following is a description.
[0101] Taking the task of managing the network time protocol server issued by the operation and maintenance personnel on the client as an example, the operation and maintenance personnel issue the task of managing the network time protocol server (such as the network time protocol server 300-1, the network time protocol server 300-2 and the network time protocol server 300-3) on the client 500 (for example, modifying the configuration information of the network time protocol service running by the network time protocol server (such as the network time protocol server 300-1, the network time protocol server 300-2 and the network time protocol server 300-3), restarting the network time protocol server (such as the network time protocol server 300-1, the network time protocol server 300-2 and the network time protocol server 300-3) 2 and the network time protocol server 300-3) running the network time protocol service and real-time acquisition of network time protocol server (such as network time protocol server 300-1, network time protocol server 300-2 and network time protocol server 300-3) business data, etc.), the object storage server 200 receives the task issued by the client 500, and establishes communication between the object storage server 200 and the network time protocol server (such as network time protocol server 300-1, network time protocol server 300-2 and network time protocol server 300-3) through the distributed application coordination server 400, that is, the object storage server After decomposing the received task into atomic transactions, 200 writes the atomic transactions into the distributed data model maintained by the distributed application coordination server 400, and stores the operation records related to the task in the database 800; when the network time protocol server (for example, the network time protocol server 300-1, the network time protocol server 300-2 and the network time protocol server 300-3) monitors that the data model is written with the atomic transaction, it reads the atomic transaction from the data model maintained by the corresponding distributed application coordination server 400, and sends the atomic transaction to the network time protocol server (for example, the network time protocol server 300-1, the network time protocol server 300-2 and the network time protocol server 300-3). The network time protocol service running on the network time protocol server 300-2 and the network time protocol server 300-3) executes the atomic transaction; the network time protocol server (for example, the network time protocol server 300-1, the network time protocol server 300-2 and the network time protocol server 300-3) regularly reports the monitoring data of the network protocol time server (for example, the network time protocol server 300-1, the network time protocol server 300-2 and the network time protocol server 300-3) to the monitoring platform 700, and presents it in the form of a visual view on the monitoring platform 700; when the monitoring data is abnormal, the alarm information is sent to the client 500 for reference by the operation and maintenance personnel.
[0102] In some embodiments, the distributed application coordination server 400 may be a server cluster, each server being a node in the cluster. Figure 4 , Figure 4 This is a schematic diagram of the system architecture of the distributed application coordination server 400 and the NTP server interacting with each other provided in the embodiment of the present application. It includes the distributed application coordination server 400 and the NTP server (exemplarily showing the NTP server 300-1, the NTP server 300-2 and the NTP server 300-3); the distributed application coordination server 400 includes: a leader server 410, a follower server 420 and an observer server 430; two programs are running in the NTP server: an agent service Agent and an NTP service. They are described below.
[0103] The leader server 410 is used to respond to the write request of the object storage server 200, and jointly with the follower server 420 and the observer server 430 write the atomic transaction issued by the object storage server into the data model maintained by each of them, so as to ensure the consistency of the data; initiate and maintain the heartbeat between the follower server 420 and the observer server 430.
[0104] The follower server 420 is used to respond to the heartbeat of the leader server 410, directly process and return the read request of the network time protocol server 300, and forward the write request of the object storage server 200 to the leader server 410 for processing. A server cluster can have multiple follower servers 420 at the same time.
[0105] The observer server 430 has similar functions to the follower server 420, but has no voting rights.
[0106] It should be noted that the leader server 410 is generated through election (i.e., there is full or partial consensus on which node is the leader server 410. For example, if a node is agreed to be the leader server 410 by more than half of the nodes, it means that it is successfully elected as the leader server 410). There will only be one actual working leader server in the server cluster at the same time.
[0107] Among them, in the election stage (Leader Election), when the server cluster is initialized, the servers in it all play the role of election nodes. As long as one node obtains more than half of the votes of the servers, it can be elected as the leader server; the basis for the election can be any information that can be used for comparison, such as some attribute parameters of the server itself, including: IP address, number of CPU cores, memory size, custom serial number; it can also be elected based on various election algorithms, such as the atomic broadcast protocol (ZAB, ZooKeeper Atomic Broadcast), distributed consensus algorithm (Paxos), etc.
[0108] In some embodiments, the leader server 410 receives the atomic transaction sent by the object storage server 200, broadcasts the proposal corresponding to the atomic transaction, and the follower server 420 and the observer server 430 write the transaction into the log; when more than half (or all, a preset number / ratio) of the follower servers 420 and the observer server 430 feedback that the atomic transaction is successfully written into the log of the corresponding server, the leader server 410 writes the atomic transaction into the data model maintained by itself, and broadcasts a commit message to notify the follower server 420 and the observer server 430 to commit the atomic transaction, so as to write the atomic transaction into the data model maintained by the follower server 420 and the observer server 430. Among them, the object storage server 200 can send a write request to any server in the server cluster nearby. If the server receiving the write request is not the leader server 410, the write request will be forwarded to the leader server 410 for processing.
[0109] based on Figure 2B , see Figure 5 , Figure 5 It is a schematic diagram of the data model of the distributed application coordination server 400 provided in an embodiment of the present application. Figure 5 The sub-directory nodes of an NTP server IP (i.e., 10.10.0.3) are shown as an example, where each box represents a directory node (ZNode), which is the smallest unit for storing data. Data can be stored on each directory node, and sub-directory nodes can be hung under it, thus forming a hierarchical namespace, which is called a tree-like data structure, which is the data model of the distributed application coordination server 400.
[0110] Among them, 1) the directory nodes / ntp_oss and ntp_oss / ntp_agent are only used for naming and no data is stored thereon.
[0111] 2) The directory node / ntp_oss / client_time is used to store the client time; the client time sent by the front end to the object storage server, the object storage server transmits it to each network time protocol server through the distributed application coordination server directory node ( / ntp_oss / client_time).
[0112] 3) Below the directory node / ntp_oss / ntp_agent / [NTP server IP] is various information corresponding to each network time protocol server, including the available zone available_zone, configuration modification task status config, etc.
[0113] 4) The directory node / ntp_oss / ntp_agent / [NTP server IP] / command is used to store the restart command. The values 0, 1, and 2 of the directory node / ntp_oss / ntp_agent / [NTP server IP] / command / service_state respectively represent the failure, success, and ongoing status of the restart task of the corresponding Network Time Protocol service. The object storage server writes the restart command to the directory node / ntp_oss / ntp_agent / [NTP server IP] / command, and then changes the restart service state sub-directory node service_state to 2. The corresponding Network Time Protocol server agent service will obtain the restart command from the restart command sub-directory node command to execute it, and then write the execution result back to service_state.
[0114] 5) The directory node / ntp_oss / ntp_agent / [NTP server IP] / config / upstream is used to store configuration information; the values 0, 1, and 2 of the directory node / ntp_oss / ntp_agent / [NTP server IP] / config respectively represent the status of the corresponding NTP server configuration modification task failure, success, and in progress; the object storage server writes the configuration information that needs to be modified on the front end to the configuration information sub-directory node upstream, and then changes the value of config to 2. The proxy service of the corresponding NTP server will obtain the configuration information from upstream and perform verification (the verification content includes whether it is a legal IP and whether NTP service is provided, etc.). After the verification is successful, the configuration information will be synchronized to the local configuration of the NTP server.
[0115] 6) The directory node / ntp_oss / ntp_agent / [NTP server IP] / config / message is used to store error information when a task fails to execute; the error information when a configuration modification task fails to execute will be written to the error information sub-directory node message for the object storage server to obtain.
[0116] 7) Directory node / ntp_oss / ntp_agent / [NTP server IP] / config / sync is used by the object storage server to trigger the agent service of the network time protocol server to synchronize the local configuration of the network time protocol server to the corresponding directory node of the object storage server to ensure configuration consistency.
[0117] For example, when the object storage server calls the interface, a synchronization request is triggered and the value of the synchronization instruction sub-directory node sync is modified to 2, indicating that synchronization is required; then when the proxy service of the network time protocol server listens to sync as 2, the local configuration information of the network time protocol server is written to the upstream and sync is modified to 1.
[0118] It is worth noting that the operation and maintenance personnel can set up that when the object storage server sends the configuration, the proxy service of the network time protocol server is triggered to synchronize the local configuration of the network time protocol server to the corresponding upstream.
[0119] 8) Directory node / ntp_oss / ntp_agent / [NTP server IP] / alive is used to store the latest modification time. The proxy service of the network time protocol server writes once every two seconds to prove its survival. The object storage server can know the survival status of the network time protocol server by checking the latest modification time of the corresponding heartbeat subdirectory node alive.
[0120] 9) The directory node / ntp_oss / ntp_agent / [NTP server IP] / monitor_data / data is used to store the business monitoring data of the Network Time Protocol service in the Network Time Protocol server; the values 0, 1, and 2 of the directory node ntp_oss / ntp_agent / [NTP server IP] / monitor_data respectively represent the status of failure, success, and ongoing in obtaining the business monitoring data of the Network Time Protocol service in the corresponding Network Time Protocol server; the agent service of the Network Time Protocol server will write the business monitoring data to / ntp_oss / ntp_agent / [NTP server IP] / monitor_data / data in real time.
[0121] The data model of the distributed application coordination server 400 may include multiple levels of directory nodes, which are used to store and manage the tasks of the network time protocol server 300, just like the file system, and the directory nodes may be added or deleted through the object storage server. The embodiment of the present application is only given as an example. Figure 5 The data model shown, Figure 5 The data model may have many variations, which are not limited in the embodiments of the present application.
[0122] Next, the structure of the server provided in the embodiment of the present application is described. The server here can be any server described above, such as an object storage server, a distributed application coordination server, and a network protocol time server.
[0123] See also Figure 3 , Figure 3 is a schematic diagram of the structure of the server 900 provided in an embodiment of the present application, Figure 3 The server 900 shown includes: at least one processor 910, a memory 930 and at least one network interface 920. The various components in the server 900 are coupled together via a bus system 940. It is understood that the bus system 940 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 940 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 940 is not described in detail. Figure 3 Various buses are labeled as bus system 940 .
[0124] Processor 910 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0125] The memory 930 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 930 may optionally include one or more storage devices that are physically remote from the processor 910.
[0126] The memory 930 includes a volatile memory or a nonvolatile memory, and may also include both volatile and nonvolatile memories. The nonvolatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 930 described in the embodiments of the present application is intended to include any suitable type of memory.
[0127] In some embodiments, the memory 930 can store data to support various operations, examples of which include programs, modules, and data models, or subsets or supersets thereof, as exemplarily described below.
[0128] Operating system 931, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0129] A network communication module 932, used to reach other computer devices via one or more (wired or wireless) network interfaces 920, exemplary network interfaces 920 include: Bluetooth, Wireless Fidelity (Wi Fi), and Universal Serial Bus (USB), etc.;
[0130] The management device 933 of the network time protocol server includes the following program modules for implementing the management method of the network time protocol server provided in the embodiment of the present application:
[0131] The object storage service module 9331 may be executed in the object storage server, and is used to receive a task for managing a network time protocol server; decompose the task into atomic transactions, and write the atomic transactions into a distributed data model maintained by the distributed application coordination server;
[0132] A network time protocol service module 9332 may be executed in a network time protocol server to maintain a distributed data model;
[0133] The distributed application coordination service module 9333 can be run in the distributed application coordination server to monitor the data model. When it monitors that an atomic transaction is written, it reads the atomic transaction from the data model maintained by the distributed application coordination server and executes the atomic transaction on the network time protocol service running on the network time protocol server.
[0134] In some embodiments, the server 900 may be Figure 2A The processor 910 executes the corresponding module in the management program 933 of the network time protocol server according to the type of server that the server 900 needs to implement, so as to execute the function of the corresponding type of server.
[0135] Next, the management method of the network time protocol server provided in the embodiment of the present application will be described in combination with the structure of the management system provided in the embodiment of the present application, and the exemplary application and implementation of the above-mentioned server. For the sake of simplicity, the server described below omits the server described in the embodiment of the present application. Figure 2A , 2B , but can still be combined with Figure 2A , 2B understand.
[0136] See also Fig. 6A , Fig. 6A This is an optional flow chart of the management method of the network time protocol server provided in the embodiment of the present application, which will be combined with Fig. 6AThe steps shown are explained.
[0137] In step 101, an object storage server receives a task for managing a network time protocol server.
[0138] In some embodiments, the object storage server runs the object storage service in the form of a cloud service, and the user accesses the interface of the client of the object storage server at the front end (e.g., various forms of clients) to submit a task for managing the network time protocol server to implement the task of managing the network time protocol server. The task received by the object storage server here is issued by the operation and maintenance personnel at the client; the management of the network time protocol server can be batch management of multiple network time protocol servers, or only a certain network time protocol server can be managed.
[0139] Through the management method of the embodiment of the present application, it is possible to manage the network time protocol server on the client interface at any time, eliminating the need for repetitive and complex manual operations for each machine; the management method is changed from complex program modifications to simple front-end visualization settings, which lowers the management threshold and can avoid problems caused by manual operations.
[0140] In step 102, the object storage server decomposes the task into atomic transactions.
[0141] In some embodiments, the object storage server decomposes the task into atomic transactions, including the following cases:
[0142] Case 1):
[0143] When a task is used to batch modify the configuration information of a network time protocol service run by multiple network time protocol servers and restart the network time protocol service, the following processing is performed: decomposing the task into atomic transactions that are executed in parallel by multiple network time protocol servers and are used to modify the configuration information of the network time protocol service; and decomposing the task into atomic transactions that are executed sequentially by multiple network time protocol servers and are used to restart the network time protocol service based on the dependency relationship between the multiple network time protocol servers.
[0144] As an example, when the task issued by the operation and maintenance personnel is to change the upper source IP addresses of 10.10.0.1, 10.10.0.2, and 10.10.0.3 to 1.1.1.1, 1.1.1.2, and 1.1.1.3 respectively and restart the corresponding Network Time Protocol services, the object storage server decomposes the task into six atomic transactions, namely, Task 1: Change the upper source IP address of 10.10.0.1 to 1.1.1.1, Task 2: Change the upper source IP address of 10.10.0.2 to 1.1.1.2, Task 3: Change the upper source IP address of 10.10.0.3 to 1.1.1.3, Task 4: Restart the NTP service of 10.10.0.1, Task 5: Restart the NTP service of 10.10.0.2, and Task 6: Restart the NTP service of 10.10.0.3.
[0145] It should be noted that the restart task is executed only after all configuration modification tasks are successfully executed, and before the execution of the corresponding NTP service restart, a random execution order for restarting the NTP server can be generated, and the execution order is the dependency of the NTP server. Therefore, since there is no dependency between the NTP servers of the configuration modification task, tasks one, two, and three can be executed in parallel; the restart service task executes tasks four, five, and six according to the generated execution order.
[0146] Case 2):
[0147] When a task is used to modify the configuration information of a Network Time Protocol service run by any Network Time Protocol server and restart the Network Time Protocol service, the task is decomposed into an atomic transaction executed by the Network Time Protocol server and used to modify the configuration information of the Network Time Protocol service, and an atomic transaction used to restart the Network Time Protocol service.
[0148] As an example, when the task issued by the operation and maintenance personnel is to change the upper source IP of 10.10.0.1 to 1.1.1.1 and restart the NTP service of 10.10.0.1, the object storage server decomposes the task into two atomic transactions, namely, Task 1: Change the upper source IP of 10.10.0.1 to 1.1.1.1, and Task 2: Restart the NTP service of 10.10.0.1.
[0149] Case 3):
[0150] When the task is used to batch obtain configuration information of network time protocol services run by multiple network time protocol servers, the task is decomposed into atomic transactions that are executed in parallel by the multiple network time protocol servers and are used to obtain the configuration information of the network time protocol services.
[0151] As an example, when the task issued by the operation and maintenance personnel is to obtain the upper-level source IP addresses of 10.10.0.1, 10.10.0.2, and 10.10.0.3, the task is decomposed into Task 1: obtaining the upper-level source IP address of 10.10.0.1, Task 2: obtaining the upper-level source IP address of 10.10.0.2, and Task 3: obtaining the upper-level source IP address of 10.10.0.3.
[0152] Case 4):
[0153] When the task is used to obtain the configuration information of the Network Time Protocol service run by any Network Time Protocol server, the task is decomposed into atomic transactions executed by the Network Time Protocol server and used to obtain the configuration information of the Network Time Protocol service.
[0154] As an example, when the task issued by the operation and maintenance personnel is to obtain the upper-level source IP of 10.10.0.1, the task is decomposed into Task 1: Obtain the upper-level source IP of 10.10.0.1.
[0155] Case 5):
[0156] When the task is used to batch modify the available areas of the Network Time Protocol services run by multiple Network Time Protocol servers, the task is decomposed into atomic transactions executed by the multiple Network Time Protocol servers and used to modify the available areas of the Network Time Protocol services run by the Network Time Protocol servers.
[0157] As an example, see Figure 5 , where the available zone available_zone indicates the available zone to which 10.10.0.3 belongs. The selection of the available zone is related to the disaster recovery capability and the network latency. If the network time protocol servers are deployed in different available zones in the same region, the disaster recovery capability will be higher; if the network time protocol servers are deployed in the same available zone, the network latency between network time protocol services will be lower. The embodiment of the present application can configure the available zones and ensure that users are not affected by failures in a single location.
[0158] In step 103, the object storage server writes the atomic transaction into the distributed data model maintained by the distributed application coordination server.
[0159] In some embodiments, Figure 4 The distributed application coordination server 400 shown is a server cluster, including the following types of servers: a leader server, at least one follower server, and at least one observer server.
[0160] In some examples, based on Fig. 6A , see Figure 6B , Figure 6Bis an optional flow chart of a method for managing a network time protocol server provided in an embodiment of the present application. Figure 6B Step 103 shown in FIG. 103 can be implemented by steps 1031 to 1033, combining Figure 6B The steps shown are explained.
[0161] In step 1031, the object storage server sends a write request for the atomic transaction to the leader server.
[0162] In step 1032, the leader server broadcasts the atomic transaction in the server cluster according to the write request, so that the follower server and the observer server write the atomic transaction into the log.
[0163] In step 1033, when all or part of the follower servers and observer servers feedback that the log is written successfully, the leader server writes the atomic transaction into the data model maintained by itself, and broadcasts the commit message of the atomic transaction to notify the follower servers and observer servers to write the atomic transaction into the data models maintained by them respectively.
[0164] It should be noted that the object storage server can send the write request of the atomic transaction to any server in the server cluster nearby. If the server receiving the write request is not the leader server, the server receiving the write request will forward the write request of the atomic transaction to the leader server for processing.
[0165] The embodiment of the present application records the operation of each atomic transaction by writing the log successfully and then writing it into the data model. When the atomic transaction is successfully submitted, the data in the transaction will be persisted to the data model. On the one hand, if a transaction that executes part of the operation encounters a communication interruption, since the information is retained in the log, the corresponding re-execution of the log operation can be performed on the data that has not yet been persisted to restore the data; on the other hand, if the transaction that has been submitted encounters a server crash, the corresponding re-execution operation can also be performed on the data that has not yet been persisted according to the log by restarting the service to restore the data.
[0166] In some embodiments, the above data model includes a directory node corresponding to each network protocol time server, and the directory node includes the following sub-directory nodes: a configuration information sub-directory node, a configuration modification task status sub-directory node, a restart instruction sub-directory node, a restart service task status sub-directory node, and a configuration acquisition task status sub-directory node. The leader server writes the atomic transaction into the data model maintained by itself, including:
[0167] 1) When the task is used to modify the configuration information of the network time protocol service, the atomic transaction includes the configuration information and the configuration modification task status; the leader server writes the configuration information in the configuration information subdirectory node and modifies the configuration modification task status subdirectory node to in progress;
[0168] 2) When the task is used to restart the network time protocol service, the atomic transaction includes the restart instruction and the restart service task status; the leader server writes the restart instruction in the restart instruction subdirectory node and modifies the restart service task status subdirectory node to in progress;
[0169] 3) When the task is used to obtain the configuration information of the Network Time Protocol service, the atomic transaction includes the configuration information and the configuration acquisition task status; the leader server modifies the configuration acquisition task status sub-directory node to in progress, and when the Network Time Protocol server receives the update notification from the distributed application coordination server, the Network Time Protocol server returns the current configuration information of the Network Time Protocol server; and writes the configuration information returned by the Network Time Protocol server into the configuration information sub-directory node.
[0170] It should be noted that the writing method of follower servers and observer servers is consistent with that of the leader.
[0171] In step 104, the network time protocol server monitors the data model, and when it monitors that an atomic transaction is written, it reads the atomic transaction from the data model maintained by any distributed application coordination server.
[0172] In some embodiments, based on Fig. 6A , see Figure 6C , Figure 6C is a flow chart of a method for managing a network time protocol server provided in an embodiment of the present application. Figure 6C The illustrated step 104 can be implemented through steps 1041 to 1042 , which will be described in conjunction with each step.
[0173] In step 1041, the network time protocol server registers the directory node to be monitored in the distributed application coordination server.
[0174] In step 1042, when an update notification of a directory node that has registered for listening in the distributed application coordination server is received, an atomic transaction is read from the directory node that has registered for listening.
[0175] In the embodiment of the present application, a distributed application coordination server is used as an intermediary for an object storage server to manage a network time protocol server. Both the object storage server and the network time protocol server can monitor the directory nodes in the distributed application coordination server, and realize two-way linkage through the monitoring mechanism of the distributed application coordination server. The transaction division of labor based on the monitoring mechanism is clearer, and monitoring and execution are implemented separately, which has better maintainability.
[0176] In step 105, the NTP server performs an atomic transaction on the NTP service running on the NTP server. Fig. 6A , see Figure 6C , Figure 6C Step 105 shown, when the task is used to batch modify the configuration information of the Network Time Protocol services running in multiple Network Time Protocol servers and restart the Network Time Protocol services, can be implemented through steps 1051 to 1053, which will be explained in conjunction with each step.
[0177] In step 1051, multiple network time protocol servers execute atomic transactions in parallel to modify configuration information of the network time protocol services running in the multiple network time protocol servers.
[0178] In step 1052, when all the configuration information of the network time protocol service is modified successfully, the proxy service of the network time protocol server modifies the configuration modification task status subdirectory node in the data model to success.
[0179] In step 1053, the plurality of NTP servers restart their respective NTP services in sequence; wherein the sequence of restarting the NTP services is generated according to the dependency relationship between the plurality of NTP servers.
[0180] Here, after generating the order of restarting the Network Time Protocol service according to the dependency relationship between multiple Network Time Protocol servers, the Network Time Protocol services are restarted in sequence, which can ensure the security of the Network Time Protocol servers. For example, when a certain Network Time Protocol server fails to execute the restart service, since it is restarted in sequence, the subsequent restart tasks will be stopped, avoiding the spread of the fault and causing a large-scale failure of the Network Time Protocol server.
[0181] In some embodiments, after step 105, the following steps may also be performed:
[0182] In some examples, the above data model includes a directory node corresponding to each network protocol time server, and the directory node includes the following sub-directory nodes: a business monitoring data sub-directory node and a business monitoring status sub-directory node. The object storage server modifies the business monitoring status sub-directory node of the data model to in progress, so that the network time protocol server writes the real-time business monitoring data corresponding to the running network protocol time service in the business monitoring data sub-directory node of the data model, and modifies the business monitoring status sub-directory node to success, so that the distributed application coordination server sends an update notification to the object storage server; when the object storage server receives the update notification, it obtains the real-time business monitoring data from the business monitoring data sub-directory node of the data model and sends it to the client for display in a visual view.
[0183] In other examples, the network time protocol server periodically sends business monitoring data corresponding to the running network protocol time service to the monitoring platform, so that the monitoring platform can present it in a visual view and issue an alarm when the business monitoring data is abnormal.
[0184] In other examples, the object storage server stores the operation record of the task in a database; wherein the operation record includes: the user identifier of the task and the time when the task was issued; and sends the operation record of the task to the client in response to a query instruction of the operation record sent by the client based on the task.
[0185] It should be noted here that the object storage server generates operation records based on the tasks issued by the front end, and stores the association between the operation records and the tasks in the database. On the client interface, you can query the user ID and time information of the task that issued the task based on the task, or you can query the list of issued tasks based on the user ID.
[0186] In other examples, when there is no superior source or external network, the network protocol time server can obtain the front-end client time for reference to compare whether the network protocol time server deviates too much from the client time. If the deviation is too large, an alarm message can be sent to notify the operation and maintenance personnel or management personnel to conduct an investigation to avoid causing a malfunction.
[0187] The above data model includes a directory node corresponding to each network protocol time server, and the directory node includes a client time sub-directory node; when the configuration information of the network time protocol service run by the network time protocol server becomes invalid, the object storage server writes the client time received from the client into the client time sub-directory node of the data model, so that the distributed application coordination server sends an update notification to the network time protocol server; when the network time protocol server receives the update notification of the client time directory node, it reads the client time from the client time sub-directory node; when the difference between the local time of the network time protocol server and the client time exceeds the time difference threshold, an alarm is sent.
[0188] It is worth noting that the execution order of the above steps after step 105 is not limited to after step 105. For example, in other embodiments, the above steps may also be before step 105, and the embodiments of the present application do not limit this.
[0189] The following is an explanation of an exemplary application of an embodiment of the present application in a practical application scenario.
[0190] During the implementation of the embodiments of the present application, it was found that the related technology has the following problems: when a layer-by-layer synchronization method is used in the network time protocol to provide network time protocol services for computer devices, time synchronization is performed through the initialized configuration information. When a network time protocol server fails, the configuration information cannot be modified, and it is difficult to effectively respond to emergencies. Therefore, how to effectively manage the network time protocol server is the problem solved by the present application.
[0191] In response to the above problems, an embodiment of the present application proposes a management method for a network time protocol server. The management method for a network time protocol server provided by the embodiment of the present application can issue management tasks to the network time protocol server in batches to achieve effective management of the network time protocol server; by coordinating the communication mode of the server through a distributed application, the communication response speed is faster and more reliable.
[0192] The implementation scheme of the embodiment of the present application is as follows:
[0193] Users access the object storage server through the front end (such as various forms of clients), submit tasks on the client interface of the object storage server, and store them in the directory node of the distributed application coordination server for reading and execution by the proxy service of the network time protocol server to achieve effective management of the network time protocol server.
[0194] In some embodiments, when the type of task is a task of modifying configuration and restarting services, the object storage server will decompose the task into atomic transactions, and first write atomic transactions that modify the configuration information of multiple network time protocol servers in parallel (including writing configuration information and writing the status of configuration modification tasks) to ensure that the atomic transactions of concurrently modifying the configuration are successfully executed by the proxy service of the network time protocol server, and then write the atomic transactions of restarting the network time protocol services of multiple network time protocol servers in a rolling order into the directory node of the distributed application coordination server, so that the proxy services of each network time protocol server restart the network time protocol service in sequence.
[0195] As an example, see Figure 7 , Figure 7 This is a schematic diagram of the task decomposition of the object storage server provided in an embodiment of the present application. The front end submits to the object storage server a task to modify the configuration of 10.10.0.1 (the IP address of the network time protocol server), 10.10.0.2, and 10.10.0.3 (for example, the upper source of 10.10.0.1, 10.10.0.2, and 10.10.0.3 is modified to 1.1.1.1, 1.1.1.2, and 1.1.1.3, respectively) and restart the service. The task will be decomposed into six atomic transactions by the object storage server.
[0196] As an example, see Figure 8 , Figure 8 It is a schematic diagram of the execution process of the atomic transaction provided by the embodiment of the present application. Among them, the proxy service of the network time protocol server executes the atomic transactions of the network time protocol servers 10.10.0.1, 10.10.0.2 and 10.10.0.3 in parallel, and at the same time modifies the upper source IPs of 10.10.0.1, 10.10.0.2 and 10.10.0.3 to 1.1.1.1, 1.1.1.2 and 1.1.1.3; when the upper source IPs of the network time protocol servers 1.1.1.1, 1.1.1.2 and 1.1.1.3 are all modified successfully, the network time protocol servers 1.1.1.1, 1.1.1.2 and 1.1.1.3 start to roll and restart the network time protocol services running respectively; wherein, the order of rolling and restarting is generated according to the dependency relationship between the proxy services of the network time protocol servers.
[0197] Taking the collection and reporting of business monitoring data as an example, Figure 2BThe proxy service of the network time protocol server in the object storage server monitors the business monitoring data of the network time protocol service of the network time protocol server in real time, and stores the business monitoring data in the business monitoring data subdirectory node data in the data model maintained by the object storage server; and regularly reports the business monitoring data in the data to the monitoring platform to monitor whether the NTP service is normal. When the business monitoring data is abnormal (for example, the time offset value is greater than 1000), an alarm message is sent.
[0198] Among them, the business monitoring data includes indicators of the Network Time Protocol service provided by the Network Time Protocol server, wherein the indicators may include: time offset value (time offset between the NTP server and the superior source), time jitter value (jitter value of time synchronization between the NTP server and the superior source), whether the NTP process is alive, whether the NTP port is alive, etc.
[0199] The embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the management method of the network time protocol server described in the embodiment of the present application.
[0200] The embodiment of the present application provides a computer device readable storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will execute the management method of the network time protocol server provided by the embodiment of the present application, for example, Fig. 6A , 6B Or the management method of the network time protocol server shown in 6C.
[0201] In some embodiments, the computer device readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.
[0202] In some embodiments, executable instructions may be in the form of a computer program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0203] As an example, executable instructions may, but do not necessarily, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (for example, files storing one or more modules, subroutines, or code portions).
[0204] By way of example, executable instructions may be deployed to be executed on one computer device, or on multiple computer devices located at one site, or on multiple computer devices distributed across multiple sites and interconnected by a communication network.
[0205] In summary, through the embodiments of the present application, it is possible to manage the network time protocol server on the client interface at any time, eliminating the need for repeated and complex manual operations for each machine; the management method is changed from complex program modifications to simple settings with front-end visualization, which lowers the threshold for management and can avoid problems caused by manual operations; the available areas are configured to ensure that users are not affected by single location failures; the management system based on the monitoring mechanism has better maintainability; the NTP service is rolled back and forth according to the dependency relationship of the NTP server to ensure the security of the network time protocol server; when the NTP server has no upper source and external network, it can be referenced by obtaining the client time of the front end.
[0206] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A method for managing a network time protocol server, characterized in that: The method comprises: The object storage server receives a task for managing a network time protocol server; The object storage server decomposes the task into atomic transactions, and writes the atomic transactions into a distributed data model maintained by a distributed application coordination server, wherein the data model includes a directory node corresponding to each of the network protocol time servers; The network time protocol server registers the directory node that needs to be monitored in the distributed application coordination server. When receiving an update notification of the directory node that has been registered for monitoring in the distributed application coordination server, the atomic transaction is read from the directory node that has been registered for monitoring, and the atomic transaction is executed on the network time protocol service running on the network time protocol server.
2. The method according to claim 1, characterized in that: The object storage server decomposes the task into atomic transactions, including: When the task is used to batch modify the configuration information of the network time protocol services running on multiple network time protocol servers and restart the network time protocol services, the following processing is performed: Decomposing the task into atomic transactions that are executed in parallel by the plurality of network time protocol servers and are used to modify configuration information of the network time protocol service; and According to the dependency relationship between the multiple network time protocol servers, decomposing the task into atomic transactions that are sequentially executed by the multiple network time protocol servers and are used to restart the network time protocol service; When the task is used to modify the configuration information of a network time protocol service run by any of the network time protocol servers and restart the network time protocol service, the task is decomposed into an atomic transaction executed by the network time protocol server and used to modify the configuration information of the network time protocol service, and an atomic transaction used to restart the network time protocol service; When the task is used to batch obtain configuration information of a network time protocol service run by multiple network time protocol servers, decomposing the task into atomic transactions executed in parallel by the multiple network time protocol servers and used to obtain the configuration information of the network time protocol service; When the task is used to obtain configuration information of a network time protocol service run by any network time protocol server, decomposing the task into atomic transactions executed by the network time protocol server and used to obtain configuration information of the network time protocol service; When the task is used to batch modify the available areas of the Network Time Protocol services run by multiple Network Time Protocol servers, the task is decomposed into atomic transactions executed by the multiple Network Time Protocol servers and used to modify the available areas of the Network Time Protocol services run by the Network Time Protocol servers.
3. The method according to claim 1, characterized in that: The distributed application coordination server is a server cluster, including the following types of servers: a leader server, at least one follower server, and at least one observer server; Writing the atomic transaction into a distributed data model maintained by a distributed application coordination server includes: Sending a write request of the atomic transaction to the leader server; The leader server broadcasts the atomic transaction in the server cluster according to the write request, so that the follower server and the observer server write the atomic transaction into a log; When the follower server and the observer server report that the log is written successfully, the leader server writes the atomic transaction into the data model maintained by itself, and broadcasts the commit message of the atomic transaction to notify the follower server and the observer server to write the atomic transaction into the data models maintained by them respectively.
4. The method according to claim 3, characterized in that The data model includes a directory node corresponding to each of the network protocol time servers, and the directory node includes the following sub-directory nodes: a configuration information sub-directory node, a configuration modification task status sub-directory node, a restart instruction sub-directory node, a restart service task status sub-directory node, and a configuration acquisition task status sub-directory node; When the task is used to modify the configuration information of the network time protocol service, the atomic transaction includes the configuration information and the configuration modification task status, and the leader server writes the atomic transaction into the data model maintained by itself, including: The leader server writes the configuration information into the configuration information sub-directory node, and modifies the configuration modification task status sub-directory node to in progress; When the task is used to restart the network time protocol service, the atomic transaction includes a restart instruction and a restart service task state, and the leader server writes the atomic transaction into the data model maintained by itself, including: The leader server writes the restart instruction in the restart instruction sub-directory node, and modifies the restart service task status sub-directory node to in progress; When the task is used to obtain the configuration information of the network time protocol service, the atomic transaction includes the configuration information and the configuration acquisition task status, and the leader server writes the atomic transaction into the data model maintained by itself, including: The leader server modifies the configuration acquisition task status sub-directory node to in progress, and writes the configuration information returned by the network time protocol server into the configuration information sub-directory node.
5. The method according to claim 2, characterized in that: When the task is used to batch modify configuration information of network time protocol services running in multiple network time protocol servers and restart the network time protocol services, executing the atomic transaction on the network time protocol services running in the network time protocol servers includes: The multiple network time protocol servers execute the atomic transaction in parallel to modify configuration information of the network time protocol services running in the multiple network time protocol servers; When all the configuration information of the network time protocol service is successfully modified, the multiple network time protocol servers restart their respective running network time protocol services in sequence; The sequence is generated according to the dependency relationship between the multiple network time protocol servers.
6. The method according to claim 1, characterized in that The method further comprises: The directory node includes the following sub-directory nodes: a business monitoring data sub-directory node and a business monitoring status sub-directory node; The object storage server modifies the business monitoring status subdirectory node of the data model to in progress, so that The network time protocol server writes the real-time business monitoring data corresponding to the running network protocol time service in the business monitoring data subdirectory node of the data model, and modifies the business monitoring status subdirectory node to success, so that the distributed application coordination server sends an update notification to the object storage server; When the object storage server receives the update notification, it obtains the real-time business monitoring data from the business monitoring data sub-directory node of the data model and sends it to the client for display in a visual view.
7. The method according to claim 1, characterized in that The method further comprises: The object storage server stores the operation record of the task in a database; The operation record includes: the user ID of the task issuing and the time of issuing the task; In response to a query instruction of the client based on the operation record sent by the task, the operation record of the task is sent to the client.
8. The method according to claim 1, characterized in that: The method further comprises: The data model includes a directory node corresponding to each of the network protocol time servers, and the directory node includes a client time sub-directory node; When the configuration information of the network time protocol service run by the network time protocol server becomes invalid, the object storage server writes the client time received from the client into the client time subdirectory node of the data model, so that the distributed application coordination server sends an update notification to the network time protocol server; When the network time protocol server receives an update notification of the client time directory node, reading the client time from the client time sub-directory node; When the difference between the local time of the network time protocol server and the client time exceeds a time difference threshold, an alarm is sent.
9. A management system for a network time protocol server, characterized in that: include: Object storage server for: Receives tasks for managing a Network Time Protocol server; Decomposing the task into atomic transactions, and writing the atomic transactions into a distributed data model maintained by a distributed application coordination server, wherein the data model includes a directory node corresponding to each of the network protocol time servers; The distributed application coordination server is used to: Maintaining the distributed data model; The network time protocol server is used to: Register the directory node to be monitored in the distributed application coordination server, and when receiving an update notification of the directory node registered for monitoring in the distributed application coordination server, read the atomic transaction from the directory node registered for monitoring, and The atomic transaction is performed on a Network Time Protocol service executed by the Network Time Protocol server.
10. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that: When the computer executable instructions or computer programs are executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Unified management system and method of micro services
CN105959390A
Method and system for intelligent terminal to automatically obtain network time in multi-network mode
CN107231207A
