NTP服务器搭建使用


1、让服务端同步互联网网络时间

服务端centos8
vim /etc/chrony.conf
  pool 2.rhel.pool.ntp.org iburst--> server ntp.aliyun.com iburst      服务端同步网络NTP
  allow 10.0.0.0/24   允许哪个网段进行同步   
  local stratum 10    提供本地时间同步
udp/123,udp/323监听端口提供网络服务
2、客户端配置
centos7-8客户端配置
vim /etc/chrony.conf
  server 10.0.0.202 iburst
  systemctl restart chronyd
chronyc sources -v    查看同步时间状态

^* 10.0.0.202 10 6 177 44 -396ns[-86400s] +/- 143us
* 号表示成功
centos6客户端配置
rpm -qi ntp
安装ntp包
vim /etc/ntp.conf
  server 10.0.0.202 iburst
service ntpd restart
ntpq -p 查看同步时间状态

#查看日期时间,时区及NTP状态
timedatectl
#修改时区
timedatectl set-timezone Asia/Shanghai
#查看时区列表
timedatectl list-timezones
#开启关闭ntp
timedatectl set-ntp true/false
#修改日期时间
timedatectl set-time "2020-01-23 20:30:00"
#图形化配置chrony服务的工具
system-config-date

posted @ 2020-07-22 15:34  duanpeng123  阅读(174)  评论(0)    收藏  举报