ntp 时间同步服务器

1、yum install -y ntp

2、修改配置文件 /etc/ntp.conf

如果能够连通外网的情况

把配置文件下面四行注释掉:
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst

然后在下面添加这几行:
server 0.cn.pool.ntp.org iburst
server 1.cn.pool.ntp.org iburst
server 2.cn.pool.ntp.org iburst
server 3.cn.pool.ntp.org iburst

如果不能,连通外网的情况

#配置允许NTP Server时间服务器主动修改本机的时间
restrict 10.2.96.200 nomodify notrap noquery
#注释掉其他时间服务器
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
#配置时间服务器为本地搭建的NTP Server服务器
server 10.2.96.200

3、启动服务

# centos7
systemctl start ntpd
systemctl enable ntpd
# centos6
service ntpd start
chkconfig ntpd on

4、测试服务,查看同步服务

ntpq -p


5、客户端配置/etc/ntp.conf

driftfile /var/lib/ntp/drift
restrict default nomodify notrap nopeer noquery
restrict 127.0.0.1 
restrict ::1
restrict 10.188.31.168 nomodify notrap noquery
server 10.188.31.168
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
disable monitor
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
Windows Server 配置 NTP 时间同步服务器的过程如下: 1. 打开服务器管理器,点击 "工具",选择 "服务",找到 "Windows 时间" 服务,确保该服务正在运行。 2. 在 "服务器管理器" 左侧面板中,选择 "角色",然后选择 "添加角色"。 3. 在出现的 "添加角色向导" 对话框中,选择 "下一步"。 4. 在 "选择服务器角色" 页面上,选择 "基于角色或基于功能的安装",然后点击 "下一步"。 5. 在 "选择服务器" 页面上,选择要为其配置 NTP 时间同步服务器服务器,点击 "下一步"。 6. 在 "选择角色服务" 页面上,找到并勾选 "网络时间协议 (NTP) 客户端",点击 "下一步"。 7. 在 "网络时间协议 (NTP) 客户端" 页面上,点击 "下一步"。 8. 在 "添加角色服务" 页面上,点击 "下一步"。 9. 在 "确认安装选择" 页面上,点击 "安装"。 10. 完成安装后,返回 "服务器管理器",点击 "工具",选择 "服务"。 11. 找到 "Windows 时间" 服务,右键点击,选择 "属性"。 12. 在 "Windows 时间 (W32Time) 属性" 对话框中,选择 "配置"。 13. 在 "配置来源" 项目中,选择 "本地计算机"。 14. 在 "本地时钟" 项目中,选择 "NoSync"。 15. 在 "时钟调整因子" 项目中,选择 "明确的调整因子"。 16. 在 "参考时间源" 项目中,选择 "手动源"。 17. 在 "NTP 服务器" 项目中,输入要作为时间同步服务器NTP 服务器的 IP 地址或域名。 18. 点击 "确定",然后关闭 "属性" 对话框。 经过以上步骤,便成功配置了 Windows ServerNTP 时间同步服务器服务器将会按照所配置的 NTP 服务器的时间进行时间同步
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

运维螺丝钉

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值