CentOS时间服务器搭建

Linux大全评论148 views阅读模式

最近经常遇到各服务器时间不同步导致一些故障,现在需要自己搭建一台CentOS时间服务器来调整

升级安装ntp时间包
# yum -y install ntp
具体配置修改了,这里我再查看配置文件,让注销的不显示
# grep -v "^#" >/etc/ntp.conf

restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery

restrict 127.0.0.1
restrict 192.168.10.0   mask 255.255.255.0    #这行是新添加的,让这个地址的能使用时间服务器,相当于acl控制
restrict -6 ::1

server ntp.fudan.edu.cn prefer #新添加了一个优先,prefer是表示优先的意思
server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org

server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10

driftfile /var/lib/ntp/drift
keys /etc/ntp/keys

启动服务

service ntpd start

netstat -tlunp

查看123udp端口是否启动起来,现在我们可以登陆客户机器同步了

企鹅博客
  • 本文由 发表于 2020年9月26日 20:29:00
  • 转载请务必保留本文链接:https://www.qieseo.com/142368.html

发表评论