linux 时间同步

发布于 2020-11-09  342 次阅读


yum -y install ntpdate
ntpdate ntp1.aliyun.com
三、定时同步时间
  * * * * * /usr/sbin/ntpdate ntp1.aliyun.com > /dev/null 2>&1

2.查看时区:###

[root@k8s-node3 parallels]# ll /etc/localtime 
lrwxrwxrwx. 1 root root 41 Aug 10  2017 /etc/localtime -> ../usr/share/zoneinfo/America/Los_Angeles

3.修改时区:###

[root@k8s-node3 parallels]# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 
[root@k8s-node3 parallels]# ll /etc/localtime 
lrwxrwxrwx 1 root root 33 Dec 12 22:00 /etc/localtime -> /usr/share/zoneinfo/Asia/Shanghai
[root@k8s-node3 parallels]# date
Thu Dec 12 22:00:24 CST 2019
#查看时间还是不正确,重启
[root@k8s-node3 parallels]# reboot