时间篇之CentOS7中新增的timedatectl

NTP即Network Time Protocol(网络时间协议),是一个互联网协议,用于同步计算机之间的系统时钟。
timedatectl程序可以自动同步Linux系统时钟到使用NTP的远程服务器,timedatectl是linux cetntos7之后增加命令。

ntp官网网站:
http://www.ntp.org/
https://www.eecis.udel.edu/~mills/ntp/html/warp.html

http://doc.ntp.org/archives/4.2.8-series/warp/

 

一、centos7和centos6系统取样:

//centos7 timedatectl支持
[root@fp-web-112 linuxtime]# cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) [root@fp-web-112 linuxtime]# uname -r 3.10.0-327.el7.x86_64

[root@fp-web-112 ~]# rpm -qa | grep ntp
ntpdate-4.2.6p5-25.el7.centos.2.x86_64   //ntpdate包
fontpackages-filesystem-1.44-8.el7.noarch 
ntp-4.2.6p5-25.el7.centos.2.x86_64     //ntpd包

 

//如果是centos6是不支持该命令的

[root@fp-mysql-4 ~]# cat /etc/redhat-release
CentOS release 6.4 (Final)

[root@fp-mysql-4 ~]# rpm -qa | grep ntp
ntpdate-4.2.4p8-3.el6.centos.x86_64
ntp-4.2.4p8-3.el6.centos.x86_64

[root@fp-mysql-4 ~]# timedatectl
-bash: timedatectl: command not found

[root@fp-mysql-4 ~]# systemctl restart ntpd.service
-bash: systemctl: command not found

 

二、centos7使用timedatectl如下常见操作

//1.查看当前时间(包括日期和时区等):
   timedatectl或者timedatectl status
//2.查看所有可用时区:
timedatectl list-timezones
//3.设置时区:
timedatectl set-timezone “Asia/Shanghai”  
或 
timedatectl set-timezone PRC
//4.设置时间:
timedatectl set-time HH:MM:SS
//5.设置日期:
timedatectl set-time YYYY-MM-DD
//6.设置日期时间:
timedatectl set-time “YYYY-MM-DD HH:MM:SS”
//7.设置硬件时钟为本地时间,rtc表示硬件时钟
timedatectl set-local-rtc 1  
//8.设置硬件时钟为UTC时间:
timedatectl set-local-rtc 0
//9.启动NTP(启用NTP或Chrony):
timedatectl set-ntp true
10.禁用NTP:timedatectl set-ntp false

 

三、timedatectl
  这里要注意 timedatectl和ntp是密切相关的,先查看下这个命令。

系统查看
[root@fp-web-112 linuxtime]# timedatectl Local time: Tue 2009-04-28 21:53:45 CST Universal time: Tue 2009-04-28 13:53:45 UTC RTC time: Mon 2022-03-07 07:54:18 Time zone: Asia/Shanghai (CST, +0800) NTP enabled: no NTP synchronized: no RTC in local TZ: no DST active: n/a

四、ntp服务启动情况查看

//这里我们再查看下,ntpd进程没有,说明ntpd没有启动

[root@fp-web-112 linuxtime]# ps -ef | grep ntpd
root 42376 30287 0 22:16 pts/1 00:00:00 grep --color=auto ntpd

[root@fp-web-112 linuxtime]# systemctl status ntpd.service
● ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2009-04-28 19:33:04 CST; 2h 40min ago
Main PID: 1514 (code=exited, status=255)
//用ntpstat,可以查看ntp的运行情况,这里显示不能和ntp通讯,也意味着ntp后台没有启动
[root@fp-web-112 linuxtime]# ntpstat
Unable to talk to NTP daemon. Is it running?

五、ntp服务有两个服务
   1、ntpdate 配置, 查看ntpdate 服务的配置文件 ntp /etc/ntp.conf

