ntp时间同步服务部署

ntp时间同步服务部署

服务端 m01(10.0.0.61)
1、yum安装ntp

yum -y install ntp

2、配置服务端软件(将主配置文件中原来的主配置文件21-24行进行注释)

#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 ntp.aliyun.com iburst
server 127.127.1.0

3、重启ntp

systemctl restart ntpd
ntpq -p  查看状态
 (出现 LOCAL(0)        .LOCL.    证明成功了)
 时间匹配证明成功了

客户端
1、yum安装ntp

yum -y install ntp

2、输入命令

ntpdate  172.16.1.61   #跟服务端同步

3、编写定时任务

crontab  -e
*/1 * * * * /usr/sbin/ntpdate 172.16.1.61 >/dev/null 2>&1
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。