NTP的架构和原理
2.1.什么是NTP?
NTP是网络时间协议(Network Time Protocol),它是用来同步网络中各个计算机的时间的协议。
2.NTP的架构?
典型的C/S架构。
PS:NTP默认只会同步时间,不会修改时区。
步骤:
1.安装ntp
yum install ntp
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
在下面再添加一行
#127.127指本地
server 127.127.1.0 iburst
启动ntp服务
systemctl start ntpd
systemctl enable ntpd
3.每个客户端(其他主机)都要安装ntp
yum install ntp
4.配置客户端文件
vim /etc/ntp.conf
#注释掉其他上游时间服务器
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.