Centos7时间服务器ntp配置

2021-06-27  本文已影响0人  啊布多

yum install ntp

vim /etc/ntp.conf

restrict 192.168.179.21 nomodify notrap nopeer noquery          //当前节点IP地址
restrict 192.168.179.1 mask 255.255.255.0 nomodify notrap  //集群所在网段的网关(Gateway),子网掩码(Genmask)
server 127.127.1.0
Fudge 127.127.1.0 stratum 10
server 192.168.179.21
Fudge 192.168.179.21 stratum 10

netstat -anptu | grep 123

service ntpd start

ntpstat

ntpq -p

watch "ntpq -p"

chkconfig ntpd on

ntpq -p

firewall-cmd --zone=public --query-port=123/tcp

firewall-cmd --zone=public --add-port=123/tcp --permanent (permanent永久生效,没有此参数重启后失效)

firewall-cmd --zone=public --remove-port=123/tcp --permanent

ntpdate ntp1.aliyun.com

附阿里云时间服务器列表
ntp1.aliyun.com
ntp2.aliyun.com
ntp3.aliyun.com
ntp4.aliyun.com
ntp5.aliyun.com
ntp6.aliyun.com
ntp7.aliyun.com

上一篇 下一篇

猜你喜欢

热点阅读