我正在尝试在本地 Ubuntu 机器上安装时间服务器,以便我网络中的其他服务器与其同步。我们决定安装我们自己的时间服务器,而不是让每个服务器从外部服务器更新,以最大限度地降低安全风险。
我将不胜感激任何帮助或参考链接!
谢谢,
乌迪
我的 PC 上出现此错误:
频率错误 -1732 PPM 超出容差 500 PPM
有任何想法吗?
所以,我的服务器生活在未来,不幸的是我无法获得彩票号码,或从中挑选股票。
它认为是时候了:
Thu Nov 7 04:07:18 EST 2013
不正确,我尝试通过日期以多种方式手动设置时间
# date -s "06 NOV 2013 14:48:00"
# date 110614482013 -- 同样的输出,同样的问题
哪个输出
Wed Nov 6 14:48:00 EST 2013,但是当我再次检查日期时,它仍然设置为 11 月 7 日 0400 或其他什么。
我检查了我的系统消息,我经常看到这个弹出窗口:
Nov 7 03:54:00 www ntpd[4482]: time correction of -47927 seconds exceeds sanity limit (1000); set clock manually to the correct UTC time.
这是有道理的,我们离正确的时间很远。但我似乎无法手动修复它。那么现在怎么办?
另外,我想知道我的硬件时钟是否设置正确,hwclock不返回任何值。这会引起问题吗?
这是一个虚拟化服务器,我没有直接访问管理程序的权限,但我可以和谁联系,假设我可以很好地解释自己。
谢谢
在我的服务器中,ntpd 服务已启动,但似乎不起作用。
我找不到任何根据这个(ntpd日志文件位于哪里,以及我们如何配置ntpd日志文件路径?)和这个(在哪里可以查找ntpd日志?):-(
根据MadHatter的建议(请参阅如何持续与NTP服务器同步系统时间?),我列出了我的服务器中的一些信息:
ntpdate返回:
2 May 21:47:55 ntpdate[47274]: the NTP socket is in use, exiting
Run Code Online (Sandbox Code Playgroud)
ntpq -c as返回:
ind assID status conf reach auth condition last_event cnt
===========================================================
1 22393 9614 yes yes none sys.peer reachable 1
2 22394 9414 yes yes none candidat reachable 1
3 22395 9414 yes yes none candidat reachable 1
Run Code Online (Sandbox Code Playgroud)
ntpq -c pe返回:
remote refid st t when poll reach delay offset jitter
==============================================================================
*time5.aliyun.co …Run Code Online (Sandbox Code Playgroud) 当我在 Ubuntu 中按照以下步骤操作时,NTP 已启用并同步。然而,Debian Jessie 中的情况却相反。有人知道 Debian 说“不”的原因吗?由于“当地时间”是正确的,我还应该担心吗?
采取的步骤
$ timedatectl set-timezone Europe/London
$ sudo apt-get install -y ntp
$ cat /etc/ntp.conf
driftfile /var/lib/ntp/ntp.drift
server 0.uk.pool.ntp.org iburst
server 1.uk.pool.ntp.org iburst
server 2.uk.pool.ntp.org iburst
server 3.uk.pool.ntp.org iburst
restrict 127.0.0.1
restrict ::1
$ service ntp stop
$ ntpd -gq
$ service ntp start
$ systemctl enable ntp
$ systemctl restart ntp
Run Code Online (Sandbox Code Playgroud)
Debian 状态
$ timedatectl
Local time: Sun 2018-05-27 08:57:32 BST
Universal time: Sun 2018-05-27 07:57:32 UTC
RTC time: Sun 2018-05-27 07:57:30 …Run Code Online (Sandbox Code Playgroud) 我的任务是将 linux 设备与 ntp 服务器同步。文档说默认情况下 ntpd 检查系统时间和服务器时间之间的差异,如果偏移量在恐慌阈值内(默认为 1000 秒),ntpd 开始缓慢校正系统时间。好的,这对我有好处,我需要那种行为。
我手动设置系统时间,然后启动ntpd。使用命令 ntpq -c peers 我可以查找同步过程。它显示该设备链接到服务器并获取数据包。但是一两分钟后系统时间就向服务器时间迈出了一大步。这在我的情况下很糟糕,我需要慢慢纠正。我没有工作的想法为什么会这样!!!
我用不同的服务器和 linux mashine 尝试了这个,一切都一样。
基于树莓派 2 的设备,使用 buildroot 构建 linux 映像。
# ntpd --version
ntpd 4.2.8p2@1.3265-o Fri Jul 29 11:57:46 UTC 2016 (1)
#
# uname -a
Linux buildroot 3.18.12-v7 #3 SMP PREEMPT Thu May 12 17:53:44 MSK 2016 armv7l GNU/Linux
#
# cat /etc/ntp.conf
server 10.0.0.111 #my local server
driftfile /etc/ntp.drift
logfile /var/log/ntp/ntp.log
restrict 10.0.0.111 nomodify noquery #ban any packets from server, which send …Run Code Online (Sandbox Code Playgroud)