[root@fp-web-112 linuxtime]# cat /etc/ntp.conf
# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
driftfile /var/lib/ntp/drift
logfile /var/log/ntpd.log ##开启log记录, tailf /var/log/ntpd.log 就可以查看最新的日志 # Permit time synchronization with our time source, but
do not # permit the source to query or modify the service on this system. restrict default nomodify notrap nopeer noquery # Permit all access over the loopback interface. This could # be tightened as well, but to do so would effect some of # the administrative functions. restrict 127.0.0.1 restrict ::1 # Hosts on local network are less restricted. #restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap # Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html). #server 0.centos.pool.ntp.org iburst #server 1.centos.pool.ntp.org iburst #server 2.centos.pool.ntp.org iburst #server 3.centos.pool.ntp.org iburst #broadcast 192.168.1.255 autokey # broadcast server #broadcastclient # broadcast client #broadcast 224.0.1.1 autokey # multicast server #multicastclient 224.0.1.1 # multicast client #manycastserver 239.255.254.254 # manycast server #manycastclient 239.255.254.254 autokey # manycast client # Enable public key cryptography. #crypto includefile /etc/ntp/crypto/pw # Key file containing the keys and key identifiers used when operating # with symmetric key cryptography. keys /etc/ntp/keys # Specify the key identifiers which are trusted. #trustedkey 4 8 42 # Specify the key identifier to use with the ntpdc utility. #requestkey 8 # Specify the key identifier to use with the ntpq utility. #controlkey 8 # Enable writing of statistics records. #statistics clockstats cryptostats loopstats peerstats # Disable the monitoring facility to prevent amplification attacks using ntpdc # monlist command when default restrict does not include the noquery flag. See # CVE-2013-5211 for more details. # Note: Monitoring will not be disabled with the limited restriction flag. disable monitor server 10.19.52.252
interface listen
10.19.52.252 ##监听

[root@fp-web-112 linuxtime]# sed /^$/d /etc/ntp.conf|grep -v '^#'
driftfile /var/lib/ntp/drift
logfile /var/log/ntpd.log
restrict default nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
disable monitor
server 10.129.51.250
interface listen 10.129.51.250

2、查看ntpd的配置文件/etc/sysconfig/ntpd

[root@fp-web-112 ~]# cat /etc/sysconfig/ntpd
# Command line options for ntpd
OPTIONS="-g"

 

 



六、
我们开始进行启动,修复的工作:

//以下全部为顺序执行
[root@fp-web-112 linuxtime]# systemctl restart  ntpd.service

[root@fp-web-112 ~]# netstat -anlp | grep 123
udp 0 0 127.0.0.1:123 0.0.0.0:* 52422/ntpd
udp 0 0 0.0.0.0:123 0.0.0.0:* 52422/ntpd
udp6 0 0 :::123 :::* 52422/ntpd

[root@fp-web-112 linuxtime]# ps -ef | grep ntpd
ntp       42688      1  0 22:24 ?        00:00:00 /usr/sbin/ntpd -u ntp:ntp -g
//我们在用timedatectl工具查看一下
[root@fp-web-112 linuxtime]# timedatectl
Local time: Tue 2009-04-28 22:24:36 CST
Universal time: Tue 2009-04-28 14:24:36 UTC
RTC time: Tue 2009-04-28 14:24:36
Time zone: Asia/Shanghai (CST, +0800)  //看到时区为上海
NTP enabled: no
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
或
[root@fp-web-112 linuxtime]# timedatectl status
Local time: Tue 2009-04-28 22:27:04 CST
Universal time: Tue 2009-04-28 14:27:04 UTC
RTC time: Tue 2009-04-28 14:27:04
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: no
NTP synchronized: yes
RTC in local TZ: no  //rtc硬件时间
DST active: n/a
//查看ntpstat并没有同步
[root@fp-web-112 linuxtime]# ntpstat
unsynchronised
polling server every 8 s
//上面看,NTP enabled 没有启动,我们就可以通过timedatectl set-ntp yes 启用它
[root@fp-web-112 linuxtime]# timedatectl set-ntp yes
//现在我们查看一下,ntp已启用,已同步
[root@fp-web-112 linuxtime]# timedatectl
Local time: Mon 2022-03-07 16:49:53 CST
Universal time: Mon 2022-03-07 08:49:53 UTC
RTC time: Tue 2009-04-28 14:32:47
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes      //timedatectl set-ntp yes/no
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
//查看同步状态,依然是
[root@fp-web-112 linuxtime]# ntpstat
Unable to talk to NTP daemon. Is it running?
 //查看同步情况
