我试图在RHEL7.4上配置NTP客户端,我正在运行"ntpstat“命令,并看到我已经同步了:
[root@my-machine ~]# ntpstat
synchronised to NTP server (ntp-server ip) at stratum 5
time correct to within 1173 ms
polling server every 64 s但是,当我运行"ntpq -p“命令时,我得到了一个错误:
[root@my-machine ~]# ntpq -p
localhost.ntp-server.com: timed out, nothing received
***Request timed out出于某种原因,NTP在ntp-服务器主机名中添加了一个前缀"localhost“。
这是我的/etc/ntp.conf:
[root@my-machine ~]# egrep -v '^#|^[[:blank:]]*我应该使用"ntpq -np“使"ntpq”命令作为Cloudera集群和cloudera代理的机器部分工作,以确保NTP是同步的。 /etc/ntp.conf
driftfile /var/lib/ntp/drift
restrict default nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1
server ntp-server.com prefer iburst我应该使用"ntpq -np“使"ntpq”命令作为Cloudera集群和cloudera代理的机器部分工作,以确保NTP是同步的。
发布于 2018-05-03 16:10:16
我已经解决了这个问题。由于某种奇怪的原因,/etc/host中根本没有本地主机行。
因此,我把下面的行附加到/etc/host:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6一旦我加了这样的台词,问题就解决了。
https://unix.stackexchange.com/questions/441539
复制相似问题