如下设置,不知时间服务器是否与授时中心服务器自动同步?什么时候同步一次?
还是要其他方面再设置一下?
我是在ubuntu server 10.04中如下设置NTP时间服务器:
sudo apt-get install ntp
vim /etc/ntp.conf
#中国国家授时中心服务器地址 prefer表示优先(默认)
server 210.72.145.44 prefer
server 218.21.130.42
restrict 192.168.2.0 mask 255.255.255.0 nomodify
restrict 127.0.0.1
restrict 0.0.0.0 mask 0.0.0.0 nomodify notrap noquery notrust
保存重启ntp服务
/etc/init.d/ntp restart
时间服务器如何设置与授时中心服务器自动定时同步?
-
- 帖子: 98
- 注册时间: 2009-12-10 15:27
时间服务器如何设置与授时中心服务器自动定时同步?
上次由 szfhx 在 2011-11-11 13:00,总共编辑 1 次。
- 大宝
- 帖子: 3077
- 注册时间: 2008-06-30 22:32
- 联系:
-
- 帖子: 98
- 注册时间: 2009-12-10 15:27
Re: 时间服务器是否与授时中心服务器自动同步?
那ubuntu 时间服务器如何设置与授时中心服务器自动定时同步?大宝 写了:天朝授时中心老差劲了,连接经常出问题
还是用 cn.pool.ntp.org 好
- 大宝
- 帖子: 3077
- 注册时间: 2008-06-30 22:32
- 联系:
Re: 时间服务器是否与授时中心服务器自动同步?
1、安装 NTP 是肯定的,LZ 已经写了,鄙人就不重复了szfhx 写了:那ubuntu 时间服务器如何设置与授时中心服务器自动定时同步?
2、若要每一小时自动同步一次,则在“/etc/cron.hourly”目录中新建一个脚本《ntp.sh》
(其它的文件夹“cron.daily”是每天执行一次,“cron.weekly”每周执行一次,类推)
代码: 全选
sudo gedit /etc/cron.hourly/ntp.sh
代码: 全选
#! /bin/bash
ntpdate -s cn.pool.ntp.org
hwclock --systohc
代码: 全选
sudo chmod 755 /etc/cron.hourly/ntp.sh
sudo chmod +x /etc/cron.hourly/ntp.sh

- 大宝
- 帖子: 3077
- 注册时间: 2008-06-30 22:32
- 联系:
Re: 时间服务器如何设置与授时中心服务器自动定时同步?
再增补一点备用的 ntp 服务器地址:
pool.ntp.org
asia.pool.ntp.org
tw.pool.ntp.org
hk.pool.ntp.org
pool.ntp.org
asia.pool.ntp.org
tw.pool.ntp.org
hk.pool.ntp.org
- dreamcast_sh
- 帖子: 480
- 注册时间: 2009-06-14 22:16
- 大宝
- 帖子: 3077
- 注册时间: 2008-06-30 22:32
- 联系:
Re: 时间服务器如何设置与授时中心服务器自动定时同步?
仔细想了一下,这方法不太好
查询了一下相关资料,据说系统会自动调整同步时间
又找了一下 ntp 服务器
所以还是调整一下,特别是桌面版照此执行
1、编辑《ntp.conf》
在文末添加
2、重启 ntp 服务
3、检查运行情况
或者
说明:
桌面版用户,还可以在“系统”>“系统管理”>“时间和日期”中添加服务器,并设置为自动同步
查询了一下相关资料,据说系统会自动调整同步时间
又找了一下 ntp 服务器
所以还是调整一下,特别是桌面版照此执行
1、编辑《ntp.conf》
代码: 全选
sudo gedit /etc/ntp.conf
代码: 全选
# NTP Server
server 0.cn.pool.ntp.org
server 1.cn.pool.ntp.org
server 2.cn.pool.ntp.org
server 3.cn.pool.ntp.org
server 0.asia.pool.ntp.org
server 1.asia.pool.ntp.org
server 2.asia.pool.ntp.org
server 3.asia.pool.ntp.org
server pool.ntp.org
代码: 全选
sudo /etc/init.d/ntp restart
代码: 全选
ntpq --numeric --peers
代码: 全选
ntpq -p
桌面版用户,还可以在“系统”>“系统管理”>“时间和日期”中添加服务器,并设置为自动同步
- seabee
- 帖子: 243
- 注册时间: 2006-11-08 13:02
Re: 时间服务器如何设置与授时中心服务器自动定时同步?
ntpq --numeric --peers
提示:
localhost: timed out, nothing received
***Request timed out
请问这个是什么回事?
/etc/ntp.conf 没有更改过。
提示:
localhost: timed out, nothing received
***Request timed out
请问这个是什么回事?
/etc/ntp.conf 没有更改过。
简简单单的生活,自自然然的我~www.3gcomet.com