[root@fp-web-112 linuxtime]# ntpq -p
ntpq: read: Connection refused
//设置开机自启动
[root@fp-web-112 linuxtime]# chkconfig ntpd on  //centos7之后需要用systemctl启动
Note: Forwarding request to 'systemctl enable ntpd.service'.
[root@fp-web-112 linuxtime]# systemctl enable ntpd.service
//检查是否已启用
[root@fp-web-112 linuxtime]# systemctl is-enabled ntpd
enabled
[root@fp-web-112 linuxtime]# systemctl enable ntpdate
Created symlink from /etc/systemd/system/multi-user.target.wants/ntpdate.service to /usr/lib/systemd/system/ntpdate.service.
//重启服务
[root@fp-web-112 linuxtime]# systemctl restart ntpd.service
//查看
[root@fp-web-112 linuxtime]# netstat -unlnp | grep ntp
udp 0 0 127.0.0.1:123 0.0.0.0:* 45112/ntpd 
udp 0 0 0.0.0.0:123 0.0.0.0:* 45112/ntpd 
udp6 0 0 :::123 :::* 45112/ntpd
//继续查看同步时间服务器情况
[root@fp-web-112 linuxtime]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
fpvm-DNS01 LOCAL(0) 6 u 6 64 1 0.234 -992582 0.000
解释:
remote:即NTP主机的IP或主机名称。注意最左边的符号,如果由“+”则代表目前正在作用钟的上层NTP,如果是“*”则表示也有连上线,不过是作为次要联机的NTP主机。
refid:参考的上一层NTP主机的地址
st:即stratum阶层
when:几秒前曾做过时间同步更新的操作
poll:下次更新在几秒之后
reach:已经向上层NTP服务器要求更新的次数
delay:网络传输过程钟延迟的时间
offset:时间补偿的结果
jitter:Linux系统时间与BIOS硬件时间的差异时间
//显示同步的服务器ip
[root@fp-web-112 linuxtime]# ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
10.121.59.250 LOCAL(0) 6 u 51 64 3 0.270 -0.129 0.119
[root@fp-web-112 linuxtime]# ntpstat
unsynchronised
polling server every 8 s
//查看ntpd状态
[root@fp-web-112 linuxtime]# systemctl status ntpd
● ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2022-03-07 17:17:01 CST; 6min left
Process: 44234 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 44235 (ntpd)
Memory: 588.0K
CGroup: /system.slice/ntpd.service
└─44235 /usr/sbin/ntpd -u ntp:ntp -g

