[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: man:chronyd(8) man:chrony.conf(5) 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: man:chronyd(8) man:chrony.conf(5) 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 time: 日 2020-02-23 12:23:39 CST Universal time: 日 2020-02-23 04:23:39 UTC RTC time: 日 2020-02-23 04:23:39 Time zone: Asia/Shanghai (CST, +0800) NTP enabled: no NTP synchronized: no RTC in local TZ: no DST active: n/a [root@rhel7.9 ~]# timedatectl set-ntp true [root@rhel7.9 ~]# timedatectl status Local time: 日 2020-02-23 12:24:14 CST Universal time: 日 2020-02-23 04:24:14 UTC RTC time: 日 2020-02-23 04:24:14 Time zone: Asia/Shanghai (CST, +0800) NTP enabled: yes NTP synchronized: no RTC in local TZ: no DST active: n/a [root@rhel7.9 ~]# systemctl start chronyd [root@rhel7.9 ~]# timedatectl status Local time: 四 2021-04-15 15:48:52 CST Universal time: 四 2021-04-15 07:48:52 UTC RTC time: 日 2020-02-23 04:24:44 Time zone: Asia/Shanghai (CST, +0800) NTP enabled: yes NTP synchronized: yes RTC in local TZ: no DST active: n/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: man:chronyd(8) man:chrony.conf(5) 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: man:chronyd(8) man:chrony.conf(5) 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: 1 CGroup: /system.slice/chronyd.service └─16105 /usr/sbin/chronyd 2月 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到此这篇chrony服务端口信息(chrony服务器)的文章就 介绍到这了,更多相关内容请继续浏览下面的相关 推荐文章,希望大家都能在编程的领域有一番成就!
版权声明:
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若内容造成侵权、违法违规、事实不符,请将相关资料发送至xkadmin@xkablog.com进行投诉反馈,一经查实,立即处理!
转载请注明出处,原文链接:https://www.xkablog.com/hd-yjs/30440.html