CN111884747A - Management method and system of network time protocol server - Google Patents

Management method and system of network time protocol server Download PDF

Info

Publication number
CN111884747A
CN111884747A CN202010704029.3A CN202010704029A CN111884747A CN 111884747 A CN111884747 A CN 111884747A CN 202010704029 A CN202010704029 A CN 202010704029A CN 111884747 A CN111884747 A CN 111884747A
Authority
CN
China
Prior art keywords
server
network time
time protocol
task
service
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.)
Pending
Application number
CN202010704029.3A
Other languages
Chinese (zh)
Inventor
张凯
刘焕新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Cloud Computing Beijing Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010704029.3A priority Critical patent/CN111884747A/en
Publication of CN111884747A publication Critical patent/CN111884747A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a management method, a system, a server and a computer readable storage medium of a network time protocol server; the method comprises the following steps: 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 program coordination server; and the network time protocol server monitors the data model, reads the atomic transaction from the data model maintained by the distributed application program coordination server when the atomic transaction is monitored to be written in, and executes the atomic transaction on the network time protocol service operated by the network time protocol server. By the method and the device, the network time protocol server can be stably and efficiently managed.

Description

Management method and system of network time protocol server
Technical Field
The present application relates to network time protocol technology, and in particular, to a method, a system, a server, and a computer readable storage medium for managing a network time protocol server.
Background
The Network Time Protocol (NTP) server provides Network Time Protocol services to mainly solve Time errors caused by the accuracy deviation of the computer device itself. In computer equipment in the fields of rail transit, finance, communication billing, aerospace and the like, clock data provided by the computer equipment can not meet requirements, and the reason for generating time errors is that clock signals of the computer equipment are from an own oscillator, the oscillation frequency of a crystal oscillator is not only related to factors such as the shape, the material and the cutting direction of the crystal oscillator, but also related to factors such as temperature change, voltage and chip aging, and the oscillation frequency is difficult to be ensured to be consistent with a standard frequency.
Referring to fig. 1, fig. 1 is a schematic diagram of a network structure of a network time protocol server in the related art, each layer of which can provide a time alignment service, also called a network protocol time service, to an external computer device. Wherein, layer (Stratum)1 is the top layer, and acquires the reference time signal from Stratum0 (i.e. external access standard time source) for time calibration, while the secondary NTP server in Stratum2 acquires the reference time signal from the primary NTP server in Stratum1 for time calibration, and the primary NTP server in Stratum3 acquires the reference time signal from the secondary NTP server in Stratum2 for time calibration; and so on.
Therefore, the network time protocol server adopts a layer-by-layer synchronization method to perform time synchronization, and the precision of the synchronization time is reduced layer by layer along with the increase of the number of network layers.
The prior art lacks an effective scheme for managing a network time protocol server.
Disclosure of Invention
Embodiments of the present application provide a method, a system, a server, and a computer device readable storage medium for managing a network time protocol server, which can effectively manage the network time protocol server.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a management method of a network time protocol server, which comprises the following steps:
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 program coordination server;
the network time protocol server monitors the data model, reads the atomic transaction from the data model maintained by the distributed application program coordination server when the atomic transaction is monitored to be written in, and
and executing the atomic transaction on the network time protocol service operated by the network time protocol server.
An embodiment of the present application provides a management system for a network time protocol server, including:
an object storage server to:
receiving a task 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 program coordination server;
the distributed application coordination server is configured to:
maintaining the distributed data model;
the network time protocol server is configured to:
monitoring the data model, reading the atomic transaction from the data model maintained by the distributed application program coordination server when the atomic transaction is monitored to be written in, and
and executing the atomic transaction on the network time protocol service operated by the network time protocol server.
In the above solution, the object storage server is further configured to:
when the task is used for modifying configuration information of network time protocol services operated by a plurality of network time protocol servers in batches and restarting the network time protocol services, the following processing is executed:
decomposing the task into atomic transactions executed in parallel by the plurality of network time protocol servers and used to modify configuration information of the network time protocol service; and
according to the dependency relationship among the plurality of network time protocol servers, decomposing the task into atomic transactions which are sequentially executed by the plurality of network time protocol servers and used for restarting the network time protocol service;
when the task is used for modifying the configuration information of the network time protocol service operated by any one of the network time protocol servers and restarting the network time protocol service, the task is decomposed into an atomic transaction which is executed by the network time protocol server and is used for modifying the configuration information of the network time protocol service and an atomic transaction used for restarting the network time protocol service;
when the task is used for acquiring configuration information of network time protocol services operated by a plurality of network time protocol servers in batches, the task is decomposed into atomic transactions which are executed by the plurality of network time protocol servers in parallel and are used for acquiring the configuration information of the network time protocol services;
when the task is used for acquiring the configuration information of the network time protocol service operated by any network time protocol server, decomposing the task into an atomic transaction which is executed by the network time protocol server and is used for acquiring the configuration information of the network time protocol service;
when the task is used for modifying the available area of the network time protocol service operated by a plurality of network time protocol servers in batch, the task is decomposed into atomic transactions which are executed by the plurality of network time protocol servers and are used for modifying the available area of the network time protocol service operated by the network time protocol servers.
In the above solution, the distributed application coordination server is a server cluster, and includes the following types of servers: a leader server, at least one follower server, and at least one watcher server; wherein the leader server is further to:
receiving a write request for the atomic transaction;
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;
and when the follower server and the observer server feed back that the log writing is successful, writing the atomic transaction into the data model maintained by the follower server and the observer server, and broadcasting a submission message of the atomic transaction to inform the follower server and the observer server to write the atomic transaction into the data model maintained by the follower server and the observer server respectively.
In the above solution, the data model includes a directory node corresponding to each network protocol time server, and the directory node includes the following subdirectory nodes: a configuration information subdirectory node, a configuration modification task state subdirectory node, a restart instruction subdirectory node, a restart service task state subdirectory node and a configuration acquisition task state subdirectory node;
when the task is to modify configuration information of the network time protocol service, the atomic transaction includes configuration information and a configuration modification task state, the leader server is further to:
writing the configuration information into the configuration information subdirectory node, and modifying the configuration modification task state subdirectory node to be in progress;
when the task is to restart the network time protocol service, the atomic transaction includes a restart instruction and a restart service task state, the leader server is further to:
writing the restart instruction in the restart instruction subdirectory node, and modifying the restart service task state subdirectory node to be in progress;
when the task is used to obtain configuration information of the network time protocol service, the atomic transaction includes configuration information and a configuration obtaining task state, and the leader server is further configured to:
and modifying the configuration acquisition task state subdirectory node into the on-going state, and writing the configuration information returned by the network time protocol server into the configuration information subdirectory node.
In the foregoing solution, the network time protocol server is further configured to:
and registering directory nodes needing monitoring in the distributed application program coordination server, and reading the atomic transaction from the registered and monitored directory nodes when receiving an update notification of the registered and monitored directory nodes in the distributed application program coordination server.
In the foregoing solution, the plurality of network time protocol servers are further configured to:
executing the atomic transaction in parallel to modify configuration information of a network time protocol service running in a plurality of network time protocol servers;
when the configuration information of the network time protocol service is completely modified successfully, restarting the respective running network time protocol service in sequence;
wherein the order is generated according to a dependency relationship between the plurality of network time protocol servers.
In the above solution, the data model includes a directory node corresponding to each network protocol time server, and the directory node includes the following subdirectory nodes: a service monitoring data subdirectory node and a service monitoring state subdirectory node;
the object storage server is further configured to:
modifying the business monitoring state subdirectory node of the data model into in-process so as to ensure that
The network time protocol server writes real-time service monitoring data corresponding to the running network protocol time service in a service monitoring data subdirectory node of the data model, and modifies the service monitoring state subdirectory node to be successful so that the distributed application program coordination server sends an update notification to the object storage server;
and when the object storage server receives the update notification, acquiring the real-time service monitoring data from the service monitoring data subdirectory node of the data model, and sending the real-time service monitoring data to a client for display in a visual view mode.
In the foregoing solution, the object storage server is further configured to:
storing the operation records of the tasks into a database;
wherein the operation record comprises: issuing the user identification of the task and the time for issuing the task;
and responding to a query instruction of an operation record sent by a client based on a task, and sending the operation record of the task to the client.
In the above solution, the data model includes a directory node corresponding to each network protocol time server, and the directory node includes a client time subdirectory node;
when the configuration information of the network time protocol service operated by the network time protocol server is invalid, the object storage server is used for:
writing the client time received from the client into a client time subdirectory node of the data model to cause the distributed application coordination server to send 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;
and when the difference value between the local time of the network time protocol server and the client time exceeds a time difference threshold value, sending an alarm.
An embodiment of the present application provides a management apparatus for a network time protocol server, including:
an object storage service module to:
receiving a task 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 program coordination server;
a network time protocol service module to:
maintaining the distributed data model;
a distributed application coordination service module to:
monitoring the data model, reading the atomic transaction from the data model maintained by the distributed application program coordination server when the atomic transaction is monitored to be written in, and
and executing the atomic transaction on the network time protocol service operated by the network time protocol server.
The embodiment of the present application provides a computer-readable storage medium, which stores executable instructions and is used for implementing the management method of the network time protocol server provided by the embodiment of the present application when being executed by a processor.
The embodiment of the application has the following beneficial effects:
the distributed application program coordination server is used as an intermediary of the object storage server for managing the network time protocol server, the consistency and the reliability of the management of the network protocol service are ensured by splitting the atomic affair of the task, and the atomic affair can reach the network protocol time server in time through the monitoring mechanism of the data structure so as to carry out efficient management.
Drawings
Fig. 1 is a schematic diagram of a network structure of a network time protocol server in the related art;
fig. 2A is a schematic architecture diagram of a management system of a network time protocol server according to an embodiment of the present application;
fig. 2B is a schematic architecture diagram of a management system of a network time protocol server according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a server 900 provided in an embodiment of the present application;
fig. 4 is a schematic diagram of a system architecture in which a distributed application coordination server 400 interacts with an NTP server according to an embodiment of the present application;
FIG. 5 is a data model diagram of a distributed application coordination server 400 provided by an embodiment of the present application;
fig. 6A is an alternative flowchart of a management method of a network time protocol server according to an embodiment of the present application;
fig. 6B is an alternative flowchart of a management method of a network time protocol server according to an embodiment of the present application;
fig. 6C is a schematic flowchart of a management method of a network time protocol server according to an embodiment of the present application;
FIG. 7 is a schematic diagram of task decomposition of an object store server provided by an embodiment of the present application;
fig. 8 is a schematic diagram of an execution flow of an atomic transaction provided in an embodiment of the present application.
Detailed Description
In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the attached drawings, the described embodiments should not be considered as limiting the present application, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is 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.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
Before further detailed description of the embodiments of the present application, terms and expressions referred to in the embodiments of the present application will be described, and the terms and expressions referred to in the embodiments of the present application will be used for the following explanation.
1) Distributed application coordination services, such as Zookeeper: is an open source implementation of the distributed lock service Chubby inside Google. It is a software that provides a consistent service for distributed applications, and the functions provided include: configuration maintenance, distributed synchronization, etc.
2) The Network Time Protocol (NTP) is a Protocol for Time synchronization of computer equipment, it can make computer equipment implement Time synchronization to NTP server, also can make NTP server implement Time synchronization to upper-stage NTP service or clock source, it can provide high-accuracy Time correction (the difference between standard and local area Network LAN is less than 1 millisecond, and wide area Network WAN is several tens milliseconds), and can utilize encryption confirmation mode to prevent malicious Protocol attack.
3) The NTP server runs the NTP service to calibrate local time based on the time signal of the upper-level source so as to provide accurate time signals for the served computer equipment, for example, accurate time stamps are added in a log of the computer equipment.
4) Monitoring platforms, such as Argus: the platform is a unique monitoring alarm visual platform of the cloud platform, and can manage reported monitoring data and provide a visual data graph.
5) The Object Storage Service (OSS) is a Service operated in the form of a cloud Service for interacting with a front end (facing an operation and maintenance manager) and a distributed application program coordination Service, and is used for the OSS issuing a task (modifying configuration restart/reporting configuration information/reporting real-time Service monitoring data) to a proxy Service Agent of an NTP server through the distributed application program coordination Service for execution, and acquiring configuration information of an NTP Service operated in the NTP server and the real-time Service monitoring data from the Agent.
6) And the Agent (Agent) service is deployed in each NTP server, executes the task of the OSS through the distributed application program coordination service (in the form of atomic transaction), acquires the real-time service monitoring data of the NTP service operated in the NTP server and stores the data into the distributed application program coordination service.
7) The data model is a data structure used by a distributed application program coordination service for storing data, and comprises a plurality of levels of directory nodes, for example, the data model comprises: client time directory node and ntp _ agent directory node (where ntp _ agent is used for naming only); the NTP _ agent directory node comprises directory nodes corresponding to the plurality of NTP servers one to one, and the directory node of each NTP server can comprise a plurality of subdirectory nodes for storing and managing tasks of the NTP servers (including issuing instructions, modifying states, modifying configuration and acquiring real-time service monitoring data).
8) The atomic transaction is a program execution logic unit formed by a series of operations such as configuring data in the server and the like, and ensures that each transaction is executed successfully or unsuccessfully without intermediate state.
An exemplary application of the management method of the network time protocol server provided by the embodiment of the present application in a server cluster will be described below. Referring to fig. 2A, fig. 2A is a schematic structural diagram of a management system of a network time protocol server according to an embodiment of the present application. Wherein, include: an object store server 200, a network time protocol server (only network time protocol server 300-1, network time protocol server 300-2, and network time protocol server 300-3 are shown in FIG. 2A), a distributed application coordination server 400, and a client 500.
The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, middleware service, a domain name service, a security service, a CDN, and a big data and artificial intelligence platform, and the embodiment of the present application is not limited herein.
Taking the example that the operation and maintenance personnel issues the task of managing the network time protocol server at the client, the operation and maintenance personnel issues the task (e.g., modifying the configuration information of the network time protocol service operated by 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)), restarting the network time protocol service operated by 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) and acquiring 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) in real time at the client 500, Service data of the network time protocol server 300-2 and the network time protocol server 300-3), the object storage server 200 receives a task issued by a client, and communication between the object storage server 200 and the network time protocol servers (e.g., the network time protocol server 300-1, the network time protocol server 300-2 and the network time protocol server 300-3) is established through the distributed application coordination server 400, that is, after the object storage server 200 decomposes the received task into an atomic transaction, the atomic transaction is written into a distributed data model maintained by the distributed application coordination server 400, and 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 into the atomic transaction, the atomic transaction is read from the data model maintained by the corresponding distributed application coordination server 400 and executed against the network time protocol services run by the corresponding network time protocol servers (e.g., network time protocol server 300-1, network time protocol server 300-2, and network time protocol server 300-3).
Referring to fig. 2B, based on fig. 2A, an application scenario of the management method for a network time protocol server according to the embodiment of the present application may further include a monitoring platform and a data model. Fig. 2B is a schematic architecture diagram of a management system of a network time protocol server according to an embodiment of the present application. Wherein, include: object store server 200, network time protocol server (only network time protocol server 300-1, network time protocol server 300-2, and network time protocol server 300-3 are shown in FIG. 2B), distributed application coordination server 400, client 500, monitoring platform 700, and database 800. The following description is made.
Taking the example that the operation and maintenance personnel issues the task of managing the network time protocol server at the client, the operation and maintenance personnel issues the task (e.g., modifying the configuration information of the network time protocol service operated by 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)), restarting the network time protocol service operated by 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) and acquiring 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) in real time at the client 500, Service data of the network time protocol server 300-2 and the network time protocol server 300-3), the object storage server 200 receives a task issued by the client 500, and establishes communication between the object storage server 200 and 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) through the distributed application program coordination server 400, that is, after the object storage server 200 decomposes the received task into atomic transactions, the atomic transactions are written into a distributed data model maintained by the distributed application program coordination server 400, and operation records related to the task are stored in the database 800; when the network time protocol servers (such as the network time protocol server 300-1, the network time protocol server 300-2 and the network time protocol server 300-3) monitor that the data model is written into the atomic transaction, reading the atomic transaction from the data model maintained by the corresponding distributed application coordination server 400, and executing the atomic transaction on the network time protocol services operated by the network time protocol servers (such as 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 servers (such as the network time protocol server 300-1, the network time protocol server 300-2 and the network time protocol server 300-3) report monitoring data of the network protocol time servers (such as 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 periodically, and the monitoring data are presented in a visual view mode on the monitoring platform 700; when the monitoring data is abnormal, the alarm information is sent to the client 500 for presentation, and is referred by operation and maintenance personnel.
In some embodiments, distributed application coordination server 400 may be a cluster of servers, each of which is a node. For example, referring to fig. 4, fig. 4 is a schematic diagram of a system architecture of a distributed application coordination server 400 interacting with an NTP server according to an embodiment of the present application. Among them, distributed application coordination server 400 and NTP server (NT P server 300-1, NTP server 300-2, and NTP server 300-3 are shown by way of example); among them, the distributed application coordination server 400 includes: leader server 410, follower server 420, and observer server 430; two programs run in the NTP server: proxy service Agent and NTP service. The following description will be made separately.
The leader server 410 is configured to respond to the write request of the object storage server 200, and write the atomic transaction issued by the object storage server into the respective maintained data models together with the follower server 420 and the observer server 430, so as to ensure data consistency; a heartbeat is initiated and maintained with the follower server 420 and the observer server 430.
And the follower server 420 is used for responding to the heartbeat of the leader server 410, directly processing and returning the read request of the network time protocol server 300, and forwarding the write request of the object storage server 200 to the leader server 410 for processing. A server cluster may have multiple follower servers 420 present at the same time.
Observer server 430, functions similarly to follower server 420, but has no election right.
It should be noted that the leader server 410 is created by election (i.e., a complete agreement or partial agreement is reached as to which node is the leader server 410, e.g., a node is agreed upon by more than half of the nodes to the leader server 410, representing being successfully elected as the leader server 410), and there will only be one leader server in the server cluster that actually works at the same time.
In the Election stage (Leader electric), when a server cluster is initialized, all servers are in the role of Election nodes, and as long as one node obtains votes more than half of the servers, the server can be selected as a Leader server; the basis for election may be any information that may be used for comparison, such as some property parameters of the server itself, including: IP address, CPU core number, memory size, self-defined serial number; elections may also be derived based on various election algorithms, such as the Atomic Broadcast protocol (ZAB, ZooKeepe r Atomic Broadcast), distributed consistency algorithms (Paxos), and so on.
In some embodiments, the leader server 410 receives an atomic transaction sent by the object store server 200, broadcasts a proposal corresponding to the atomic transaction, and the follower server 420 and the observer server 430 write the transaction to a log; when more than half (or all, preset number/proportion) of the follower servers 420 and the observer servers 430 feedback that the atomic transaction is successfully written into the log in 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 servers 420 and the observer servers 430 to commit the atomic transaction, so as to write the atomic transaction into the data model maintained by the follower servers 420 and the observer servers 430 themselves. Wherein the object storage server 200 can send the write request to any one of the servers in the server cluster, and if the server receiving the write request is not the leader server 410, forward the write request to the leader server 410 for processing.
Based on fig. 2B, referring to fig. 5, fig. 5 is a data model schematic diagram of a distributed application coordination server 400 provided by the embodiment of the present application. Fig. 5 exemplarily shows subdirectory nodes of an NTP server IP (i.e., 10.10.0.3), wherein each box represents a directory node (ZNode), which is a minimum unit for storing data, and each directory node can store data and can hang a subdirectory node, thereby forming a hierarchical namespace, which is called a tree-shaped data structure, that is, a data model of the distributed application coordination server 400.
Among them, 1) directory nodes/ntp _ oss, ntp _ oss/ntp _ agent are used only for naming, and no data is stored thereon.
2) The directory node/ntp _ oss/client _ time is used for storing client time; the front end sends the client time to the object storage server, and the object storage server coordinates the server directory node (/ ntp _ oss/client _ time) to transmit to each network time protocol server through the distributed application program.
3) Below the directory node/NTP _ oss/NTP _ agent/[ NTP server IP ] are various information corresponding to each network time protocol server, including available area available _ zone, configuration modification task state config, and the like.
4) The directory node/NTP _ oss/NTP _ agent/[ NTP server IP ]/command is used for storing a restart instruction; 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 state of the restart task of the corresponding network time protocol service; the object storage server writes the restart instruction into a directory node/NTP _ oss/NTP _ agent/[ NTP server IP ]/co mmand, then changes the restart service state subdirectory node service _ state to 2, the proxy service of the corresponding network time protocol server acquires the restart instruction from the restart instruction subdirectory node command to execute, and then writes the execution result back into the service _ state.
5) The directory node/NTP _ oss/NTP _ agent/[ NTP server IP ]/config/upstream is used for storing configuration information; the values 0, 1 and 2 of the directory node/NTP _ oss/NTP _ agent/[ NTP server IP ]/config respectively represent the failure, success and ongoing state of the corresponding network time protocol server configuration modification task; the object storage server writes the configuration information of which the front end needs to be modified into the configuration information subdirectory node upstream, then modifies the value of config into 2, the proxy service corresponding to the network time protocol server acquires the configuration information from upstream, checks (the checked content comprises whether the valid IP is legal or not, whether NTP service is provided or not and the like), and synchronizes the configuration information into the local configuration of the network time protocol server after the check is successful.
6) The directory node/NTP _ oss/NTP _ agent/[ NTP server IP ]/config/message is used for storing error information when the task execution fails; and writing error information when the execution of the configuration modification task fails into an error information subdirectory node message for the object storage server to obtain.
7) And the directory node/NTP _ oss/NTP _ agent/[ NTP server IP ]/config/sync is used for triggering the proxy service of the network time protocol server by the object storage server and synchronizing the local configuration of the network time protocol server to the corresponding directory node of the object storage server, so that the consistency of the configuration is ensured.
For example, when the object storage server calls an interface, a synchronization request is triggered, the value of the synchronization instruction subdirectory node sync is modified to 2, and synchronization is required; and then when the proxy service of the network time protocol server monitors that the sync is 2, writing the local configuration information of the network time protocol server into the upstream and modifying the sync into 1.
It should be noted that, the operation and maintenance personnel may set that when the object storage server issues 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.
8) And the directory node/NTP _ oss/NTP _ agent/[ NTP server IP ]/alive is used for storing the latest modification time. The proxy service of the network time protocol server is written once every two seconds to prove that the proxy service is alive, and the object storage server can know the survival condition of the network time protocol server by checking the latest modification time of the corresponding heartbeat subdirectory node alive.
9) The directory node/NTP _ oss/NTP _ agent/[ NTP server IP ]/monitor _ data/data is used for storing service 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 _ os/NTP _ agent/[ NTP server IP ]/monitor _ data represent the states of failure, success and ongoing of acquiring the service monitoring data of the network time protocol service in the corresponding network time protocol server respectively; the proxy service of the network time protocol server can write the business monitoring data into/NTP _ oss/NTP _ agent/[ NTP server IP ]/monitor _ data/data in real time.
The data model of the distributed application coordination server 400 may include a plurality of hierarchical directory nodes, like a file system, for storing and managing tasks of the network time protocol server 300, and the directory nodes may be added or deleted through an object storage server, and the data model shown in fig. 5 is provided in this embodiment by way of example only, and the data model in fig. 5 may have a variety of variations, and the embodiment of this application is not limited herein.
Next, a structure of the server provided in the embodiment of the present application is described, where the server may be any one of the servers described above, such as an object storage server, a distributed application coordination server, and a network protocol time server.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a server 900 provided in an embodiment of the present application, where the server 900 shown in fig. 3 includes: at least one processor 910, memory 930, and at least one network interface 920. The various components in the server 900 are coupled together by a bus system 940. It is understood that the bus system 940 is used to enable connected communication between these components. The bus system 940 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 940 in fig. 3.
The Processor 910 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.
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, and the like. Memory 930 may optionally include one or more storage devices physically located remote from processor 910.
The memory 930 includes volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. 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 embodiments herein is intended to comprise any suitable type of memory.
In some embodiments, memory 930 is capable of storing data to support various operations, examples of which include programs, modules, and data models, or subsets or supersets thereof, as exemplified below.
An 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;
a network communication module 932 for communicating to other computer devices via one or more (wired or wireless) network interfaces 920, exemplary network interfaces 920 including: bluetooth, wireless compatibility authentication (Wi Fi), Universal Serial Bus (USB), and the like;
the management apparatus 933 for network time protocol server includes the following program modules for implementing the management method for network time protocol server provided in this embodiment of the present application:
an object storage service module 9331, operable in the object storage server, for receiving tasks for managing the network time protocol server; decomposing the task into an atomic transaction, and writing the atomic transaction into a distributed data model maintained by a distributed application program coordination server;
a network time protocol service module 9332, which can be operated in the network time protocol server, for maintaining the distributed data model;
the distributed application coordination service module 9333 may be executed in the distributed application coordination server, and configured to listen to the data model, read an atomic transaction from the data model maintained by the distributed application coordination server when it is listened to that the atomic transaction is written in, and execute the atomic transaction on the network time protocol service executed by the network time protocol server.
In some embodiments, the server 900 may be any of the object storage server 200, the distributed application coordination server 400, or the network time protocol server 300 of FIG. 2A. The processor 910 executes a corresponding module in the hypervisor 933 of the network time protocol server according to the type of server that the server 900 needs to implement, so as to perform the function of the corresponding type of server.
In the following, the management method of the network time protocol server provided in the embodiment of the present application will be described in conjunction with the structure of the management system provided in the embodiment of the present application and the exemplary application and implementation of the server described above, and for the sake of convenience of description, the server described below omits the corresponding reference numerals in fig. 2A and 2B, but can still be understood in conjunction with fig. 2A and 2B.
Referring to fig. 6A, fig. 6A is an alternative flowchart of a management method of a network time protocol server according to an embodiment of the present application, which will be described with reference to the steps shown in fig. 6A.
In step 101, an object storage server receives a task for managing a network time protocol server.
In some embodiments, the object storage server runs the object storage service in the form of a cloud service, and a user submits a task for managing the network time protocol server at an interface of a client of the front end (e.g., various forms of clients) accessing the object storage server to realize the task of managing the network time protocol server. The task received by the object storage server is issued by operation and maintenance personnel at the client; the management network time protocol server can manage a plurality of network time protocol servers in batch, or only manage one network time protocol server.
By the management mode of the embodiment of the application, the network time protocol server can be managed at the client interface at any time, and repeated and complicated manual operation aiming at each machine is avoided; the management method is changed from complex program modification into simple front-end visualization, so that the management threshold is reduced, and the problems caused by manual operation can be avoided.
In step 102, the object store server decomposes the task into atomic transactions.
In some embodiments, the object store server breaks down the task into atomic transactions, including the following:
case 1):
when the task is used for modifying configuration information of the network time protocol service operated by a plurality of network time protocol servers in batches and restarting the network time protocol service, the following processing is executed: decomposing the task into atomic transactions executed by a plurality of network time protocol servers in parallel and used for modifying the configuration information of the network time protocol service; and decomposing the task into atomic transactions which are sequentially executed by the plurality of network time protocol servers and are used for restarting the network time protocol service according to the dependency relationship among the plurality of network time protocol servers.
As an example, when the task issued by the operation and maintenance personnel is to modify the upper source IP of 10.10.0.1, 10.10.0.2, 10.10.0.3 to 1.1.1.1, 1.1.1.2, 1.1.1.3, respectively, and restart the corresponding network time protocol service, the object storage server decomposes the task into six atomic transactions, that is, a task one: modify 10.10.0.1's upper source IP to 1.1.1.1, task two: modify 10.10.0.2's upper source IP to 1.1.1.2, task three: modify 10.10.0.3's upper level source IP to 1.1.1.3, task four: restart 10.10.0.1 NTP service, task five: NTP service restart 10.10.0.2, task six: the NTP service of 10.10.0.3 is restarted.
It should be noted that, after all the configuration modification tasks are successfully executed, the restart task is started to be executed, and before the corresponding NTP service is executed and restarted, an execution sequence for restarting the NTP server may be randomly generated, where the execution sequence is a dependency relationship of the NTP server. Therefore, as the NTP servers for configuring and modifying tasks have no dependency relationship, the tasks I, II and III can be executed in parallel; and the restart service task executes tasks four, five and six according to the generated execution sequence.
Case 2):
when the task is used for modifying the configuration information of the network time protocol service operated by any one network time protocol server and restarting the network time protocol service, the task is decomposed into an atomic transaction which is executed by the network time protocol server and is used for modifying the configuration information of the network time protocol service and an atomic transaction used for restarting the network time protocol service.
As an example, when the task issued by the operation and maintenance staff is the NTP service that modifies the upper source IP of 10.10.0.1 to 1.1.1 and restarts 10.10.0.1, the object storage server decomposes the task into two atomic transactions, that is, task one: modify 10.10.0.1's upper source IP to 1.1.1.1, task two: the NTP service of 10.10.0.1 is restarted.
Case 3):
when the task is used for acquiring the configuration information of the network time protocol service operated by the plurality of network time protocol servers in batch, the task is decomposed into atomic transactions which are executed by the plurality of network time protocol servers in parallel and are used for acquiring the configuration information of the network time protocol service.
As an example, when the task issued by the operation and maintenance personnel is to obtain the upper source IP of 10.10.0.1, 10.10.0.2 and 10.10.0.3, the task is decomposed into a task one: obtain 10.10.0.1 upper source IP, task two: get 10.10.0.2 upper level source IP and task three: 10.10.0.3.
Case 4):
when the task is used for acquiring the configuration information of the network time protocol service operated by any one network time protocol server, the task is decomposed into atomic transactions which are executed by the network time protocol server and are used for acquiring the configuration information of the network time protocol service.
As an example, when the task issued by the operation and maintenance personnel is the upper source IP of 10.10.0.1, the task is decomposed into task one: the upper level source IP of 10.10.0.1 is obtained.
Case 5):
when the task is used for modifying the available area of the network time protocol service operated by the plurality of network time protocol servers in batches, the task is decomposed into atomic transactions which are executed by the plurality of network time protocol servers and are used for modifying the available area of the network time protocol service operated by the network time protocol servers.
As an example, referring to fig. 5, the available area available _ zone here indicates the available area to which 10.10.0.3 belongs. The selection of available areas is associated with disaster recovery capabilities and network latency. The network time protocol server is deployed in different available areas of the same region, so that the disaster tolerance capability is high; when the network time protocol servers are deployed in the same available area, the network delay between the network time protocol services is low. According to the method and the device, the usable area can be configured, and the user can be prevented from being influenced by a single-position fault.
In step 103, the object store server writes the atomic transaction into the distributed data model maintained by the distributed application coordination server.
In some embodiments, distributed application coordination server 400, as shown in FIG. 4, is a cluster of servers, including servers of the following types: a leader server, at least one follower server, and at least one watcher server.
In some examples, based on fig. 6A, referring to fig. 6B, fig. 6B is an optional flowchart of a management method of a network time protocol server provided in an embodiment of the present application, and step 103 shown in fig. 6B may be implemented through step 1031 to step 1033, which will be described with reference to the step shown in fig. 6B.
In step 1031, the object storage server sends a write request of the atomic transaction to the leader server.
In step 1032, the leader server broadcasts the atomic transaction in the cluster of servers according to the write request, such that the follower server and the observer server write the atomic transaction to the log.
In step 1033, when all or part of the follower server and the observer server feed back that the writing into the log is successful, the leader server writes the atomic transaction into the data model maintained by itself, and broadcasts a commit message of the atomic transaction to notify the follower server and the observer server to write the atomic transaction into the respective maintained data models.
It should be noted that the object storage server may send the write request of the atomic transaction to any one server in the server cluster nearby, and 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.
According to the method and the device for recording the atomic transaction, the operation of each atomic transaction is recorded in a mode of writing the log into the data model after the log is successfully written, and when the atomic transaction is successfully submitted, the data in the transaction can be persisted into the data model. On one hand, for the case that a transaction executing a part of operations encounters communication interruption, the information retained in the log can perform corresponding re-execution log operation on data which is not persisted yet to recover the data; on the other hand, for the case that the committed transaction encounters a server crash, the restart service can also perform corresponding re-execution operation on the data which is not persisted according to the log so as to recover the data.
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 subdirectory nodes: the method comprises the following steps that a configuration information subdirectory node, a configuration modification task state subdirectory node, a restart instruction subdirectory node, a restart service task state subdirectory node and a configuration acquisition task state subdirectory node are arranged, and a leader server writes an atomic transaction into a data model maintained by the leader server, and comprises the following steps:
1) when the task is used for modifying the configuration information of the network time protocol service, the atomic transaction comprises the configuration information and the configuration modification task state; the leader server writes the configuration information into the configuration information subdirectory node and modifies the configuration modification task state subdirectory node into progress;
2) when the task is used for restarting the network time protocol service, the atomic transaction comprises a restart instruction and a restart service task state; the leader server writes a restart instruction in the restart instruction subdirectory node and modifies the restart service task state subdirectory node into progress;
3) when the task is used for acquiring the configuration information of the network time protocol service, the atomic transaction comprises the configuration information and a configuration acquisition task state; the leader server modifies the subdirectory node for configuring the acquired task state into the process, and when the network time protocol server receives the updating notice of the distributed application program coordination server, the network time protocol server returns the current configuration information of the network time protocol server; and writing the configuration information returned by the network time protocol server into the configuration information subdirectory node.
The follower server and the observer server write in the same manner as the leader.
In step 104, the network time protocol server listens to the data model, and when it is listened to that the atomic transaction is written, the atomic transaction is read from the data model maintained by any one of the distributed application coordination servers.
In some embodiments, based on fig. 6A, referring to fig. 6C, fig. 6C is a schematic flowchart of a management method of a network time protocol server provided in this embodiment of the present application, and step 104 shown in fig. 6C may be implemented through step 1041 to step 1042, which will be described with reference to each step.
In step 1041, the network time protocol server registers the directory node to be listened to in the distributed application coordination server.
In step 1042, when an update notification of a directory node registered for snooping in the distributed application coordination server is received, an atomic transaction is read from the registered snooped directory node.
In the embodiment of the application, the distributed application program coordination server is used as an intermediary for managing the network time protocol server by the object storage server, the object storage server and the network time protocol server can monitor directory nodes in the distributed application program coordination server, and bidirectional linkage is realized through a monitoring mechanism of the distributed application program coordination server; the transaction division based on the monitoring mechanism is more definite, monitoring and execution are realized separately, and better maintainability is achieved.
In step 105, the network time protocol server performs an atomic transaction on a network time protocol service run by the network time protocol server. Based on fig. 6A, referring to fig. 6C, step 105 shown in fig. 6C may be implemented through steps 1051 to 1053 when the task is used to modify configuration information of the network time protocol service running in the plurality of network time protocol servers in batch and restart the network time protocol service, and will be described with reference to the steps.
In step 1051, a plurality of network time protocol servers execute an atomic transaction in parallel to modify configuration information for network time protocol services running in the plurality of network time protocol servers.
In step 1052, when all the configuration information of the network time protocol service is successfully modified, the proxy service of the network time protocol server modifies the configuration modification task status subdirectory node in the data model to be successful.
In step 1053, the plurality of network time protocol servers sequentially restart the respective running network time protocol services in sequence; wherein the sequence of restarting the network time protocol service is generated according to the dependency relationship among the plurality of network time protocol servers.
The network time protocol server is started according to the sequence of the network time protocol servers, and the network time protocol servers are started according to the sequence of the network time protocol servers. For example, when a restart service executed by a certain network time protocol server fails, since the restart is performed in sequence, the subsequent restart task is stopped, thereby avoiding a large-area failure of the network time protocol server caused by failure diffusion.
In some embodiments, after step 105, the following steps may also be performed:
in some examples, the data model described above includes a directory node corresponding to each network protocol time server, and the directory node includes the following subdirectory nodes: a service monitoring data subdirectory node and a service monitoring state subdirectory node. The object storage server modifies the service monitoring state subdirectory node of the data model into an ongoing state, so that the network time protocol server writes real-time service monitoring data corresponding to the running network protocol time service into the service monitoring data subdirectory node of the data model, and modifies the service monitoring state subdirectory node into a successful state, so that the distributed application program coordination server sends an update notification to the object storage server; and when the object storage server receives the update notification, acquiring real-time service monitoring data from a service monitoring data subdirectory node of the data model, and sending the real-time service monitoring data to the client for display in a visual view mode.
In other examples, the network time protocol server periodically sends the service monitoring data corresponding to the running network protocol time service to the monitoring platform, so that the monitoring platform is presented in a visual view manner, and an alarm is given when the service monitoring data is abnormal.
In other examples, the object store server stores the operational records of the tasks in a database; wherein the operation record comprises: the user identification of the task and the time of the task are issued; and responding to a query instruction of the operation record sent by the client based on the task, and sending the operation record of the task to the client.
It should be noted that, the object storage server generates an operation record according to a task issued by the front end, stores the association relationship between the operation record and the task in the database, and may query, at the client interface, the user identifier for issuing the task and the time information for issuing the task according to the task, or query, according to the user identifier, the issued task list.
In other examples, the network protocol time server may refer to the time of the client by acquiring the time of the front end without an upper-level source and an external network, so as to compare whether the time of the network protocol time server is excessively deviated from the time of the client, and when the time of the network protocol time server is excessively deviated, an operation and maintenance worker or a manager may be notified of the deviation by sending an alarm message to perform an investigation, thereby avoiding causing a fault.
The data model comprises directory nodes corresponding to each network protocol time server, and the directory nodes comprise client time subdirectory nodes; when the configuration information of the network time protocol service operated by the network time protocol server is invalid, the object storage server writes the client time received from the client into a client time subdirectory node of the data model so that the distributed application program coordination server sends an update notification to the network time protocol server; when the network time protocol server receives an update notification of a client time directory node, reading the client time from the client time subdirectory node; and when the difference value between the local time of the network time protocol server and the time of the client exceeds a time difference threshold value, sending an alarm.
It should be noted that, the execution sequence of the steps after step 105 is not limited to be after step 105, for example, in other embodiments, the steps may also be before step 105, and the embodiments of the present application are not limited.
Next, an exemplary application of the embodiment of the present application in a practical application scenario will be described.
In the implementation process of the embodiment of the application, the following problems are found in the related art: when a layer-by-layer synchronization method is adopted in a network time protocol to provide network time protocol service for computer equipment, time synchronization is carried out through initialized configuration information, and when a network time protocol server breaks down, the configuration information cannot be modified, so that the emergency situation is difficult to effectively deal with, and therefore, the problem of how to effectively manage the network time protocol server is solved by the application.
In order to solve the above problems, an embodiment of the present application provides a method for managing a network time protocol server, which can issue management tasks to the network time protocol server in batches to implement effective management of the network time protocol server; the communication mode of the server is coordinated through the distributed application program, so that the response speed of communication is higher, and the reliability is higher.
The implementation scheme of the embodiment of the application is as follows:
a user accesses the object storage server through a front end (such as various forms of clients), submits tasks on an interface of the client of the object storage server, and stores the tasks into a directory node of the distributed application program coordination server for reading and execution of proxy services of the network time protocol server, so that effective management of the network time protocol server is realized.
In some embodiments, when the type of the task is a task of modifying configuration and restarting services, the object storage server decomposes the task into atomic transactions, and first writes the atomic transactions (including writing configuration information and writing a state of the configuration modification task) that modify the configuration information of the plurality of network time protocol servers in parallel to ensure that the atomic transactions that modify the configuration concurrently are successfully executed by the proxy services of the network time protocol servers, and then writes the atomic transactions of the restart services of the network time protocol services of the plurality of network time protocol servers into the directory nodes of the distributed application coordination server according to a rolling sequence, so that the proxy services of the respective network time protocol servers restart the network time protocol services in sequence.
By way of example, referring to fig. 7, fig. 7 is a schematic diagram of task decomposition of the object storage server according to an embodiment of the present application, where the front end submits a task of modifying configuration of 10.10.0.1 (IP address of network time protocol server), 10.10.0.2, 10.10.0.3 (for example, modifying upper source of 10.10.0.1, 10.10.0.2, 10.10.0.3 to 1.1.1.1.1, 1.1.1.2, 1.1.1.3, respectively) and restarting the service to the object storage server, where the task is decomposed into six atomic transactions by the object storage server.
By way of example, referring to fig. 8, fig. 8 is a schematic diagram of an execution flow of an atomic transaction provided in an embodiment of the present application. Wherein, the proxy service of the network time protocol server executes the atomic transaction of the network time protocol servers 10.10.0.1, 10.10.0.2 and 10.10.0.3 in parallel, and modifies the upper source IP 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 IP of the network time protocol servers 1.1.1.1, 1.1.1.2 and 1.1.1.3 is 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 respective running network time protocol services; wherein the order of the rolling restart is generated according to the dependency relationship between the proxy services of the network time protocol server.
Taking the example of collecting and reporting the service monitoring data, the proxy service of the network time protocol server in fig. 2B monitors the service monitoring data of the network time protocol service of the network time protocol server in real time, and stores the service monitoring data in the service monitoring data subdirectory node data in the data model maintained by the object storage server; and reporting the service monitoring data in the data to a monitoring platform at regular time to monitor whether the NTP service is normal, and sending alarm information when the service monitoring data is abnormal (for example, the time deviation value is more than 1000).
The service monitoring data includes an index of the network time protocol service provided by the network time protocol server, where the index may include: a time offset value (time offset of the NTP server from the upper source), a time jitter value (time-synchronized jitter value of the NTP server from the upper source), whether the NTP process is alive, whether the NTP port is alive, etc.
Embodiments of the present application provide a computer program product or computer program comprising 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 according to the embodiment of the present application.
Embodiments of the present application provide a computer device readable storage medium storing executable instructions, which when executed by a processor, will cause the processor to execute a management method of a network time protocol server provided by embodiments of the present application, for example, the management method of the network time protocol server as shown in fig. 6A, 6B or 6C.
In some embodiments, the computer device readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of a computer program, software module, script, or code, 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.
By way of example, executable instructions may correspond, but do not necessarily have to correspond, to files in a file system, may be stored in a portion of a file that holds other programs or data, e.g., in one or more scripts in a HyperText markup Language (HT ML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
By way of example, executable instructions may be deployed to be executed on one computer device or on multiple computer devices at one site or distributed across multiple sites and interconnected by a communication network.
In summary, the embodiment of the application can realize management of the network time protocol server at the client interface at any time, and avoid repeated and complicated manual operation for each machine; the management method is changed from complex program modification into simple front-end visualization, so that the management threshold is reduced, and the problems caused by manual operation can be avoided; the available area is configured, so that the user can be prevented from being influenced by a single position fault; the management system based on the monitoring mechanism has better maintainability; the NTP service is restarted in a rolling mode according to the dependency relationship of the NTP server, and the safety of a network time protocol server is guaranteed; in the case that the NT P server has no upper-level source and no external network, the reference can be made by acquiring the client time of the front end.
The above description is only an example of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims (10)

1. A method for managing a network time protocol server, the method comprising:
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 program coordination server;
the network time protocol server monitors the data model, reads the atomic transaction from the data model maintained by the distributed application program coordination server when the atomic transaction is monitored to be written in, and
and executing the atomic transaction on the network time protocol service operated by the network time protocol server.
2. The method of claim 1, wherein the object store server decomposes the task into atomic transactions comprising:
when the task is used for modifying configuration information of network time protocol services operated by a plurality of network time protocol servers in batches and restarting the network time protocol services, the following processing is executed:
decomposing the task into atomic transactions executed in parallel by the plurality of network time protocol servers and used to modify configuration information of the network time protocol service; and
according to the dependency relationship among the plurality of network time protocol servers, decomposing the task into atomic transactions which are sequentially executed by the plurality of network time protocol servers and used for restarting the network time protocol service;
when the task is used for modifying the configuration information of the network time protocol service operated by any one of the network time protocol servers and restarting the network time protocol service, the task is decomposed into an atomic transaction which is executed by the network time protocol server and is used for modifying the configuration information of the network time protocol service and an atomic transaction used for restarting the network time protocol service;
when the task is used for acquiring configuration information of network time protocol services operated by a plurality of network time protocol servers in batches, the task is decomposed into atomic transactions which are executed by the plurality of network time protocol servers in parallel and are used for acquiring the configuration information of the network time protocol services;
when the task is used for acquiring the configuration information of the network time protocol service operated by any network time protocol server, decomposing the task into an atomic transaction which is executed by the network time protocol server and is used for acquiring the configuration information of the network time protocol service;
when the task is used for modifying the available area of the network time protocol service operated by a plurality of network time protocol servers in batch, the task is decomposed into atomic transactions which are executed by the plurality of network time protocol servers and are used for modifying the available area of the network time protocol service operated by the network time protocol servers.
3. The method of claim 1,
the distributed application coordination server is a server cluster comprising the following types of servers:
a leader server, at least one follower server, and at least one watcher server;
the writing the atomic transaction into a distributed data model maintained by a distributed application coordination server includes:
sending a write request for the atomic transaction to the leader server;
the leader server 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;
when the follower server and the observer server feed back that the log writing is successful, the leader server writes the atomic transaction into the data model maintained by the leader server, and broadcasts a commit message of the atomic transaction to inform the follower server and the observer server to write the atomic transaction into the respective maintained data models respectively.
4. The method of claim 3,
the data model comprises directory nodes corresponding to each network protocol time server, and the directory nodes comprise the following subdirectory nodes: a configuration information subdirectory node, a configuration modification task state subdirectory node, a restart instruction subdirectory node, a restart service task state subdirectory node and a configuration acquisition task state subdirectory node;
when the task is used for modifying the configuration information of the network time protocol service, the atomic transaction comprises configuration information and a configuration modification task state, and the leader server writes the atomic transaction into a data model maintained by the leader server, wherein the steps of:
the leader server writes the configuration information into the configuration information subdirectory node and modifies the configuration modification task state subdirectory node into progress;
when the task is used for restarting the network time protocol service, the atomic transaction comprises a restart instruction and a restart service task state, and the leader server writes the atomic transaction into a data model maintained by the leader server, wherein the steps of:
the leader server writes the restart instruction in the restart instruction subdirectory node and modifies the restart service task state subdirectory node to be in progress;
when the task is used for acquiring configuration information of the network time protocol service, the atomic transaction comprises configuration information and a configuration acquisition task state, and the leader server writes the atomic transaction into a data model maintained by the leader server, including:
and the leader server modifies the configuration acquisition task state subdirectory node into the process, and writes configuration information returned by the network time protocol server into the configuration information subdirectory node.
5. The method of claim 1,
the network time protocol server monitors the data model, and when the atomic transaction is monitored to be written in, the atomic transaction is read from the distributed application program coordination server, and the method comprises the following steps:
the network time protocol server registers directory nodes needing monitoring in the distributed application program coordination server, and when receiving an update notification of the directory nodes registered and monitored in the distributed application program coordination server, the network time protocol server reads the atomic transaction from the registered and monitored directory nodes.
6. The method according to claim 2, wherein when the task is used for batched modification of configuration information of a network time protocol service running in a plurality of network time protocol servers and restarting the network time protocol service, the performing the atomic transaction on the network time protocol service running in the network time protocol server comprises:
the plurality of network time protocol servers execute the atomic transaction in parallel to modify configuration information of network time protocol services running in the plurality of network time protocol servers;
when all the configuration information of the network time protocol service is successfully modified, sequentially restarting the respective running network time protocol services by the plurality of network time protocol servers according to the sequence;
wherein the order is generated according to a dependency relationship between the plurality of network time protocol servers.
7. The method of claim 1,
the method further comprises the following steps:
the data model comprises directory nodes corresponding to each network protocol time server, and the directory nodes comprise the following subdirectory nodes: a service monitoring data subdirectory node and a service monitoring state subdirectory node;
the object storage server modifies the service monitoring state subdirectory node of the data model into the process so as to lead the service monitoring state subdirectory node to be in process
The network time protocol server writes real-time service monitoring data corresponding to the running network protocol time service in a service monitoring data subdirectory node of the data model, and modifies the service monitoring state subdirectory node to be successful so that the distributed application program coordination server sends an update notification to the object storage server;
and when the object storage server receives the update notification, acquiring the real-time service monitoring data from the service monitoring data subdirectory node of the data model, and sending the real-time service monitoring data to a client for display in a visual view mode.
8. The method of claim 1, further comprising:
the object storage server stores the operation records of the tasks into a database;
wherein the operation record comprises: issuing the user identification of the task and the time for issuing the task;
and responding to a query instruction of an operation record sent by a client based on a task, and sending the operation record of the task to the client.
9. The method of claim 1, further comprising:
the data model comprises directory nodes corresponding to each network protocol time server, and the directory nodes comprise client time subdirectory nodes;
when the configuration information of the network time protocol service operated by the network time protocol server is invalid, the object storage server writes the client time received from the client into a client time subdirectory node of the data model so that the distributed application program 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;
and when the difference value between the local time of the network time protocol server and the client time exceeds a time difference threshold value, sending an alarm.
10. A management system for a network time protocol server, comprising:
an object storage server to:
receiving a task 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 program coordination server;
the distributed application coordination server is configured to:
maintaining the distributed data model;
the network time protocol server is configured to:
monitoring the data model, reading the atomic transaction from the data model maintained by the distributed application program coordination server when the atomic transaction is monitored to be written in, and
and executing the atomic transaction on the network time protocol service operated by the network time protocol server.
CN202010704029.3A 2020-07-21 2020-07-21 Management method and system of network time protocol server Pending CN111884747A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010704029.3A CN111884747A (en) 2020-07-21 2020-07-21 Management method and system of network time protocol server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010704029.3A CN111884747A (en) 2020-07-21 2020-07-21 Management method and system of network time protocol server

Publications (1)

Publication Number Publication Date
CN111884747A true CN111884747A (en) 2020-11-03

Family

ID=73155072

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010704029.3A Pending CN111884747A (en) 2020-07-21 2020-07-21 Management method and system of network time protocol server

Country Status (1)

Country Link
CN (1) CN111884747A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112632017A (en) * 2020-11-05 2021-04-09 北京乐学帮网络技术有限公司 Database log processing method and device, electronic equipment and storage medium
CN113660121A (en) * 2021-08-13 2021-11-16 杭州安恒信息技术股份有限公司 Information management method and device based on distributed system and computer storage medium
CN115134267A (en) * 2022-07-27 2022-09-30 苏州浪潮智能科技有限公司 Server time synchronization method, device, computer equipment and medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112632017A (en) * 2020-11-05 2021-04-09 北京乐学帮网络技术有限公司 Database log processing method and device, electronic equipment and storage medium
CN113660121A (en) * 2021-08-13 2021-11-16 杭州安恒信息技术股份有限公司 Information management method and device based on distributed system and computer storage medium
CN113660121B (en) * 2021-08-13 2023-02-28 杭州安恒信息技术股份有限公司 Information management method and device based on distributed system and computer storage medium
CN115134267A (en) * 2022-07-27 2022-09-30 苏州浪潮智能科技有限公司 Server time synchronization method, device, computer equipment and medium
CN115134267B (en) * 2022-07-27 2023-07-18 苏州浪潮智能科技有限公司 Server time synchronization method, device, computer equipment and medium

Similar Documents

Publication Publication Date Title
US11914486B2 (en) Cloning and recovery of data volumes
CN111884747A (en) Management method and system of network time protocol server
US11706296B2 (en) Fault-tolerant and highly available configuration of distributed services
US11544288B2 (en) Systems and methods for managing distributed database deployments
US10713280B2 (en) Systems and methods for managing distributed database deployments
US10740353B2 (en) Systems and methods for managing distributed database deployments
US9984140B1 (en) Lease based leader election system
US10089307B2 (en) Scalable distributed data store
US9639439B2 (en) Disaster recovery framework for cloud delivery
CN105703940B (en) Monitoring system and monitoring method for multi-level scheduling distributed parallel computation
US20170286518A1 (en) Systems and methods for managing distributed database deployments
US8055735B2 (en) Method and system for forming a cluster of networked nodes
US20080281938A1 (en) Selecting a master node in a multi-node computer system
CN109639794A (en) A kind of stateful cluster recovery method, apparatus, equipment and readable storage medium storing program for executing
JP2001526508A (en) Network management
Oriani et al. From backup to hot standby: High availability for hdfs
CN112671613B (en) Federal learning cluster monitoring method, device, equipment and medium
Moghaddam et al. Self-healing redundancy for openstack applications through fault-tolerant multi-agent task scheduling
Aguilera et al. No Time for Asynchrony.
CN116346834A (en) Session synchronization method, device, computing equipment and computer storage medium
CN115396290B (en) Automatic fault recovery method, device and service system
WO2023071724A1 (en) Configuration management method, apparatus and system, and storage medium and program product
Marowsky-Brée A new cluster resource manager for heartbeat
US20230281220A1 (en) Method and device for data synchronization, storage medium and electronic device
CN117155955A (en) Synchronization method, apparatus, device, medium and program product in distributed system

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230925

Address after: 100190 Beijing Haidian District Zhichun Road 49 No. 3 West 309

Applicant after: TENCENT CLOUD COMPUTING (BEIJING) Co.,Ltd.

Address before: 518000 Tencent Building, No. 1 High-tech Zone, Nanshan District, Shenzhen City, Guangdong Province, 35 Floors

Applicant before: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.