服务器之家:专注于服务器技术及软件下载分享
分类导航

Linux|Centos|Ubuntu|系统进程|Fedora|注册表|Bios|Solaris|Windows7|Windows10|Windows11|windows server|

服务器之家 - 服务器系统 - Linux - Linux配置时间同步以及国内常用的NTP服务器地址

Linux配置时间同步以及国内常用的NTP服务器地址

2020-08-13 23:33Linux之家 Linux

有时服务器需要调整时区并调整时间,需要用到的命令:ntpdate 一般Linux系统都默认安装了NTP服务,如果没有安装的话,也可以直接使用yum安装,yum安装命令为:yum install -y ntpdate

    有时服务器需要调整时区并调整时间,需要用到的命令:ntpdate 一般Linux系统都默认安装了NTP服务,如果没有安装的话,也可以直接使用yum安装,yum安装命令为:yum install -y ntpdate

首先修改一下时区为上海时区:

  1. cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 

然后选择国家授时中心的服务器地址:ntpdate 210.72.145.44
注意:使用ntpdate命令的时候,必须关闭NTP服务,否则会报错,关闭命令: /etc/init.d/ntpdate stop
在定时任务#crontab -e中加入一行代码,使它每隔一分钟自动与NTP服务器同步,代码如下:

  1. */1 * * * * ntpdate 210.72.145.44 

国内常用的NTP服务器地址:

  1. 210.72.145.44 (国家授时中心服务器IP地址) 
  2. ntp.sjtu.edu.cn 202.120.2.101 (上海交通大学网络中心NTP服务器地址) 
  3. s1a.time.edu.cn 北京邮电大学 
  4. s1b.time.edu.cn 清华大学 
  5. s1c.time.edu.cn 北京大学 
  6. s1d.time.edu.cn 东南大学 
  7. s1e.time.edu.cn 清华大学 
  8. s2a.time.edu.cn 清华大学 
  9. s2b.time.edu.cn 清华大学 
  10. s2c.time.edu.cn 北京邮电大学 
  11. s2d.time.edu.cn 西南地区网络中心 
  12. s2e.time.edu.cn 西北地区网络中心 
  13. s2f.time.edu.cn 东北地区网络中心 
  14. s2g.time.edu.cn 华东南地区网络中心 
  15. s2h.time.edu.cn 四川大学网络管理中心 
  16. s2j.time.edu.cn 大连理工大学网络中心 
  17. s2k.time.edu.cn CERNET桂林主节点 
  18. s2m.time.edu.cn 北京大学 

延伸 · 阅读

精彩推荐