我有一台服务器运行CentOS 7
要安装ntp模块,我遵循以下步骤:
yum install -y ntp
systemctl start ntpd
systemctl enable ntpd
systemctl status ntpd
timedatectl set-timezone America/Mexico_City服务正在运行,我没有发现任何错误,
systemctl status ntpd
● ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2018-04-07 12:43:43 CDT; 50min left
Process: 2652 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 2653 (ntpd)
CGroup: /system.slice/ntpd.service
└─2653 /usr/sbin/ntpd -u ntp:ntp -g
Apr 07 12:43:43 i7box ntpd[2653]: Listen normally on 6 enp3s0 fe80::1cfd:83c7:5a71:977c UDP 123
Apr 07 12:43:43 i7box ntpd[2653]: Listen normally on 7 lo ::1 UDP 123
Apr 07 12:43:43 i7box ntpd[2653]: Listening on routing socket on fd #24 for interface updates
Apr 07 12:43:43 i7box systemd[1]: Started Network Time Service但是当我输入timedatectl时
timedatectl
Local time: Sat 2018-04-07 12:43:45 CDT
Universal time: Sat 2018-04-07 17:43:45 UTC
RTC time: Sat 2018-04-07 17:43:45
Time zone: America/Mexico_City (CDT, -0500)
NTP enabled: no
NTP synchronized: yes
RTC in local TZ: no
DST active: yes
Last DST change: DST began at
Sun 2018-04-01 01:59:59 CST
Sun 2018-04-01 03:00:00 CDT
Next DST change: DST ends (the clock jumps one hour backwards) at
Sun 2018-10-28 01:59:59 CDT
Sun 2018-10-28 01:00:00 CSTNTP以NTP enabled: no形式出现,我已经打开了端口123/udp
is有一个遗漏的步骤?
发布于 2018-04-07 17:34:20
如果这确实是问题所在,那么制作NTP enabled: yes所缺少的步骤是:
timedatectl set-ntp trueHowever,您的 ntpd might即使没有:也能正常工作。
您可以使用ntpd -q查看更详细的信息。它将列出用于同步的服务器及其状态。这些服务器是在/etc/ntp.conf中配置的,您可以更改默认值
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst你身边的泳池服务器。目前,mx.pool.ntp.org没有足够的服务器(您可以使用加入游泳池):
该区域没有足够的服务器,因此我们建议您使用北美区域(
north-america.pool.ntp.org):服务器0.North-america.info.gov.hk.ntp.org服务器1.North-america.info.gov.hk.ntp.org服务器2.North-america.info.gov.hk.ntp.org服务器3.North-america.info.gov.hk.ntp.org.
https://serverfault.com/questions/906545
复制相似问题