我有一个运行精简版 Ubuntu 的(物理)盒子;时不时地(3 个月内 6 次),时钟向后跳正好 300 秒(+- 0.01 秒;总是正好 300 秒)。它从一分钟到下一分钟发生(我有一台外部机器每分钟轮询一次)。
该盒子正在运行 2.6.26-generic(自定义编译内核)、Ubuntu 9.04(我知道,我正在尝试更新它,但它是半嵌入式的)。日志中没有任何内容表明发生了什么,而且我有大量的 pool.ntp.org ntp 服务器可供选择,它们会在一段时间后更正问题。
有谁知道这可能导致什么?
附加 1:
我还有许多其他机器运行相同的内核(二进制相同),以及相同软件的微小变化,它们没有这个问题。我也换了硬件。
附加 2(我个人评论的摘要):
如何通过获取 NTP 更新来判断我的 Debian 系统是否保持系统时间准确?基本上我想打开它,如果它当前关闭,但我不知道它是打开还是关闭。
我有一个 GPS 连接到我的系统,如果我将系统时间更改为比 GPS 时间提前/落后不到 4 小时,请ntpd确保更新系统时间以匹配 GPS 时间。但是,如果该偏移量超过 4 小时,则不会进行更新。
我确保ntpd使用该-g选项运行,但它仍然不起作用,除非我使用普通的 ntp 服务器,例如server 0.debian.pool.ntp.org iburst在/etc/ntp.conf 中。但是,让我们假设所讨论的系统在正常运行期间无法访问 Internet。
该文件中的其他相关设置是:
server 127.127.28.0 minpoll 4 maxpoll 4
fudge 127.127.28.0 time1 0.420 refid GPS
server 127.127.28.1 minpoll 4 maxpoll 4 prefer
fudge 127.127.28.1 refid GPS1
Run Code Online (Sandbox Code Playgroud)
(来源:gpsd联机帮助页)
我什tinker panic 0至添加到该配置中,只是为了确保,但仍然没有运气。
CentOS 6.x | OpenVZ
我想在我的 vps 主机上运行 NTP 服务器。这可能吗?
当我尝试启动 ntpd 时,它立即失败并出现以下错误:
Mar 14 22:47:44 ev1 ntpd[3456]: cap_set_proc() failed to drop root privileges: Operation not permitted
Run Code Online (Sandbox Code Playgroud)
我已将其本地化为 /etc/sysconfig/ntpd 中的设置
# Drop root to id 'ntp:ntp' by default.
OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -g"
Run Code Online (Sandbox Code Playgroud)
启用此行时,它会失败(大概是因为共享内核拒绝允许权限更改)。如果我将其注释掉,ntpd 运行良好,但以 root 身份运行,这是一件坏事。
无论如何让ntpd在openVZ上以ntp用户身份运行?诚然,我知道在 OpenVZ 服务器上运行它是一个好主意,但我仍然想尝试一下。
我的 raspi 运行 Arch 没有使用 NTPD 更新时间。我在跑
[root@fatpi ~]# cat /proc/version
Linux version 3.10.28-1-ARCH (nobody@root-armv6-copy) (gcc version 4.8.2 20131219 (prerelease) (GCC) ) #1 PREEMPT Tue Jan 28 15:46:05 MST 2014
Run Code Online (Sandbox Code Playgroud)
所以我停止服务并尝试使用 ntpdate 进行更新,但是“ntpdate -sb”不起作用,奇怪的是“ntpdate -qd”将输出正确的日期和偏移量:
[root@fatpi ~]# ntpdate -dq time.nist.gov
31 Dec 18:09:13 ntpdate[299]: ntpdate 4.2.6p5@1.2349-o Sat Jan 11 17:42:10 UTC 2014 (1)
Looking for host time.nist.gov and service ntp
host found : nist1-chi.ustiming.org
transmit(216.171.120.36)
receive(216.171.120.36)
transmit(216.171.120.36)
receive(216.171.120.36)
transmit(216.171.120.36)
receive(216.171.120.36)
transmit(216.171.120.36)
receive(216.171.120.36)
server 216.171.120.36, port 123
stratum 1, precision -29, …Run Code Online (Sandbox Code Playgroud) 我有几个关于 NTP Nanokernel 的问题,如下所述:http ://www.eecis.udel.edu/~mills/database/brief/nano/nano.pdf
最大的问题是这个 Nanokernel 如何设法提供低于系统时钟滴答的精度(例如 ns 精度)?
我有几个次要问题:
“进程周期计数器 (PCC) 用于在滴答中断之间插入微秒或纳秒”
它是如何使用循环计数器的,因为据我所知它不传递中断,因此 Nanokernel 是否会连续读取包含当前计数器的处理器注册表值?
我的 OpenBSD 主机正在运行 NTPD,但慢了 26 秒,尽管它说“时钟同步”:
user@host:~# ntpctl -sa
4/4 peers valid, clock synced, stratum 3
peer
wt tl st next poll offset delay jitter
216.239.35.0 time1.google.com
1 10 2 1063s 1078s -1.951ms 101.103ms 0.594ms
216.239.35.4 time2.google.com
* 1 10 2 481s 1067s -1.742ms 112.251ms 0.447ms
216.239.35.8 time3.google.com
1 10 2 729s 991s -1.472ms 11.454ms 0.169ms
216.239.35.12 time4.google.com
1 10 2 830s 1051s -2.203ms 268.285ms 8.564ms
Run Code Online (Sandbox Code Playgroud)
/etc/ntpd.conf 内容:
server time1.google.com
server time2.google.com
server time3.google.com
server time4.google.com
Run Code Online (Sandbox Code Playgroud)
/etc/rc.conf.local 内容:
nsd_flags=
ntpd_flags=-s …Run Code Online (Sandbox Code Playgroud) 我有一个我现在正在管理的服务器有时钟漂移,我想在不导致服务器上的时间跳回的情况下纠正差异。
我已经阅读了关于闰秒涂抹的技术,并想知道是否有类似的方法来涂抹 ntp 修正(特别是修正是否会使系统时钟倒转)?
我正在努力理解为什么 ntp(服务)不会在我的树莓派上正确设置时间。
我已将文件系统配置为只读,以保存我的 SD 卡,但它曾经可以工作,而且我似乎无法弄清楚为什么 ntp 现在无法工作。
在日志中,我收到了该消息的许多行:
ntpd[415]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
ntpd[415]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
ntpd[415]: error resolving pool 0.debian.pool.ntp.org: Temporary failure in name resolution (-3)
ntpd[415]: error resolving pool 1.debian.pool.ntp.org: Temporary failure in name resolution (-3)
ntpd[415]: error resolving pool 2.debian.pool.ntp.org: Temporary failure in name resolution (-3)
ntpd[415]: error resolving pool 3.debian.pool.ntp.org: Temporary failure in name resolution (-3)
ntpd[415]: error resolving pool 3.debian.pool.ntp.org: Temporary failure in name resolution (-3)
ntpd[415]: error resolving …Run Code Online (Sandbox Code Playgroud) 运行 CentOS 5.8 版
我在我修复的服务器上遇到了时间漂移问题 - 它没有同步 hwclock,因此在重新启动时 ntp 将关闭超过 1000 秒并且永远不会同步时间。
在调查问题时,我注意到 ntpd 定期与 Local(0) 同步。
“答案” - 您不需要使用 Undisciplined Local Clock,除非您想在连接到其他时间服务器失败时将此服务器用作本地时间服务器。
来自 ntpd 的日志消息:
Jul 20 03:47:49 localhost ntpd[5441]: synchronized to 110.14.8.1, stratum 3
Jul 20 04:21:06 localhost ntpd[5441]: synchronized to LOCAL(0), stratum 10
Jul 20 04:38:09 localhost ntpd[5441]: synchronized to 110.14.8.1, stratum 3
Jul 20 04:55:26 localhost ntpd[5441]: synchronized to LOCAL(0), stratum 10
Run Code Online (Sandbox Code Playgroud)
ntpd.conf:
# Use public servers from the pool.ntp.org project.
# …Run Code Online (Sandbox Code Playgroud)