ubuntu 时间同步- systemd-timesyncd配置

 

姊妹篇:ubuntu 时间同步-安装ntp服务器

 

修改配置

root@HP:~# vi /etc/systemd/timesyncd.conf
[Time]
NTP=ntp.ntsc.ac.cn cn.ntp.org.cn     ##只设置NTP这行,其它的不必,增加2个NTP服务器,中间用空格隔开
----------------------------------

 

重启systemd-timesyncd服务生效


----------------------------------
root@HP:~# systemctl restart systemd-timesyncd.service
----------------------------------

再次查看服务状态

----------------------------------

root@HP:~# systemctl status systemd-timesyncd.service
● systemd-timesyncd.service - Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset
Active: active (running) since Tue 2020-05-05 21:56:35 CST; 3s ago
Docs: man:systemd-timesyncd.service(8)
Main PID: 1578 (systemd-timesyn)
Status: "Synchronized to time server 114.118.7.161:123 (ntp.ntsc.ac.cn)."      ##这里已经更改成功
Tasks: 2 (limit: 4915)
CGroup: /system.slice/systemd-timesyncd.service
└─1578 /lib/systemd/systemd-timesyncd

posted @ 2022-02-12 19:24  张志伟122  阅读(1728)  评论(0编辑  收藏  举报