centos系统时间同步

Linux

centos系统时间同步

2022-12-12 15:40


                                            




linux系统的时间同步主要分两种:

下面主要针对centos系统进行说明,其他系统都类似

 

一、同步时区

date -R #查看时区

timedatectl list-timezones #列出所有时区

timedatectl set-timezone Asia/Shanghai #设置系统时区为上海

二、同步时间

安装ntpdate工具

yum -y install ntp ntpdate

2.设置系统时间与网络时间同步

ntpdate http://cn.pool.ntp.org

3、再重新检查当前时间:

date

只有保证服务器时间是ok的,才能保证业务是正确的哈


标签:
  • 时间同步