首页 > 其他 > 详细

NTP服务器的搭建和时间同步

时间:2020-03-27 11:30:54      阅读:78      评论:0      收藏:0      [点我收藏+]
一、NTP服务器
1.安装NTP服务

yum install -y ntp

2.修改ntp的配置文件
[root@localhost ~]# grep -Ev "^#|^$" /etc/ntp.conf
driftfile /var/lib/ntp/drift
pidfile /var/run/ntpd.pid
logfile /var/log/ntp.log
restrict -4 default kod notrap nomodify
restrict -6 default kod notrap nomodify
restrict 127.0.0.1
restrict ::1
server ntp.aliyun.com iburst minpoll 4 maxpoll 10
restrict ntp.aliyun.com nomodify notrap nopeer noquery
server 127.127.1.0
fudge 127.127.1.0 stratum 8
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
disable monitor
3.重启服务

systemctl start ntpd.service

systemctl enable ntpd.service

4.查看状态
[root@localhost ~]# ntpstat
synchronised to NTP server (203.107.6.88) at stratum 3
time correct to within 46 ms
polling server every 1024 s
[root@localhost ~]#
二、Linux客户端配置
1.安装ntp客户端,先手动同步

/usr/sbin/ntpdate -u 10.2.2.188

yum install -y ntpdate

2.写入定时计划

echo "0 5 * /usr/sbin/ntpdate -u 10.2.2.188" >> /var/spool/cron/root

echo "5 5 * /usr/sbin/hwclock -w" >> /var/spool/cron/root

三、window2012客户端配置(若有域环境直接修改与控制器即可)
1.打开powershell终端管理,输入gpedit.msc,打开策略管理器
技术分享图片
技术分享图片

2.计算机配置-->管理模板-->系统-->Windows时间服务-->时间提供程序,配置(windows客户端和启动客户端)
技术分享图片
技术分享图片
技术分享图片
技术分享图片

3.跟新策略
gpupdate /force
技术交流欢迎加入Q群:177428068

NTP服务器的搭建和时间同步

原文:https://blog.51cto.com/14483703/2482330

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!