[root@rhel7.9 ~]# timedatectl set-time “2020-02-23 12:23:01” <<========设置系统时间,因为开启了时间同步所以报错 Failed to set time: Automatic time synchronization is enabled[root@rhel7.9 ~]# systemctl stop chronyd [root@rhel7.9 ~]# timedatectl set-time “2020-02-23 12:23:01” <<==========stop chronyd 后修改系统时间,报错依旧 Failed to set time: Automatic time synchronization is enabled[root@rhel7.9 ~]# systemctl status chronyd ● chronyd.service - NTP client/server Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled) Active: inactive (dead) since 四 2021-04-15 15:45:37 CST; 21s ago讯享网Docs: </span><span style="color: rgba(0, 0, 255, 1)">man</span>:chronyd(<span style="color: rgba(128, 0, 128, 1)">8</span><span style="color: rgba(0, 0, 0, 1)">) </span><span style="color: rgba(0, 0, 255, 1)">man</span>:chrony.conf(<span style="color: rgba(128, 0, 128, 1)">5</span><span style="color: rgba(0, 0, 0, 1)">)Process: 13722 ExecStartPost=/usr/libexec/chrony-helper update-daemon (code=exited, status=0/SUCCESS) Process: 13716 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS) Main PID: 13720 (code=exited, status=0/SUCCESS)4月 15 15:40:54 rhel7.9 systemd[1]: Starting NTP client/server… 4月 15 15:40:54 rhel7.9 chronyd[13720]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG) 4月 15 15:40:54 rhel7.9 chronyd[13720]: Frequency 8.664 +/- 0.118 ppm read from /var/lib/chrony/drift 4月 15 15:40:54 rhel7.9 systemd[1]: Started NTP client/server. 4月 15 15:41:02 rhel7.9 chronyd[13720]: Selected source 119.28.206.193 4月 15 15:43:16 rhel7.9 chronyd[13720]: Source 124.108.20.1 replaced with 84.16.67.12 4月 15 15:45:37 rhel7.9 systemd[1]: Stopping NTP client/server… 4月 15 15:45:37 rhel7.9 chronyd[13720]: chronyd exiting 4月 15 15:45:37 rhel7.9 systemd[1]: Stopped NTP client/server.[root@rhel7.9 ~]# date 2021年 04月 15日 星期四 15:46:13 CST [root@rhel7.9 ~]# timedatectl set-ntp false [root@rhel7.9 ~]# timedatectl set-time “2020-02-23 12:23:01” [root@rhel7.9 ~]# systemctl status chronyd ● chronyd.service - NTP client/server Loaded: loaded (/usr/lib/systemd/system/chronyd.service; disabled; vendor preset: enabled) Active: inactive (dead)Docs: </span><span style="color: rgba(0, 0, 255, 1)">man</span>:chronyd(<span style="color: rgba(128, 0, 128, 1)">8</span><span style="color: rgba(0, 0, 0, 1)">) </span><span style="color: rgba(0, 0, 255, 1)">man</span>:chrony.conf(<span style="color: rgba(128, 0, 128, 1)">5</span><span style="color: rgba(0, 0, 0, 1)">)4月 15 15:40:34 rhel7.9 systemd[1]: Stopped NTP client/server. 4月 15 15:40:54 rhel7.9 systemd[1]: Starting NTP client/server… 4月 15 15:40:54 rhel7.9 chronyd[13720]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG) 4月 15 15:40:54 rhel7.9 chronyd[13720]: Frequency 8.664 +/- 0.118 ppm read from /var/lib/chrony/drift 4月 15 15:40:54 rhel7.9 systemd[1]: Started NTP client/server. 4月 15 15:41:02 rhel7.9 chronyd[13720]: Selected source 119.28.206.193 4月 15 15:43:16 rhel7.9 chronyd[13720]: Source 124.108.20.1 replaced with 84.16.67.12 4月 15 15:45:37 rhel7.9 systemd[1]: Stopping NTP client/server… 4月 15 15:45:37 rhel7.9 chronyd[13720]: chronyd exiting 4月 15 15:45:37 rhel7.9 systemd[1]: Stopped NTP client/server. [root@rhel7.9 ~]# timedatectl status <<============ 显示当前系统和RTC设置讯享网Local </span><span style="color: rgba(0, 0, 255, 1)">time</span>: 日 <span style="color: rgba(128, 0, 128, 1)">2020</span>-<span style="color: rgba(128, 0, 128, 1)">02</span>-<span style="color: rgba(128, 0, 128, 1)">23</span> <span style="color: rgba(128, 0, 128, 1)">12</span>:<span style="color: rgba(128, 0, 128, 1)">23</span>:<span style="color: rgba(128, 0, 128, 1)">39</span><span style="color: rgba(0, 0, 0, 1)"> CSTUniversal time: 日 2020-02-23 04:23:39 UTCRTC </span><span style="color: rgba(0, 0, 255, 1)">time</span>: 日 <span style="color: rgba(128, 0, 128, 1)">2020</span>-<span style="color: rgba(128, 0, 128, 1)">02</span>-<span style="color: rgba(128, 0, 128, 1)">23</span> <span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">23</span>:<span style="color: rgba(128, 0, 128, 1)">39</span><span style="color: rgba(0, 0, 0, 1)"> Time zone: Asia</span>/Shanghai (CST, +<span style="color: rgba(128, 0, 128, 1)">0800</span><span style="color: rgba(0, 0, 0, 1)">) NTP enabled: noNTP synchronized: no RTC in local TZ: no讯享网DST active: n</span>/<span style="color: rgba(0, 0, 0, 1)">a[root@rhel7.9 ~]# timedatectl set-ntp true [root@rhel7.9 ~]# timedatectl status
讯享网Local </span><span style="color: rgba(0, 0, 255, 1)">time</span>: 日 <span style="color: rgba(128, 0, 128, 1)">2020</span>-<span style="color: rgba(128, 0, 128, 1)">02</span>-<span style="color: rgba(128, 0, 128, 1)">23</span> <span style="color: rgba(128, 0, 128, 1)">12</span>:<span style="color: rgba(128, 0, 128, 1)">24</span>:<span style="color: rgba(128, 0, 128, 1)">14</span><span style="color: rgba(0, 0, 0, 1)"> CSTUniversal time: 日 2020-02-23 04:24:14 UTC讯享网RTC </span><span style="color: rgba(0, 0, 255, 1)">time</span>: 日 <span style="color: rgba(128, 0, 128, 1)">2020</span>-<span style="color: rgba(128, 0, 128, 1)">02</span>-<span style="color: rgba(128, 0, 128, 1)">23</span> <span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">24</span>:<span style="color: rgba(128, 0, 128, 1)">14</span><span style="color: rgba(0, 0, 0, 1)"> Time zone: Asia</span>/Shanghai (CST, +<span style="color: rgba(128, 0, 128, 1)">0800</span><span style="color: rgba(0, 0, 0, 1)">) NTP enabled: yesNTP synchronized: no RTC in local TZ: noDST active: n</span>/<span style="color: rgba(0, 0, 0, 1)">a[root@rhel7.9 ~]# systemctl start chronyd [root@rhel7.9 ~]# timedatectl status讯享网Local </span><span style="color: rgba(0, 0, 255, 1)">time</span>: 四 <span style="color: rgba(128, 0, 128, 1)">2021</span>-<span style="color: rgba(128, 0, 128, 1)">04</span>-<span style="color: rgba(128, 0, 128, 1)">15</span> <span style="color: rgba(128, 0, 128, 1)">15</span>:<span style="color: rgba(128, 0, 128, 1)">48</span>:<span style="color: rgba(128, 0, 128, 1)">52</span><span style="color: rgba(0, 0, 0, 1)"> CSTUniversal time: 四 2021-04-15 07:48:52 UTCRTC </span><span style="color: rgba(0, 0, 255, 1)">time</span>: 日 <span style="color: rgba(128, 0, 128, 1)">2020</span>-<span style="color: rgba(128, 0, 128, 1)">02</span>-<span style="color: rgba(128, 0, 128, 1)">23</span> <span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">24</span>:<span style="color: rgba(128, 0, 128, 1)">44</span><span style="color: rgba(0, 0, 0, 1)"> Time zone: Asia</span>/Shanghai (CST, +<span style="color: rgba(128, 0, 128, 1)">0800</span><span style="color: rgba(0, 0, 0, 1)">) NTP enabled: yesNTP synchronized: yes RTC in local TZ: no讯享网DST active: n</span>/<span style="color: rgba(0, 0, 0, 1)">a[root@rhel7.9 ~]# timedatectl set-time “2020-02-23 12:23:01” Failed to set time: Automatic time synchronization is enabled [root@rhel7.9 ~]# timedatectl set-ntp false <<============= 禁用基于NTP的网络时间同步
[root@rhel7.9 ~]# systemctl status chronyd ● chronyd.service - NTP client/server Loaded: loaded (/usr/lib/systemd/system/chronyd.service; disabled; vendor preset: enabled) Active: inactive (dead)Docs: </span><span style="color: rgba(0, 0, 255, 1)">man</span>:chronyd(<span style="color: rgba(128, 0, 128, 1)">8</span><span style="color: rgba(0, 0, 0, 1)">) </span><span style="color: rgba(0, 0, 255, 1)">man</span>:chrony.conf(<span style="color: rgba(128, 0, 128, 1)">5</span><span style="color: rgba(0, 0, 0, 1)">)2月 23 12:24:12 rhel7.9 systemd[1]: Starting NTP client/server… 2月 23 12:24:12 rhel7.9 chronyd[15212]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG) 2月 23 12:24:12 rhel7.9 chronyd[15212]: Frequency 8.646 +/- 0.520 ppm read from /var/lib/chrony/drift 2月 23 12:24:12 rhel7.9 systemd[1]: Started NTP client/server. 2月 23 12:24:18 rhel7.9 chronyd[15212]: Selected source 84.16.67.12 2月 23 12:24:18 rhel7.9 chronyd[15212]: System clock wrong by . seconds, adjustment started 4月 15 15:48:26 rhel7.9 chronyd[15212]: System clock was stepped by . seconds 4月 15 15:51:05 rhel7.9 chronyd[15212]: chronyd exiting 4月 15 15:51:05 rhel7.9 systemd[1]: Stopping NTP client/server… 4月 15 15:51:05 rhel7.9 systemd[1]: Stopped NTP client/server. [root@rhel7.9 ~]# timedatectl set-time “2020-02-23 12:23:01” <<=========== 再次设置时间成功 [root@rhel7.9 ~]# timedatectl set-ntp true <<============ 启用基于NTP的网络时间同步 [root@rhel7.9 ~]# systemctl status chronyd
● chronyd.service - NTP client/server Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled) Active: active (running) since 日 2020-02-23 12:23:25 CST; 4s ago讯享网Docs: </span><span style="color: rgba(0, 0, 255, 1)">man</span>:chronyd(<span style="color: rgba(128, 0, 128, 1)">8</span><span style="color: rgba(0, 0, 0, 1)">) </span><span style="color: rgba(0, 0, 255, 1)">man</span>:chrony.conf(<span style="color: rgba(128, 0, 128, 1)">5</span><span style="color: rgba(0, 0, 0, 1)">)Process: 16110 ExecStartPost=/usr/libexec/chrony-helper update-daemon (code=exited, status=0/SUCCESS) Process: 16103 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS) Main PID: 16105 (chronyd)Tasks: </span><span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)">CGroup: /system.slice/chronyd.service讯享网└─</span><span style="color: rgba(128, 0, 128, 1)">16105</span> /usr/sbin/<span style="color: rgba(0, 0, 0, 1)">chronyd2月 23 12:23:25 rhel7.9 systemd[1]: Starting NTP client/server… 2月 23 12:23:25 rhel7.9 chronyd[16105]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG) 2月 23 12:23:25 rhel7.9 chronyd[16105]: Frequency 8.645 +/- 0.714 ppm read from /var/lib/chrony/drift 2月 23 12:23:25 rhel7.9 systemd[1]: Started NTP client/server. [root@rhel7.9 ~]# date 2021年 04月 15日 星期四 15:52:14 CST
讯享网

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/155718.html