关于程序员:云服务器快速配置阿里巴巴NTP网络时间协议

3次阅读

共计 2538 个字符,预计需要花费 7 分钟才能阅读完成。

一.为什么要切换应用阿里云的公共 NTP 服务器呢?
NTP 是网络工夫协定 (Network Time Protocol),它是用来同步网络中各个计算机的工夫的协定。
为什么批改云服务器的 DNS 呢,中国工夫服务器,国内阿里云工夫服务器
很多用户应用的是国外 VPS
应用过程中经常遇到工夫与国内不同步的状况
好在阿里提供了 NTP 服务器,地址如下:
阿里云镜像站官网:https://developer.aliyun.com/…
阿里云 NTP 服务器官网:https://developer.aliyun.com/…
二.如何切换应用阿里云 NTP 服务器。
Linux 服务器上疾速配置阿里巴巴 OPSX NTP 服务
编辑文件 “/etc/ntp.conf”,依据状况批改文件内容为:
互联网上的服务器:
driftfile /var/lib/ntp/drift
pidfile /var/run/ntpd.pid
logfile /var/log/ntp.log
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
server 127.127.1.0
fudge 127.127.1.0 stratum 10
server ntp.aliyun.com iburst minpoll 4 maxpoll 10
restrict ntp.aliyun.com nomodify notrap nopeer noquery

阿里云 ECS 服务器:
driftfile /var/lib/ntp/drift
pidfile /var/run/ntpd.pid
logfile /var/log/ntp.log
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
server 127.127.1.0
fudge 127.127.1.0 stratum 10
server ntp.aliyun.com iburst minpoll 4 maxpoll 10
restrict ntp.aliyun.com nomodify notrap nopeer noquery
server ntp1.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
restrict ntp1.cloud.aliyuncs.com nomodify notrap nopeer noquery
server ntp2.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
restrict ntp2.cloud.aliyuncs.com nomodify notrap nopeer noquery
server ntp3.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
restrict ntp3.cloud.aliyuncs.com nomodify notrap nopeer noquery
server ntp4.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
restrict ntp4.cloud.aliyuncs.com nomodify notrap nopeer noquery
server ntp5.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
restrict ntp5.cloud.aliyuncs.com nomodify notrap nopeer noquery
server ntp6.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
restrict ntp6.cloud.aliyuncs.com nomodify notrap nopeer noquery
三.其余公共举荐的 NTP 服务器
应用以前请先 ping 相应的域名查看网络是否可达,和相应的访问速度

ntp.ntsc.ac.cn 中国国家授时核心
cn.ntp.org.cn 中国授时

阿里云 NTP 工夫源服务器
ntp1.aliyun.com
ntp2.aliyun.com
ntp3.aliyun.com
ntp4.aliyun.com
ntp5.aliyun.com
ntp6.aliyun.com
ntp7.aliyun.com

国内一些大学 NTP 工夫源服务器
s1a.time.edu.cn 北京邮电大学
s1b.time.edu.cn 清华大学
s1c.time.edu.cn 北京大学
s1d.time.edu.cn 东南大学
s1e.time.edu.cn 清华大学
s2a.time.edu.cn 清华大学
s2b.time.edu.cn 清华大学
s2c.time.edu.cn 北京邮电大学
s2d.time.edu.cn 西南地区网络核心
s2e.time.edu.cn 西北地区网络核心
s2f.time.edu.cn 东北地区网络核心
s2g.time.edu.cn 华东南地区网络核心
s2h.time.edu.cn 四川大学网络管理核心
s2j.time.edu.cn 大连理工大学网络核心
s2k.time.edu.cn CERNET 桂林主节点
s2m.time.edu.cn 北京大学

另外,如果服务器在国外,苹果提供的公共 NTP 服务,以下 7 个域名
http://time1.apple.com
http://time2.apple.com
http://time3.apple.com
http://time4.apple.com
http://time5.apple.com
http://time6.apple.com
http://time7.apple.com

Google(谷歌)提供的 NTP 服务,以下 4 个域名
http://time1.google.com
http://time2.google.com
http://time3.google.com
http://time4.google.com

正文完
 0