sntp -r <ntp server ip> // force ntp client synchronized ntp server.

cd /usr/share/zoneinfo/Asia //
cp Shanghai /etc/localtime // change time zone to CST

hwclock --show // show hardware time.
hwclock --systohc // change hardware time to system time.

ntpq -p // check ntp status.

/etc/init.d/ntp restart // ntp service restart.


ntp server:
add a line 'server 127.127.1.0 mode 5 prefer' to /etc/ntp.conf,
use '/etc/init.d/ntp restart' restart ntp service.
use 'ntpq -p' check the status.
eg:
wing-up-fr-179:/usr/share/zoneinfo/Asia # ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*LOCAL(0) .LOCL. 5 l 16 64 377 0.000 0.000 0.001

if there is a "*" before 'LOCAL(0)', then ntp server is OK, it will take serval minutes.

ntp client:
add a line 'server <ntp server ip>' to /etc/ntp.conf,
use '/etc/init.d/ntp restart' restart ntp service.
use 'sntp -r <ntp server ip>' to force synchronized.

 

相关文章:

  • 2021-12-09
  • 2022-12-23
  • 2021-11-25
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-18
  • 2022-02-26
  • 2021-12-22
  • 2022-12-23
  • 2021-12-09
  • 2022-02-19
  • 2021-12-23
相关资源
相似解决方案