|
但是在Centos8中,yum install ntp时提示没有ntp安装软件。 " ^5 K0 D/ _& Y. F9 \
ntpdate方法: 5 Q. n& V! V" m& X3 B1 U! U
添加wlnmp的yum源:
# S; [& s+ T* o B8 Q& zrpm -ivh http://mirrors.wlnmp.com/centos/wlnmp-release-centos.noarch.rpm 7 P1 n. f( M) T# M( C" j4 H
安装时间同步软件:
: n5 e7 I7 p% n6 {% o! r. k% C7 T) ^dnf install -y wntp
8 U8 z+ `+ W9 U' ?& l4 w测试:
& ]- r0 y0 ?) d g5 |2 l9 V: Y3 f# M" f9 jdate#显示当前的时间
1 _/ I! C/ Q, y( ?8 \/ k. t3 \date -s 2023/01/01 #修改时间 6 w& x* \! l; W" Q- N
date#显示修改后的当前时间
' ]9 r; ?" D) f8 I1 [* antpdate ntp1.aliyun.com #同步时间 [root@controller ~]# ntpdate ntp1.aliyun.com 4 Feb 21:52:27 ntpdate[55244]: adjust time server 120.25.115.20 offset +0.000014 sec
* q' i8 R7 i! |1 e d1 \7 n9 {
. i ^0 R( `) L. r2 B, |
, x6 O5 D" ^; { ?; W4 ]" Y3 n; U; B% X& E. Y# d$ J
|