Ubuntu如何同步网络时间

搭建集群后,总因为时间不一样,导致各种问题。

  1. 设定时区
dpkg-reconfigure tzdata
  • 选择Asia -> 再选择Shanghai -> OK

  1. 安装ntpdate工具
 apt-get install ntpdate
  1. 将系统时间与网络同步
ntpdate cn.pool.ntp.org
  1. 将时间写入硬件
hwclock --systohc
  1. 查看时间是否已同步
date 
posted @ 2021-02-06 14:52  邹姣姣  阅读(619)  评论(0编辑  收藏  举报