1.8 计算 .org normal ria fault 默认 family rpm
1. NTP 简介
NTP(Network Time Protocol,网络时间协议)是用来使网络中的各个计算机时间同步的一种协议.它的用途是把计算机的时钟同步到世界协调时 UTC,其精度在局域网内可达 0.1ms,在互联网上绝大多数的地方其精度可以达到 1-50ms.
NTP 服务器就是利用 NTP 协议提供时间同步服务的.
2. NTP 服务器安装
3. 配置 NTP 服务
# 系统自带ntp[root@Mikey ~]# rpm -qa ntpntp-4.2.6p5-5.el6.centos.x86_64
# 如果没有就安装yum -y install ntp
4. 启动 NTP 服务器
[root@Mikey ~]#
# restrict default kod nomodify notrap nopeer noquery
restrictdefault nomodify
# nomodify客户端可以同步# 将默认时间同步源注释改用可用源
# 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 iburstserver
5. 客户机时间同步
# 如果计划任务有时间同步,先注释,两种用法会冲突.
[root@Mikey ~]# crontab -e
# time sync by oldboy at 2018-1-9
#*/5 * * * * /usr/sbin/ntpdate time.nist.gov >/dev/null 2>&1
[root@Mikey ~]#/etc/init.d/ntpd startStarting ntpd: [ OK ]
[root@Mikey ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*ntp1.aliyun.com 10.137.38.86 2 u 22 64 1 525.885 -42.367 0.000
[root@Mikey ~]# ntpdate 10.0.0.97Dec18:43:07 ntpdate[26950]: the NTP socket isinuse, exiting
客户机要等几分钟再与新启动的 ntp 服务器进行时间同步,否则会提示
no server suitable for synchronization found
错误.
NTP 服务部署
[root@Mikey ~]# ntpdate 10.0.0.9
7Dec18:40:16 ntpdate[1453]: step time server 10.0.0.9 offset 40.880807 sec
# 将命令放入计划任务即可.
来源: http://www.bubuko.com/infodetail-2455676.html