ntp时间同步服务

ntp时间同步服务

时间同步服务(Time Synchronization Service)是一种确保计算机系统之间时间一致性的网络服务。它主要用于在分布式系统、服务器集群、网络设备等中保持统一的时间标准,以保障日志记录、事务处理、安全认证等功能的正确性和可靠性。

项目准备

版本 配置 IP
centos7 2C4H50G 192.168.0.10

国产源

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

扩展源

wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo

项目实战

安装时间服务

yum  -y install ntp

修改配置文件

restrict default nomodify   ##不允许客户端登录,也不允许客户端修改

server 127.127.1.0  ##使用本地的bios时间,自己跟自己同步
 
fudge 127.127.1.0 stratum 10  ##定义级别,范围0-16,越小越精准

启动服务

systemctl start ntpd && systemctl enable ntpd

同步阿里云时间

ntpdate ntp.aliyun.com

你可能感兴趣的:(学生党实战项目,运维,linux)