首先确保有一台时钟服务器安装了NTP Server,后续直接修改配置即可
1.
查看并记录当前系统时间
date
2. 启动
ubuntu
自带的时间同步服务
sudo timedatectl set-ntp true
3. 修改NTP的相关配置
打开文件
/etc/systemd/timesyncd.conf
。
vi /etc/systemd/timesyncd.conf
修改配置文件
NTP= 时钟同步的服务器地址,其他一样即可
4. 重启服务
systemctl restart systemd-timesyncd
5. 查看NTP同步状态
timedatectl show-timesync
6. 输入命令查看时间,是否同步成功
date