首页 运维 网络学院 查看内容

CentOS中时间同步方法

2011-6-13 11:10 513 0

摘要:   在CentOS 5不再区分客户端和服务器,只要配置了NTP,它就会提供NTP服务。  1)确认已经ntp程序包:  # yum install ntp  2)配置时间源  # vi /etc/nt...
关键词: 时间 NTP 服务 配置 ntpd server service pool sysconfig etc

  在CentOS 5不再区分客户端和服务器,只要配置了NTP,它就会提供NTP服务。  1)确认已经ntp程序包:  # yum install ntp  2)配置时间源  # vi /etc/ntp.conf  server pool.ntp.org   #可选择其他优先服务器  server 0.pool.ntp.org  server 1.pool.ntp.org  server 2.pool.ntp.org  3)配置是否为其他PC提供时间服务  # vi /etc/ntp.conf  restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap  4)配置开机时自动运行时间服务  # chkconfig ntpd on  5)启动或停止时间服务  # service ntpd start  # service ntpd stop  # service ntpd restart  6)验证ntp服务已经运行  # pgrep ntpd  7)初始同步  # ntpdate -u time.lib.tsinghua.edu.cn  8)确认同步成功  # ntpq -p  9)同时建议修改一下 /etc/sysconfig/ntpd 文件  # vi /etc/sysconfig/ntpd  SYNC_HWCLOCK=yes  # 改成 yes 吧!这样主机 BIOS 的时间也会跟着一起改变的 !  当然,如果要提供时间服务,还必须相应的设置iptable防火墙的配置。CentOS的时间服务使用udp 123端口。
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部