CentOS自动同步时间

安装ntpdate

yum install ntpdate -y

测试是否正常

ntpdate cn.ntp.org.cn

# 正常情况
[[email protected] www]# ntpdate cn.ntp.org.cn
 3 Mar 20:52:20 ntpdate[9748]: adjust time server 202.108.6.95 offset -0.017460 sec

设置定时任务

crontab -e
*/10 * * * * ntpdate cn.ntp.org.cn

NTP服务器列表

区域[zone] 域名[Domain] IP池[IP Pool]
中国[China] cn.ntp.org.cn [223.65.211.42][223.65.205.2]223.113.97.99,[202.112.29.82] [202.108.6.95] [120.25.108.11] [182.92.12.11] [115.28.122.198]
中国教育网[China-EDU] edu.ntp.org.cn [202.112.31.197][202.112.29.82][202.118.1.130][202.118.1.81](所有节点由东北大学提供赞助)
中国台湾[ChinaTaiwan] tw.ntp.org.cn [123.204.45.116] [103.18.128.60]
美国[America] us.ntp.org.cn [24.56.178.140] [216.218.254.202] [208.53.158.34] [66.228.42.59]
新加坡[Singapore] sgp.ntp.org.cn [103.11.143.248] [202.73.57.107] [128.199.134.40] [218.186.3.36] [188.166.245.58]
韩国[korea] kr.ntp.org.cn [211.233.40.78] [106.247.248.106]
德国[Germany] de.ntp.org.cn [131.188.3.220] [131.188.3.223]
日本[Japan] jp.ntp.org.cn [133.100.11.8] [106.187.100.179] [129.250.35.251]

参考:

全球可用的NTP服务器列表与解析服务 - ntp.org.cn & ntpdate.net

原文地址:https://www.cnblogs.com/okokabcd/p/8503676.html

时间: 2024-08-28 11:18:34

CentOS自动同步时间的相关文章

怎么让CentOS集群自动同步时间

怎么让CentOS集群自动同步时间?首先机器要连外网,这样才能从互联网上同步时间,这是首先要了解的.好了,主要的方法如下: 在除了运行ntpd之外的机器上,执行: [html] # chkconfig --list | grep ntpd 看看ntpd有没有开机自启动(如果显示的全为off则表明不是开机自启动),如果是开机自启动的,需要执行: [html] # chkconfig ntpd off 关闭ntpd,如果ntpd开着,ntpdate没办法从其他服务器同步时间的. 然后在/etc/rc

CentOS集群自动同步时间的一种方法

之前有篇日志是手动同步时间的 http://www.ahlinux.com/os/201304/202456.html 之所以这么干,是因为我们实验室的局域网只有一部分IP可以访问外网,服务器所用的IP恰好上不了外网,没法从互联网上同步时间,只好在本地设一台ntp服务器,从这一台机器同步时间了. 可是昨晚上实验室停电,今天早上开机之后发现服务器的时间差了不少(那几台作为服务器的台式机都5.6年了,估计是CMOS电池不行了). 手动一台台地同步时间(执行ntpdate xxx)实在很麻烦. 于是尝

centos NTP同步时间

centos系统时间同步和网络同步 一般新装的centos系统服务器有的时间可能不对或者设置了错误的时区,可以使用NTP从时间服务器同步. 1.把当前时区调整为上海+8区,想改其他时区也可以.在/usr/share/zoneinfo目录 cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 2.安装ntpdate yum install -y ntpdate 3.使用ntpdate同步标准时间(或者同步其他的时间服务器) ntpdate us.p

centos7上使用chrony自动同步时间

作用: 在linux中,有些服务必须依靠准确的时间,才能够在运行的时候不出差错,例如DNS,LVS,HTTPS等,都需要后台的服务器之间保持时间的同步.而Centos系统中自带的有安装对应的同步时间的服务.centos7中默认安装的是chrony,而Centos6相比在时间服务有所不同,使用了ntp服务来同步时间,而在Centos7上则使用的是chrony服务来同步时间,相较与ntp服务.chrony服务有如下几点优势: 1,更快的同步只需要数分钟而非数小时时间,从而最大程度减少了时间和频率误差

利用ntp自动同步时间

实验环境:centos 6.10 1.安装ntp工具 yum install -y ntp 2.便宜/etc/ntp.conf文件,添加远程时间服务器 server ntp1.aliyun.com server ntp2.aliyun.com server ntp3.aliyun.com server ntp4.aliyun.com 3.启动ntpd后台进程,设置开机启动 service ntpd start chkconfig ntpd on 原文地址:https://www.cnblogs.

Linux服务器设置自动同步时间

登录Linux服务器的时候,你可能发现与实际时间不一样,需要调整 安装ntpdate >yum install ntp 输入ntpdate time.nist.gov 其中 time.nist.gov 是一个时间服务器. 如此,设置时间OK了.

解决 RaspberryPi 树莓派 NTP服务异常 无法自动同步时间

sudo nano /etc/ntp.conf 然后找到 # pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will# pick a different set every time it starts up. Please consider joining the# pool: <http://www.pool.ntp.org/join.html>server 0.debain.pool.ntp.or

centos7 自动同步时间

rm -rf /etc/localtime ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime vim /etc/sysconfig/clock ZONE="Asia/Shanghai" UTC=false ARC=false yum install -y ntp systemctl start ntpd systemctl enable ntpd vim /etc/rc.d/rc.local /usr/sbin/ntpdate

linux时间自动同步

1,修正本地时区及ntp服务 #yum -y install ntp#rm -rf /etc/localtime#ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime#/usr/sbin/ntpdate -u pool.ntp.org2,自动同步时间#添加下面一段#表示每10分钟同步一次 #crontab -e */10 * * * * /usr/sbin/ntpdate -u pool.ntp.org >/dev/null 2>&