003.NTP客户端配置

一 NTP客户端同步方式

  • ntpdate定时任务同步
  • ntp服务同步

二 ntpdate定时任务同步

2.1 安装ntp软件

  1 [root@client ~]# yum -y install ntp #此方式也可只安装nptdate
  2 
  3 [root@client ~]# ntpdate 172.24.8.30 #ntpdate命令同步即可

06

三 ntp服务同步

3.1 安装ntp软件

  1 [root@client ~]# yum -y install ntp #此方式也可只安装nptdate

3.2 ntp配置

  1 [root@client ~]# vi /etc/ntp.conf
  2 
  3 restrict 172.24.8.30 nomodify notrap noquery
  4 
  5 server 172.24.8.30 iburst
  6 
  7 server 127.127.1.0
  8 
  9 fudge 127.127.1.0 stratum 10

3.3 启动服务

  1 [root@client ~]# systemctl start ntpd.service
  2 
  3 [root@client ~]# systemctl enable ntpd.service

3.4 检测状态

  1 [root@client ~]# ntpdate -u 172.24.8.30 #先手动同步测试一次
  2 
  3 [root@client ~]# systemctl start ntpd.service
  4 
  5 [root@client ~]# systemctl enable ntpd.service

07

猜你喜欢

转载自www.cnblogs.com/itzgr/p/9888662.html
今日推荐