码迷,mamicode.com
首页 > 其他好文 > 详细

ntp-redhat 同步时间配置

时间:2018-08-28 18:59:14      阅读:239      评论:0      收藏:0      [点我收藏+]

标签:EDA   1.0   systemctl   ict   端口   同步   火墙   任务   mct   

1. 选作一个机器作为ntp 服务端,例如 ip 为192.168.0.1

1)安装 ntp服务

yum install ntp

2) 修改ntp.conf 文件

vi /etc/ntp.conf

注释掉 #restrict 127.0.0.1

#restrict -6 ::1

#server 0.rhel.pool.ntp.org iburst

添加 server 192.168.0.1 iburst

server 127.127.1.0

fudge 127.127.1.0 stratum

3)保证防火墙关闭,或者放开端口 udp 123 ,启动ntp

systemctl start ntpd

systemctl enable ntpd

systemctl status ntpd

4) ntpq -p 确定ntp是否正常

2. 安装客户端

1)yum -y install chrony(ps.该服务在Redhat7以上默认有)

2)vim /etc/chrony.conf

server 192.168.0.1 iburst

3) systemctl enable chronyd

4)systemctl restart chronyd.service

5) timedatectl 即可同步时间

ps.也可以手动同步时间:ntpdate -u 192.168.0.1 将其加入到定时任务中

timedatectl set-ntp true (开启同步)

 

ntp-redhat 同步时间配置

标签:EDA   1.0   systemctl   ict   端口   同步   火墙   任务   mct   

原文地址:https://www.cnblogs.com/zyj-share/p/9549968.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!