llguo130 发表于 2013-2-4 13:37:44

linux 时间同步两法

1. 与一个已知的时间服务器同步2. 配置网络时间协议(ntp)1. 让linux自动同步时间vi /etc/crontab加上一句:00 0 1 * * root rdate -s time.nist.govtime.nist.gov 是一个时间服务器.2. 时间服务器配置(192.168.10.1)1). # rpm -ivh ntp-4.1.2-4.EL3.1.i386.rpm2). # vi /etc/ntp.conf注释一行restrict default ignore加入一行restrict 192.168.10.0 mask 255.255.255.0 notrust nomodify notrap3). # vi /etc/ntp/step-tickers加入一行pool.ntp.org这样每次ntpd启动时,会自动连接该国际标准时间服务器;4). # service ntpd start5). # netstat -an |grep 123确保该端口以udp方式开放时间客户端配置(192.168.10.2)1). # ntpdate 192.168.10.2应该显示同步成功2). # crond -e加入0-59/10 * * * * /usr/sbin/ntpdate 192.168.10.1表示每隔10分钟同步一次时间 
转自:http://blueicer.blog.51cto.com/395686/116426
 
页: [1]
查看完整版本: linux 时间同步两法