您现在的位置是:首页 > 文章详情

CentOS 集群 NTP 时钟同步配置教程

日期:2017-11-13点击:807

1.  安装 NTP 软件 (集群所有机器)

 

[plain] view plain  copy

 

  1. # yum -y install ntp  

2.  配置 NTP Server (NTP 服务提供主机)

2.1  设置 NTP 服务开机自启动

 

[plain] view plain  copy

 

  1. # systemctl enable ntpd  
  2. # systemctl start ntpd   

2.2  编辑 /etc/ntp.conf 配置文件

 

       注释掉默认的server,添加本地server,然后重启服务

       

 

[plain] view plain  copy

 

  1. # systemctl restart ntpd  

3.  配置 NTP Client (NTP服务使用主机)

 

3.1   禁用 NTP 服务

 

[plain] view plain  copy

 

  1. # systemctl disable ntpd  
  2. # systemctl stop ntpd  

3.2  使用定时器作定期时间同步

 

 

[plain] view plain  copy

 

  1. # vim /etc/crontab  

       



       每隔10分钟同步一次时钟,配置如下:

 

 

[plain] view plain  copy

 

  1. */10 * * * * root ntpdate <你的NTP服务提供主机IP> && hwclock -w  

       重启 crond 服务

 

 

[plain] view plain  copy

 

  1. # systemctl restart crond  



       至此,Client 机器的时钟会定期向 Server 同步,以保证整个集群时间一致!

原文链接:https://www.centoschina.cn/course/install/9206.html
关注公众号

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。

持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。

文章评论

共有0条评论来说两句吧...

文章二维码

扫描即可查看该文章

点击排行

推荐阅读

最新文章