centos 7 安装NTP服务

1. 两台服务器

139(server端)

140(client端)

 

2.server端

2.1 yum安装

yum install ntp ntpdate

 

2.2 编辑配置文件

vim /etc/ntp.conf

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

server 192.168.116.139
fudge 127.127.1.0 stratum 11

2.3. 启动服务

systemctl start ntpd

systemctl enable ntpd.service #设置开机启动服务 

 

3. 客户端

3.1  yum安装

yum install ntp ntpdate

3.2 同步时间

ntpdate -d -b 192.168.116.139

3.3 编辑配置文件

和server端相同

3.4 启动服务

systemctl start ntpd

systemctl enable ntpd.service #设置开机启动服务 

 

posted @ 2018-11-04 17:13  duaner92  阅读(1526)  评论(0编辑  收藏  举报