ntp集群时间同步

部署企业内部NTP时间服务器,假设node0作为NTP时间服务器主节点,node1, node2都是ntp客户端从节点,内部网段10.10.75.0。

所有节点通过yum命令安装ntp,命令如下:yum install ntp 。

修改node0节点的配置文件/etc/ntp.conf,
内容如下:
server 0.cn.pool.ntp.org
server 0.asia.pool.ntp.org
server 3.asia.pool.ntp.org
restrict 0.cn.pool.ntp.org nomodify notrap noquery
restrict 0.asia.pool.ntp.org nomodify notrap noquery
restrict 3.asia.pool.ntp.org nomodify notrap noquery
#10.10.75.0网段的服务器都可以使用NTP服务器来同步时间。
restrict default ignore
restrict 10.10.75.0 mask 255.255.255.0 notrap nomodify
server 127.127.1.0 prefer
fudge 127.127.1.0 stratum 10
3.在node1、node2节点上,编辑/etc/ntp.conf
添加一句server NTP时间同步服务器IP地址 prefer

4.所有节点启动 ntp服务,把ntp服务设置为开机自启动,命令如下
service ntpd start
chkconfig ntpd on

从节点先使用ntpdate手动同步一下时间命令如下:ntpdate -u 主节点IP地址

posted on 2019-02-28 11:07  二两老酒  阅读(147)  评论(0编辑  收藏  举报

导航