RHEL 7.6 设置时间同步ntp

Posted ericnie

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了RHEL 7.6 设置时间同步ntp相关的知识,希望对你有一定的参考价值。

1.服务端和客户端

安装包,检查状态

yum install ntp ntpdate -y

systemctl start ntpd
systemctl status ntpd

2.服务端

修改配置

vi /etc/ntp.conf

#server 0.rhel.pool.ntp.org iburst
#server 1.rhel.pool.ntp.org iburst
#server 2.rhel.pool.ntp.org iburst
#server 3.rhel.pool.ntp.org iburst

server 127.127.1.0
fudge 127.127.1.0 stratum 10

 

重启服务,并查看

systemctl start ntpd

ntpq -p

3.客户端

修改配置

vi /etc/ntp.conf

restrict 192.168.7.1 nomodify notrap noquery

server 192.168.7.1  Fudge 192.168.7.1  stratum 10
#server 0.rhel.pool.ntp.org iburst
#server 1.rhel.pool.ntp.org iburst
#server 2.rhel.pool.ntp.org iburst
#server 3.rhel.pool.ntp.org iburst

 

systemctl restart ntpd

ntpdate -u 192.168.7.1

ntpq -p

systemctl enable ntpd

 

以上是关于RHEL 7.6 设置时间同步ntp的主要内容,如果未能解决你的问题,请参考以下文章

CentOS 7.6安装配置Chrony同步系统时钟

linux ntp 时间同步

RHEL7 -- 使用Chrony设置时间与时钟服务器同步

Linux Chrony 设置服务器集群同步时间

NTP服务时间同步服务NTP

NTP服务时间同步服务NTP