others linux服务器运维 django3 监控 k8s golang 数据库 大数据 前端 devops 理论基础 java oracle 运维日志

麒麟v10 kylin v10 搭建不联网的ntp服务 不能访问外网的ntp

访问量:122 创建时间:2025-11-16

安装ntp服务

yum install ntp
rpm -qa | grep ntp

修改配置文件

配置文件中没有server开头的配置,如果有需要注释掉

vim /etc/ntp.conf

server 127.127.1.0
fudge  127.127.1.0 stratum 10
#10.0.0.0改为你的网络
restrict 10.0.0.0 mask 255.255.255.0 nomodify notrap # nomodify表示客户端不能更改服务器端的时间参数

启动服务

systemctl restart ntpd
systemctl enable ntpd
systemctl status ntpd

服务端配置后要等5分钟再配置客户端和同步时间数据。否则会报错。

客户端配置

yum install ntp
vim /etc/ntpd.conf
server 你的ntpd服务器ip
systemctl restart ntpd
也可以设置crontab同步,通过ntpdate IP来同步时间
登陆评论: 使用GITHUB登陆