In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Ntpdate
The ntpdate directive determines the correct time by polling the Network time Protocol (NTP) server specified as the server parameter to set the local date and time.
The scope of application of this command: RedHat, RHEL, Ubuntu, CentOS, Fedora.
1. Grammar
Ntpdate [options] server
2. List of options
Option
Description
-a
Enable authentication and specify the key identifier to use for authentication. The key and key identifier must match in both the client key file and the server key file. Disable authentication by default
-B
Force to always use adjtime system calls to fine-tune the time (even if the measured offset is greater than ±128ms). The default setting is to use clock_settime system call step time when the offset is greater than ±12.8ms
-b
Force the use of clock_settime system calls to step the time, rather than using adjtime system calls to fine-tune the time (the default). If called from the startup file at boot time, you should use this option
-d
Enable debug mode, where ntpdate goes through all the steps, not just adjusting the local clock. In addition, information that can be used for general debugging will be output.
-e
Specifies the processing delay for performing the authentication function as a value of authdelay (in seconds and its scores, see xntpd (1m) for more information). Although specifying a value can improve travel time accuracy on very slow CPU, the number is usually so small that it can be ignored in most cases
-k
Specify the path to the authentication key file as the string keyfile. The default is / etc/ntp.keys. The file should be in the format described in xntpd
-o
Specifies the NTP version of the outgoing packet as an integer version (which can be 1 or 2). The default value is 3. It allows ntpdate to be used with earlier versions of NTP
-p
The number of samples to be fetched from each server is specified as an integer example with values ranging from 1 to 8 (including these two numbers). The default value is 4
-Q
Outputs offset measurements, server levels, and latency measurements, but does not adjust the local clock. It is similar to the "- d" option, which provides more detailed debugging information
S
Transfer logging output from standard output (default) to the system syslog (see syslog (3C)) tool. It is mainly designed to facilitate the use of cron scripts
-t
Specifies the maximum time to wait for a response from the server as the timeout value, in seconds and its fraction. This value is rounded to a multiple of 0.2 seconds. The default value is 1 second, which is suitable for polling LAN
-u
Instructs ntpdate to use unprivileged ports for outgoing packets. Behind a firewall, this option is extremely useful if you block incoming traffic to privileged ports and want to synchronize with the host behind the firewall. Note that the "- d" option always uses an unprivileged port
-v
Output NTP version number and offset measurement information
3. Examples
Synchronization time
[root@localhost wj] # ntpdate 202.112.29.82
16 Aug 10:13:21 ntpdate [20212]: adjust time server 202.112.29.82 offset 0.006454 sec
A Linux learning platform has been made, and a prototype has come out at present, which you can refer to and use.
Link: https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ password: n7bk
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.