centos 7 安装NTP服务

本文详细介绍了如何在两台服务器上配置NTP服务进行时间同步。包括在server端使用yum安装NTP软件包,编辑ntp.conf配置文件,指定本地NTP服务器地址,并设置开机自启;在client端同样安装NTP,通过ntpdate命令同步时间,编辑配置文件并启动服务。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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 #设置开机启动服务 

 

转载于:https://www.cnblogs.com/duaner92/p/9904753.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值