Linux Time Configuration

Posted anyu686

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux Time Configuration相关的知识,希望对你有一定的参考价值。

  •  Hardware clock (UTC) sets system  clock contain the time zone variable) in booting up. NTP server give time to system clock.  "date" set system clock,"hwclock" set hardware clock
  • hwclock --systohc //sync the system time to hardware time 

  • hwclock --hctosys  //sync the hardware time to system time
  • timedatectl // to set timezone, enable/disanble NTP 
  • stratum (can be checked by ntpq)// In the world of NTP, stratum levels define the distance from the reference clock.  The basic definition of a stratum-1 time server is that it be directly linked (not over a network path) to a reliable source of UTC time such as GPS, WWV, or CDMA transmissions A stratum-1 time server acts as a primary network time standard. A stratum-2 server is connected to the stratum-1 server OVER A NETWORK PATH.  Thus, a stratum-2 server gets its time via NTP packet requests from a stratum-1 server A reference clock is a stratum-0 device that is assumed to be accurate and has lttle or no delay associated with it.  https://www.endruntechnologies.com/stratum1.htm
  • /etc/ntp.conf for ntp config
  • chrony // another sync protocol (more accuruate than NTP), configure file avaibale at chrony.conf,

    chronyc sources    // verify the sync  server 
    210 Number of sources = 4
    MS Name/IP address Stratum Poll Reach LastRx Last sample
    ===============================================================================
    ^- time.rdg.uk.as44574.net 2 8 77 123 +56ms[ +56ms] +/- 60ms
    ^- time.videxio.net 2 8 77 123 +59ms[ +59ms] +/- 67ms
    ^* 85.199.214.100 1 8 77 124 -6891us[ -56ms] +/- 72ms
    ^- nero.grnet.gr 1 8 267 108 +55ms[ +55ms] +/- 38ms


[email protected]:/etc/chrony# chronyc tracking
Reference ID : 85.199.214.100 (85.199.214.100)
Stratum : 2
Ref time (UTC) : Wed Apr 25 07:48:37 2018
System time : 0.001474089 seconds slow of NTP time
Last offset : -0.048626836 seconds
RMS offset : 0.015923370 seconds
Frequency : 78.733 ppm fast
Residual freq : -166.953 ppm
Skew : 1000000.000 ppm
Root delay : 0.144223 seconds
Root dispersion : 221.504059 seconds
Update interval : 257.2 seconds
Leap status : Normal

 






















以上是关于Linux Time Configuration的主要内容,如果未能解决你的问题,请参考以下文章

Linux之time命令

Linux时间同步脚本

nginx location 常用配置示例

linux下关于time相关函数的总结

Linux 之 time 命令

Linux下使用curl查看http请求各阶段耗时