Mar 07 17:17:01 fp-web-112 ntpd[44235]: Listen normally on 4 ens224 10.129.80.44 UDP 123
Mar 07 17:17:01 fp-web-112 ntpd[44235]: Listen normally on 5 docker0 172.17.0.1 UDP 123
Mar 07 17:17:01 fp-web-112 ntpd[44235]: Listen normally on 6 tunl0 10.254.237.128 UDP 123
Mar 07 17:17:01 fp-web-112 ntpd[44235]: Listening on routing socket on fd #23 for interface updates
Mar 07 17:17:01 fp-web-112 ntpd[44235]: 0.0.0.0 c016 06 restart
Mar 07 17:17:01 fp-web-112 ntpd[44235]: 0.0.0.0 c012 02 freq_set kernel 8.130 PPM
Mar 07 17:17:01 fp-web-112 systemd[1]: Started Network Time Service.
Mar 07 17:20:17 fp-web-112 ntpd[44235]: 0.0.0.0 c61c 0c clock_step -992.582399 s
Mar 07 17:03:44 fp-web-112 ntpd[44235]: 0.0.0.0 c614 04 freq_mode
Mar 07 17:03:45 fp-web-112 ntpd[44235]: 0.0.0.0 c618 08 no_sys_peer
//查看ntp的时间
[root@fp-web-112 linuxtime]# ntptime
ntp_gettime() returns code 0 (OK)
time e5d04ac0.8a7242e0 Mon, Mar 7 2022 17:11:28.540, (.540806679),
maximum error 10016 us, estimated error 16 us, TAI offset 0
ntp_adjtime() returns code 0 (OK)
modes 0x0 (),
offset 0.000 us, frequency 8.130 ppm, interval 1 s,
maximum error 10016 us, estimated error 16 us,
status 0x2001 (PLL,NANO),
time constant 3, precision 0.001 us, tolerance 500 ppm,
//等我们最后查看时候发现
[root@fp-web-112 linuxtime]# systemctl status ntpd
● ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2022-03-07 17:17:58 CST; 6min ago
Main PID: 45112 (ntpd)
CGroup: /system.slice/ntpd.service
└─45112 /usr/sbin/ntpd -u ntp:ntp -g

Mar 07 17:17:58 fp-web-112 systemd[1]: Starting Network Time Service...
Mar 07 17:17:58 fp-web-112 systemd[1]: Started Network Time Service.
Mar 07 17:17:58 fp-web-112 ntpd[45112]: proto: precision = 0.046 usec
Mar 07 17:17:58 fp-web-112 ntpd[45112]: 0.0.0.0 c01d 0d kern kernel time sync enabled

//尝试同步下我们自己的时间服务器

[root@fp-web-112 linuxtime]# ntpdate -u 10.121.50.201
7 Mar 17:30:55 ntpdate[45718]: adjust time server 10.129.51.250 offset -0.002393 sec

//查看下同步情况

[root@fp-web-112 linuxtime]# ntpdate -d 10.129.51.250
7 Mar 17:38:15 ntpdate[46041]: ntpdate 4.2.6p5@1.2349-o Wed Apr 12 21:24:06 UTC 2017 (1)
Looking for host 10.129.51.250 and service ntp
host found : fpvm-DNS01
transmit(10.129.51.250)
receive(10.129.51.250)
transmit(10.129.51.250)
receive(10.129.51.250)
transmit(10.129.51.250)
receive(10.129.51.250)
transmit(10.129.51.250)
receive(10.129.51.250)
server 10.129.51.250, port 123
stratum 6, precision -24, leap 00, trust 000
refid [10.129.51.250], delay 0.02586, dispersion 0.00000
transmitted 4, in filter 4
reference time: e5d05104.50185f0b Mon, Mar 7 2022 17:38:12.312
originate timestamp: e5d0510d.3415781f Mon, Mar 7 2022 17:38:21.203
transmit timestamp: e5d0510d.33ee1f57 Mon, Mar 7 2022 17:38:21.202
filter delay: 0.02588 0.02588 0.02586 0.02591 
0.00000 0.00000 0.00000 0.00000 
filter offset: 0.000444 0.000425 0.000435 0.000403
0.000000 0.000000 0.000000 0.000000
delay 0.02586, dispersion 0.00000
offset 0.000435

7 Mar 17:38:21 ntpdate[46041]: adjust time server 10.129.51.250 offset 0.000435 sec

[root@fp-web-112 ~]# ntpq -p 10.129.51.250
remote refid st t when poll reach delay offset jitter
==============================================================================
*LOCAL(0) .LOCL. 5 l 45 64 377 0.000 0.000 0.000
 

[root@fp-web-112 ~]# /usr/sbin/ntpq -n -c peers
remote refid st t when poll reach delay offset jitter
==============================================================================
10.129.51.250 .INIT. 16 - - 1024 0 0.000 0.000 0.000

