步骤如下:
1. 确认没有运行ntp daemon。
# /etc/init.d/ntpd stop
2. 在/etc/ntp.conf中写入如下内容:
driftfile /etc/ntp/drift
logfile /var/log/ntp.log
server pool.ntp.org
注意:如果没有drift或logfile,需要手动创建之,并把权限设为root可读写,其他用户只读。
3. 用ntpdate手动更新时间。
这是因为当你的系统时间误差很大,有20~30分钟以上时,ntp的更新将非常慢,而ntpdate的更新一般是很快的。
# ntpdate pool.ntp.org
4. 启动ntp daemon。
# /etc/init.d/ntpd start
5. 检查ntpd的状态。
# ntpq -p如果见到ntp服务器的名字,那就说明启动成功了。
6. 添加ntpd为系统启动服务。
# chkconfig --add ntpd
# chkconfig --level 3 ntpd on
# chkconfig --level 012456 ntpd off
原创内容如转载请注明:来自 阿权的书房
1. 确认没有运行ntp daemon。
# /etc/init.d/ntpd stop
2. 在/etc/ntp.conf中写入如下内容:
driftfile /etc/ntp/drift
logfile /var/log/ntp.log
server pool.ntp.org
注意:如果没有drift或logfile,需要手动创建之,并把权限设为root可读写,其他用户只读。
3. 用ntpdate手动更新时间。
这是因为当你的系统时间误差很大,有20~30分钟以上时,ntp的更新将非常慢,而ntpdate的更新一般是很快的。
# ntpdate pool.ntp.org
4. 启动ntp daemon。
# /etc/init.d/ntpd start
5. 检查ntpd的状态。
# ntpq -p如果见到ntp服务器的名字,那就说明启动成功了。
6. 添加ntpd为系统启动服务。
# chkconfig --add ntpd
# chkconfig --level 3 ntpd on
# chkconfig --level 012456 ntpd off
原创内容如转载请注明:来自 阿权的书房
收藏本文到网摘
手指受伤了
鱼缸壁纸
