redhat7.2 centos7.2怎么配置ntp服务器

2025-10-27 12:05:18

1、redhat版本不同ntp的版本可能也会有所变化,在安装之前需要查找ntp服务,看下是否存在:

yum search ntp

redhat7.2 centos7.2怎么配置ntp服务器

2、查找到ntp.x86_64,使用yum进行安装。安装时.x64_64可以不输入。

yum install -y ntp

-y:不提示,直接安装

redhat7.2 centos7.2怎么配置ntp服务器

3、进入ntp配置目录:

vi /etc/ntp.conf

4、进入ntp.conf配置文件,注释以server开头的配置,并添加内容:server 127.127.1.1

添加完成保存退出。

redhat7.2 centos7.2怎么配置ntp服务器

5、重启ntp服务器,并查看状态是否running。

systemctl restart ntpd.service   #重启服务

systemctl status  ntpd.service   #查看状态

redhat7.2 centos7.2怎么配置ntp服务器

6、查看ntp服务是否能够被同步,显示为“LOCAL”,表示成功。如果没有任何显示,客户端将无法同步。

redhat7.2 centos7.2怎么配置ntp服务器

1、服务器已经配置完成,现在是Client配置,测试Client能否与Server相连。

redhat7.2 centos7.2怎么配置ntp服务器

2、在Clientt上使用ntpdate来同步:ntpdate 192.168.116.2

同步后反馈是是成功同步的。

redhat7.2 centos7.2怎么配置ntp服务器

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