Centos7下时间同步设置
Centos没有设置时区,导致时间不准确,在做定时器之类的时,会出现时间不准的问题 1、安装ntp服务软件包:yum install ntp -y 2、将ntp设置为缺省启动:systemctl enable ntpd 3、启动ntp服务:service ntpd restart 4. 将系统时区改为上海时间(即CST时区):ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 5. 输入date命令查看时间是否与当前时间一致 yum install ntp -y #安装ntp ntpdate -u ntp1.aliyun.com #同步时间 systemctl enable ntpd #将ntp设为缺省启动,这样一开机就会启动校准时间 service ntpd restart #启动ntp服务 ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime #改为上海时区 来源: CSDN 作者: shenming98 链接: https://blog.csdn.net/qq_42679299/article/details/103753792