回过头来看下chronyd这个服务,关闭该服务:

[root@fp-web-112 ~]# systemctl is-enabled chronyd
enabled

[root@fp-web-112 ~]# systemctl disable chronyd
Removed symlink /etc/systemd/system/multi-user.target.wants/chronyd.service.

 

//防火墙也并没有启用

[root@fp-web-112 ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)

//如果出现stratum=16

[root@fp-web-112 ~]# ntpq -c rv | grep stratum
stratum=16, precision=-24, rootdelay=0.000, rootdisp=3.435, refid=INIT,

A stratum level of 16 indicates that NTP is not synchronizing correctly.If a stratum level of 16 is detected, 
wait 15 minutes and issue the command again. It may take this long for the NTP server to stabilize.
If NTP continues to detect a stratum level of 16, verify that the NTP port (UDP Port 123) is open on all firewalls 
between the cluster and the remote machine you are attempting to synchronize to.


[root@fp
-web-112 linuxtime]# ntpstat unsynchronised polling server every 8 s //这种情况出现后,我开了两个窗口进行抓包测试

//向ntpdate执行请求

[root@k3master ~]# ntpdate -u 10.129.51.250
7 Mar 20:41:54 ntpdate[53489]: step time server 10.129.51.250 offset -992.615309 sec

//tcp抓包端一直开着,利用ntpdate发起的时候是没有问题的,是可以进行时间上同步。

[root@fp-web-112 ~]# tcpdump -i ens192 host 10.129.51.250
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on ens192, link-type EN10MB (Ethernet), capture size 65535 bytes
20:58:21.413357 IP k3master.5691 > fpvm-DNS01.ntp: NTPv4, Client, length 48
20:58:21.413654 IP fpvm-DNS01.ntp > k3master.5691: NTPv4, Server, length 48
20:58:21.413727 IP k3master.5552 > fpvm-DNS01.domain: 63507+ PTR? 250.51.129.10.in-addr.arpa. (44)
20:58:21.413879 IP fpvm-DNS01.domain > k3master.5552: 63507* 1/0/0 PTR fpvm-DNS01. (68)
20:58:23.413323 IP k3master.5691 > fpvm-DNS01.ntp: NTPv4, Client, length 48
20:58:23.413574 IP fpvm-DNS01.ntp > k3master.5691: NTPv4, Server, length 48
20:58:25.413331 IP k3master.5691 > fpvm-DNS01.ntp: NTPv4, Client, length 48
20:58:25.413632 IP fpvm-DNS01.ntp > k3master.5691: NTPv4, Server, length 48
20:58:27.413321 IP k3master.5691 > fpvm-DNS01.ntp: NTPv4, Client, length 48
20:58:27.413650 IP fpvm-DNS01.ntp > k3master.5691: NTPv4, Server, length 48

 

//用查看同步情况,发送数据都是0,这个说明还是有问题。

[root@k3master ~]# watch ntpq -p

//用ntpdate -d ip 方式来检测,-d进行debug模式,整个过程。

[root@k3master ~]# ntpdate -d 10.129.51.250
7 Mar 21:16:54 ntpdate[54968]: ntpdate 4.2.6p5@1.2349-o Wed Apr 12 21:24:06 UTC 2017 (1)
Looking for host 10.129.51.250 and service ntp
host found : fpvm-DNS01
transmit(10.129.51.250)
receive(10.129.51.250)
transmit(10.129.51.250)
receive(10.129.51.250)
transmit(10.129.51.250)
receive(10.129.51.250)
transmit(10.129.51.250)
receive(10.129.51.250)
server 10.129.51.250, port 123
stratum 6, precision -24, leap 00, trust 000  //这里注意stratum=6
refid [10.129.51.250], delay 0.02586, dispersion 0.00002
transmitted 4, in filter 4
reference time: e5d08438.50f941d0 Mon, Mar 7 2022 21:16:40.316
originate timestamp: e5d0844c.4afdd615 Mon, Mar 7 2022 21:17:00.292
transmit timestamp: e5d0844c.4be3b9c9 Mon, Mar 7 2022 21:17:00.296
filter delay: 0.02586 0.02591 0.02599 0.02591
0.00000 0.00000 0.00000 0.00000
filter offset: -0.00365 -0.00368 -0.00370 -0.00370
0.000000 0.000000 0.000000 0.000000
delay 0.02586, dispersion 0.00002
offset -0.003656

