OracleLinux NTP时间服务器配置同步方案目标环境,Oracle linux6,作为内网的NTP时间服务器,局域网内的其他机器与这台服务做时间同步。
2、安装配置
Oracle linux6系统已经自带了NTPD服务,一般默认是安装了的,如果没有安装,先检查下,然后配置好yum仓库,yum方式安装下就OK,具体如下:
# rpm -q ntp
ntp-4.2.4p8-2.el6.x86_64 // 这表示已安装了,如果没有安装,这是空白。
如果没有安装,我们按照下
# yum install ntp
......
按上面的安装方式在内网每台服务器上都安装好NTP软件包。
完成后,都需要配置NTP服务为自启动
# chkconfig ntpd on
# chkconfig --list ntpd
ntpd 0:关闭1:关闭2:启用3:启用4:启用5:启用6:关闭
在配置前,先使用ntpdate手动同步下时间,免得本机与外部时间服务器时间差距太大,让ntpd不能正常同步。
# ntpdate -u 202.112.10.36
22 Dec 16:52:38 ntpdate[6400]: adjust time server 202.112.10.36 offset 0.012135 sec
配置内网NTP-Server
下面主要是配置内网的NPTD服务器, NTPD服务配置核心就在/etc/ntp.conf文件,配置好了就OK。先上配置文件再说,红色部分是修改部分,注意红色修改部分。
# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
driftfile /var/lib/ntp/drift
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
# Permit all access over the loopback interface. This could