|
但是在Centos8中,yum install ntp时提示没有ntp安装软件。 0 w2 S# D& E1 U7 Y- a. ~" t1 a' |
ntpdate方法: & l' v5 q) v4 @/ I0 |! C
添加wlnmp的yum源:
{3 W4 G; k$ q2 V2 j' Zrpm -ivh http://mirrors.wlnmp.com/centos/wlnmp-release-centos.noarch.rpm ! X. W, f/ [$ ^% g9 W
安装时间同步软件:
+ y0 Z" X) R8 kdnf install -y wntp
4 u1 D( f7 G5 c4 X测试:
% K8 P$ k/ O6 V$ C& jdate#显示当前的时间 ! B1 P: C$ V6 K- M& U/ L
date -s 2023/01/01 #修改时间 9 W) s# f1 I$ B8 ?$ e6 U4 S- y' ?
date#显示修改后的当前时间
1 H9 V4 K9 n$ _) q. K; j5 w) M8 [ntpdate 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 5 _+ S! O& y. G* @
# D: W) E) k7 W- c0 N
$ s/ V: ^0 |3 q: B0 Q1 }. C2 O% I- g5 T& d: b$ ?
|