7 Mar 21:17:00 ntpdate[54968]: adjust time server 10.129.51.250 offset -0.003656 sec

//看下这里 stratum=16的 ? 

[root@k3master ~]# ntpq -c rv | grep stratum
stratum=16, precision=-24, rootdelay=0.000, rootdisp=3.225, refid=INIT,

这种情况属于正常,ntp服务器配置完毕后,需要等待5-10分钟才能与/etc/ntp.conf中配置的标准时间进行同步



注意:centos系统默认是开启ntp时间同步的

在修改NTP或chrony的时间设置之后不会立即生效,需要重启timedatectl服务。
[root@fp-web-112 linuxtime]# systemctl restart systemd-timedated.service

 总结解决问题关键步骤为:

systemctl restart  ntpd.service
timedatectl set-ntp yes
chkconfig ntpd on
systemctl restart ntpd.service

1、修改当前时间
timedatectl set-time HH:MM:SS
这个命令同时更新系统时间和硬件时钟,结果类似于date --set 和 hwclock --systohc 命令。

2、开启NTP时间同步是不能用这个命令来设置时间,这一点需要注意一下。

[root@fp-web-112 linuxtime]# timedatectl set-time 13:00:27
Failed to set time: Automatic time synchronization is enabled
[root@fp-web-112 linuxtime]# timedatectl set-ntp no
[root@fp-web-112 linuxtime]# timedatectl set-time 13:00:27
[root@fp-web-112 linuxtime]# timedatectl 

 

3、系统默认的时间设置使用的UTC,设置系统时间使用本地时间。

[root@fp-web-112 linuxtime]# timedatectl set-local-rtc boolea
    boolean值为:yes (或者y, true, t, 1)。
   当boolean值为no时使用的是UTC时间,此时的值为:no(或者n, false, f, 0),默认值为no。
[root@fp-web-112 linuxtime]# timedatectl set-local-rtc no
 如果设置为yes的话可能会有警告,此处不建议修改为yes。

 
4、修改或设置时区。

列举出所有可用的时区,键入以下命令即可。当然也可以输入tzselect根据引导进行设置(推荐)。

[root@fp-web-112 linuxtime]# timedatectl list-timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
Africa/Brazzaville
Africa/Bujumbura
Africa/Cairo
Africa/Casablanca
Africa/Ceuta
Africa/Conakry
Africa/Dakar
Africa/Dar_es_Salaam
Africa/Djibouti
Africa/Douala
Africa/El_Aaiun
Africa/Freetown
Africa/Gaborone
Africa/Harare
Africa/Johannesburg

lines 1-25

 

在root用户下键入以下命令来修改当前使用的区时。例如我们将区时改为香港。

[root@Geeklp-Administrator ~]# timedatectl set-timezone Asia/Hong_Kong

[root@fp-web-112 linuxtime]# timedatectl 
      Local time: Tue 2009-04-28 21:57:24 CST
  Universal time: Tue 2009-04-28 13:57:24 UTC
        RTC time: Mon 2022-03-07 07:57:57
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

 

(3)如果使用远程的NTP时间服务器来提供时间的话,需要使用timedatectl设置将NTP时间同步开启。

[root@fp-web-112 linuxtime]# timedatectl set-ntp yes
[root@fp-web-112 linuxtime]# timedatectl

 

posted @ 2022-03-07 16:27  jinzi  阅读(273)  评论(0编辑  收藏  举报