时间服务作业
1.通过自定义时间服务器向指定的客户端主机同步时间
要求:自定义时间服务器主机的时间通过ntp.aliyun.com主机同步时间
客户端环境要求:访问外网 --- nat
确保可以访问外网
(1).修改错误时间,用于后面与阿里云时间同步
[root@localhost ~]# vim /etc/chrony.conf
[root@localhost ~]# date 121210102030
Thu Dec 12 10:10:00 AM EST 2030
(2).修改配置文件
vim /etc/chrony.conf
pool 时间服务器主机的ip或者域名 ibusrt
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (https://www.pool.ntp.org/join.html).
#pool 2.rhel.pool.ntp.org iburst
pool ntp.aliyun.com iburst
(3).查看是否运行
[root@localhost ~]# ps -aux | grep chrony
chrony 912 0.0 0.2 84856 3876 ? S 09:55 0:00 /usr/sbin/chronyd -F 2
root 3038 0.0 0.1 221796 2432 pts/1 R+ 10:11 0:00 grep --color=auto chron
(4).启动软件读取配置(发起时间同步请求)
systemctl restart chronyd
[root@localhost ~]# systemctl restart chronyd
(5).查看时间是否同步
[root@localhost ~]# date
Wed Oct 22 05:39:20 AM EDT 2025
与前面错误时间对比显然与阿里云同步了。